BPF programs use single threaded LLD #6088
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Multi-threaded LLD is causing only partial relocation to take place. This results in what should be a double relocation (relocation of a symbol which contains an address that is also relocated) but only the first relocation is created correctly. The second relocation requires that an offset be written to the memory location being relocated, but that offset is zero in the final ELF. It's unclear why the LLD multi-threaded configuration is causing this issue and more investigation is warranted but not necessary at this time and will be time-consuming.
Summary of Changes
Use LLD in single-thread mode. There is very little performance impact since BPF programs include a small number of small object files.
The PR also pulls in rbpf changes that force a load failure if any invalid relocations are found.
Fixes #3108