[PATCH] D25127: [ARM][LLD] .ARM.exidx support for executables/shared libraries

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 02:54:16 PDT 2016


peter.smith closed this revision.
peter.smith added a comment.

Committed revision 283730

Happy to make further changes if needed. The patch above applies with only line number offset differences and already has the garbage collection changes split out.



================
Comment at: ELF/MarkLive.cpp:257-272
+  // Mark all .ARM.exidx sections that reference live sections
+  if (Config->EMachine == EM_ARM) {
+    for (ObjectFile<ELFT> *F : Symtab<ELFT>::X->getObjectFiles()) {
+      for (InputSectionBase<ELFT> *Sec : F->getSections()) {
+        if (Sec && Sec != &InputSection<ELFT>::Discarded &&
+            Sec->Name.startswith(".ARM.exidx")) {
+          auto* D = Sec->getLinkOrderDep();
----------------
ruiu wrote:
> Don't you have to repeat this process until it converges? I wonder if forEachSuccessor() makes more sections live, which in turn makes more .ARM.exidx sections live.
Sadly yes for one annoying case. The personality routines such as __gxx_personality_v0 that do the unwinding are only referenced from .ARM.extab sections and in at least the gcc libraries these routines have .ARM.exidx. I've updated the code and test, which to my shame illustrated that the .ARM.exidx entries for my personality routines were being removed.

In the general case .ARM.exidx only has relocations to one executable section (the one it has a link order dependency on). It may refer to a .ARM.extab section which contains unwinding instructions that won't fit into 4 bytes. The .ARM.extab section may refer to personality routines which are the functions that interpret the data, but no other executable sections.




https://reviews.llvm.org/D25127





More information about the llvm-commits mailing list