[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
Mon Mar 25 10:33:25 PDT 2019


peter.smith marked 4 inline comments as done.
peter.smith added a comment.

I've added comments to highlight the changes. I've also added test cases for them.



================
Comment at: ELF/InputSection.cpp:198
   InputSection *Sec;
   if (auto *IS = dyn_cast<InputSection>(this))
+    Sec = (!Config->Relocatable && Config->EMachine == EM_ARM &&
----------------
In conjunction with making In.ARMexidx the parent of the input .ARM.exidx sections; this fixes a segfault when --emit-relocs is used.


================
Comment at: ELF/OutputSections.cpp:314
   Info = S->getOutputSection()->SectionIndex;
   Flags |= SHF_INFO_LINK;
+  if (Config->EMachine == EM_ARM && S->Type == SHT_ARM_EXIDX)
----------------
This removes .rel.ARM.Exidx sections that are associated with merged .ARM.Exidx sections. A simpler but less effective fix would be to disable merging when --emit-relocs is used.


================
Comment at: ELF/SyntheticSections.cpp:3180
+}
+
+InputSection *ARMExidxSyntheticSection::getLinkOrderDep() const {
----------------
This fixes a segfault when all ExecutableSections with a .ARM.exidx input section are merged as duplicates.


================
Comment at: ELF/Writer.cpp:925
   for (EhInputSection *ES : In.EhFrame->Sections)
     Fn(*ES);
+  if (In.ARMExidx && In.ARMExidx->Live)
----------------
Added In.ARMExidx->Live to prevent undefined symbol errors caused by the personality routine being relocated against.


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

https://reviews.llvm.org/D59216





More information about the llvm-commits mailing list