[PATCH] D14196: [ELF2] Ensure the DynSymTab to be finalized before the others

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 31 09:14:09 PDT 2015


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM with a nit.


================
Comment at: ELF/Writer.cpp:584-591
@@ -583,5 +583,10 @@
 
   // Fill the DynStrTab early because Dynamic adds strings to
   // DynStrTab but .dynstr may appear before .dynamic.
   Out<ELFT>::Dynamic->finalize();
 
+  // The dynamic symbols section should be finalized before the others
+  // because it can fill up the GNU hash section.
+  if (isOutputDynamic())
+    Out<ELFT>::DynSymTab->finalize();
+
----------------
Can you merge these two?

  // Finalizers fix each section's size.
  // .dynamic section's finalizer may add strings to .dynstr, so finalize that early.
  // Likewise, .dynsym is finalized early since that may fill up .gnu.hash.
  Out<ELFT>::Dynamic->finalize();
  if (isOutputDynamic())
    Out<ELFT>::DynSymTab->finalize();


http://reviews.llvm.org/D14196





More information about the llvm-commits mailing list