[PATCH] D41105: [ELF] Fix placement of a sentinel entry in the .ARM.exidx section.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 02:09:37 PST 2017


peter.smith added a comment.

I think that this is the right thing to do for .ARM.exidx sections. I'm pretty sure the original implementation did do something like that, but it must have been refactored sometime later to use addSection(). I don't think that this is expected for orphans in general though. For example consider the silly example: SECTIONS { .text : { t.o(.text) foo = .; } }
If I provide an object t.o with a .text section and an object t2.o with a .text section, the t2.o will be an orphan that will match in .text. The bfd linker places this after the assignment to foo = .

  .text          0x0000000000000000        0x4 t.o
                  0x0000000000000000                _start
                  0x0000000000000004                foo = .
   .text          0x0000000000000004        0x4 t2.o
                  0x0000000000000004                func

At first glance it looks like the patch might change this behaviour for orphan sections? This might lead to incompatibility problems with bfd. If I'm right perhaps addSection can be made to optionally choose to find the last InputSectionDescription for cases like .ARM.exidx. Alternatively some custom code could be used for .ARM.exidx as that case is much more specialised.


https://reviews.llvm.org/D41105





More information about the llvm-commits mailing list