[PATCH] D30541: [ELF] - Make Bss and BssRelRo sections to be synthetic (#2).

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 2 09:50:16 PST 2017


ruiu added inline comments.


================
Comment at: ELF/Relocations.cpp:489-491
     Sym->NeedsCopy = true;
-    Sym->Section = ISec;
+    Sym->CopyRelSec = {RelSec, Off};
     Sym->symbol()->IsUsedInRegularObj = true;
----------------
Here is an idea. Can you overwrite the symbol body using replaceBody<> to change the type from SharedSymbol to DefinedSynthetic?


================
Comment at: ELF/Symbols.h:278-282
+  // CopyRelSec is significant only when NeedsCopy is true.
+  struct {
+    InputSection *Sec;
+    size_t Off;
+  } CopyRelSec;
----------------
Why do you need to aggregate these two members into a new struct?


https://reviews.llvm.org/D30541





More information about the llvm-commits mailing list