[PATCH] D30627: [ELF] Properly handle .eh_frame in linker scripts

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 18:02:14 PST 2017


phosek added inline comments.


================
Comment at: ELF/SyntheticSections.cpp:507-508
   Sections.push_back(Sec);
+  std::move(Sec->DependentSections.begin(), Sec->DependentSections.end(),
+            std::back_inserter(DependentSections));
 
----------------
ruiu wrote:
> phosek wrote:
> > ruiu wrote:
> > > What is this for?
> > `.eh_frame` can have relocations, so we need to ensure that if the `EhFrameSection` gets GC'ed, `.rel.eh_frame`/`.rela.eh_frame` gets GC'ed as well.
> But when the control reached Writer::run function, all garbage has already been gc'ed, no?
Not necessarily, for example you can have `/DISCARD/ : { *(.eh_frame) }` in the linker script which only gets processed in `LinkerScript::processCommands`.


Repository:
  rL LLVM

https://reviews.llvm.org/D30627





More information about the llvm-commits mailing list