[PATCH] D85661: [ELF] Avoid creating a 2.1GB output file in arm-exidx-range.s

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 11:03:33 PDT 2020


MaskRay added a comment.

In D85661#2207274 <https://reviews.llvm.org/D85661#2207274>, @psmith wrote:

> Thanks for spotting that. I'd personally prefer to fix in the linker script, rather than make the code RW but I don't have a strong preference.
>
> In a magical world where there is spare time, it would be great to make the LLD program header generation more like BFD which I believe will generate separate program headers when the distance between OutputSections is large. Not for this patch though.

This reminds me of D79254 <https://reviews.llvm.org/D79254> and a previous discussion about why RISC-V relaxation is difficult to implement in LLD.

BFD does program header allocation and address assignments in a loop while we don't. We could allocate a new header whenever an output section address is specified but that could waste lots of program header space if we ended up merging many PT_LOAD segments. If we have a loop as well, we can indeed behave more like BFD. The additional complexity needs a lot of thoughts.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85661/new/

https://reviews.llvm.org/D85661



More information about the llvm-commits mailing list