[PATCH] D65759: [ELF][ARM] Fix /DISCARD/ of section with .ARM.exidx section

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 00:12:17 PDT 2019


MaskRay added a comment.

Haven't gone through the logic yet (and I'm still learning the .ARM.exidx mechanism), but the solution looks good.

In the description, several `.ehframe` occurrences should be replaced by `.eh_frame`. Some nits inlined.



================
Comment at: ELF/SyntheticSections.cpp:3209
+  // The linker script may have a /DISCARD/ entry that removes either
+  // a .ARM.exidx section or a section with a .ARM.exidx section.
+  if (script->hasSectionsCommand) {
----------------
`with a` -> `with a dependent`?


================
Comment at: ELF/SyntheticSections.cpp:3212
+    auto isDiscarded = [](const InputSection *isec) { return !isec->isLive(); };
+    executableSections.erase(std::remove_if(executableSections.begin(),
+                                            executableSections.end(),
----------------
`std::remove_if(excutableSections.begin(), excutableSections.end(), ...)` -> `llvm::remove_if(excutableSections, ...)`


================
Comment at: ELF/SyntheticSections.cpp:3217
+    exidxSections.erase(
+        std::remove_if(exidxSections.begin(), exidxSections.end(), isDiscarded),
+        exidxSections.end());
----------------
`llvm::remove_if`


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

https://reviews.llvm.org/D65759





More information about the llvm-commits mailing list