[PATCH] D79687: [LLD][ELF][ARM] Support /DISCARD/ of subset of .ARM.exidx sections

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 11 06:56:45 PDT 2020


psmith added a comment.

Thanks for the review. I've applied the suggestion to remove the function.

This introduces a mechanism to discard individual .ARM.exidx.foo sections from the ARMExidx SyntheticSection. To explain the original problem a bit better:
.ARM.exidx are Exception Index sections. They form an ordered table that can be binary searched to find the unwinding instructions for an exception coming from a given address. If the unwind information is small then it is inlined into the .ARM.exidx section. If the unwind information is large a .ARM.extab section is created to contain the unwind information, the .ARM.exidx section entry then becomes a pc-relative reference to the .ARM.extab.

  .text.small <- SHF_LINK_ORDER .ARM.exidx.small
  .text.large <- SHF_LINK_ORDER .ARM.exidx.large -> .ARM.extab.large

If /DISCARD/ contains both .ARM.exidx.large and .ARM.extab.large then if we only discard .ARM.extab.large (due to .ARM.exidx.large being hidden away in the SyntheticSection, then .ARM.exidx.large has a dangling reference which causes an error at relocation time.


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

https://reviews.llvm.org/D79687





More information about the llvm-commits mailing list