[PATCH] D42748: [ELF] Don't create a .dynamic section when linking with -Bstatic

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 13:33:59 PST 2018


ruiu added a comment.

This change seems OK to me. How about you, Ed?



================
Comment at: ELF/Writer.cpp:329
 
-    Add(InX::Dynamic);
+    if (!Config->Static)
+      Add(InX::Dynamic);
----------------
Apparently this needs comment.


================
Comment at: ELF/Writer.cpp:1421
   // https://sourceware.org/ml/binutils/2002-03/msg00360.html
-  if (InX::DynSymTab)
+  if (InX::DynSymTab && !Config->Static)
     Symtab->addRegular("_DYNAMIC", STV_HIDDEN, STT_NOTYPE, 0 /*Value*/,
----------------
Ditto


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42748





More information about the llvm-commits mailing list