[PATCH] D74339: Make .rodata* and .eh_frame* the last of all PROGBITS sections.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 10 13:39:35 PST 2020


MaskRay added a comment.

> does an output section have limited-range relocations referring to or from it? If so, move it to the end of the segment

What I am a bit concerned is that relocations in input sections can cause layout changes (a little surprise). The heuristic of output section sizes is similar.

In D74339#1867939 <https://reviews.llvm.org/D74339#1867939>, @tra wrote:

> In D74339#1867894 <https://reviews.llvm.org/D74339#1867894>, @MaskRay wrote:
>
> > + at tra because of D47396 <https://reviews.llvm.org/D47396>
> >
> > What types of relocations are from/to .nv_fatbin?
>
>
> Normally the only things that refer to the stuff in .nv_* are static data structures in .rodata, so placing .nv_fatbin before that is the right thing to do, as long as it does not get in a way of something else.


A less ad-hoc rule is to implement `INSERT BEFORE` for orphan sections. It currently only works for a linker script (see `test/ELF/linkerscript/insert-before.test`). I can investigate what BFD does.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74339





More information about the llvm-commits mailing list