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

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 11 11:21:21 PDT 2019


pcc added a comment.

Thanks Peter. I think I prefer this approach.



================
Comment at: ELF/SyntheticSections.cpp:3188
+//     We write the .ARM.exidx section contents then relocate. As the section
+//     won't have been considered by scanRelocs() we must get the relocations
+//     from the object file and process them manually. Luckily there is only
----------------
Should the handling of `.ARM.exidx` input sections look more like `.eh_frame` sections, perhaps? You could:
- remove `.ARM.exidx` sections from the `InputSections` list in `combineEhFrameSections` (and maybe rename the function) and add them to a separate list
- arrange for `forEachRelSec` to visit those sections
Now you should be able to write the sections in the usual way with `writeTo`.


================
Comment at: ELF/Writer.cpp:1438
+        if (auto *EX = dyn_cast<ARMExidxSyntheticSection>(IS)) {
+          finalizeSynthetic(EX);
+          break;
----------------
Can/should the ARMExidxSyntheticSection be a field in InStruct? Then it can be finalized with the other synthetic sections.


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

https://reviews.llvm.org/D59216





More information about the llvm-commits mailing list