So that binaries with both large and non-large sections will have the
non-large sections together, lowering the chance of relocation overflows
between the non-large sections.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
The MC and lld/ELF parts belong to different patches.
The SHF_X86_64_LARGE MC change should test llvm-readelf -S or llvm-readobj -S output.
I believe we should be able to rearrange the large sections to be "around" all of the other sections, rather than at the end, in order to reduce the overhead of additional LOAD segments. I was playing with this before my vacation last week, and will post a proposed patch soon.
@jyknight Ah yes, we did discuss that, and that would indeed be a welcome improvement!
right now lld sorts sections by R, RX, RWX, RW. do you mean put large R right before normal R, and large RW right after normal RW, and whatever for large RX and RWX?
I guess that would also be better for having fewer text->data relocation overflows if we go down the -mlarge-data-threshold route
Yes. I would suggest this.
(I didn't notice that this patch had been made green. I'll change myself to a blocking reviewer :))