This is the first part of a series of patches derived from https://reviews.llvm.org/D24728
Apologies for the delay in posting this, I wanted to wait for Phab to come back up.
In this patch support for .ARM.exidx sections has been added for Executables and Shared Libraries. The majority of the code is identical to the changes discussed in D24788 with the following differences:
- Garbage collection is fully implemented and tested, .ARM.exidx is live only when the section it depends on is live.
- The SHF_LINK_ORDER flag on the .ARM.exidx OutputSection is cleared for Executables and Shared libraries as it only has meaning in a relocatable object.
- I've moved the code to find the link order dependency to InputSection from OutputSection as MarkLive needs it, and in a future patch for relocatable links the OutputSection::finalize() will also need it.
Follow up patches to come shortly:
- Implement R_ARM_TARGET2 relocation.
- Allow R_ARM_PREL31 and R_ARM_NONE relocations to be used in shared objects.
- Maintain the full section name when doing a relocatable link, for example .text.foo should not be truncated and merged with other .text sections.
- Add support for .ARM.exidx for relocatable links.
typename ELFT::Shdr -> ELF_Shdr