[PATCH] D26349: [ELF] Convert .got.plt section to input section

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 01:20:07 PST 2016


evgeny777 added inline comments.


================
Comment at: ELF/OutputSections.h:599
     };
-    enum KindT { SecAddr, SecSize, SymAddr, PlainInt } Kind;
+    enum KindT { SecAddr, SecSize, SymAddr, PlainInt, InSecAddr } Kind;
     Entry(int32_t Tag, OutputSectionBase<ELFT> *OutSec, KindT Kind = SecAddr)
----------------
ruiu wrote:
> You are not using InSecAddr. What is this?
See OutputSections.cpp : 817


================
Comment at: ELF/Writer.cpp:857
+    addInputSec(In<ELFT>::GotPlt);
+    In<ELFT>::GotPlt->OutSec->assignOffsets();
+  }
----------------
ruiu wrote:
> I want to avoid calling `assignOffsets` more than once to redo it. It is not only inefficient but also confusing. Could you add this section earlier than this to avoid this function call?
The problem with .got.plt is that it shouldn't be added if it is empty. Whether or not it is empty is known only after call to scanRelocs(). So if you add it early you'll have to do a fixup procedure later


https://reviews.llvm.org/D26349





More information about the llvm-commits mailing list