[PATCH] D59216: [LLD][ELF][ARM] Redesign of .ARM.exidx handling to use a SyntheticSection

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 09:19:48 PDT 2019


peter.smith reopened this revision.
peter.smith added a comment.
This revision is now accepted and ready to land.

I've discovered 3 problems with this, the first 2 are trivial to fix, the last is not so I think I'll need to send for review when I've fixed rather than just recommit. The trivial problems are:

- When all the .ARM.exidx sections from input files are merged into a synthetic one the getLinkOrderDep() function can't find any .ARM.exidx section and returns nullptr.
  - 1 line fix to just return the front() of the ExecutableSections vector, as that will always exist.
- If the In.ARMexidx is discarded via \DISCARD\ then scanning its relocations adds a dependency to the personality routine (undefined symbol error).
  - 1 line fix to skip the relocation scanning if In.ARM.exidx is not live.

The difficult problem to fix is that --emit-relocs doesn't work with the SyntheticSection.

- The .ARM.exidx InputSections have been removed so there is no way to get the OutputSection
- If table merging is on then we end up with spurious relocations for the removed table. This is true of the existing implementation.

I'm investigating the best way of fixing this. The approach I'm currently favouring is following the example of EhInputSection. The alternative is some special cases for .ARM.exidx, I think that these could prove fragile so I'm tending towards the former even if it is more code.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59216





More information about the llvm-commits mailing list