From d4530c6eb8653c346d2845b6565f8869dcd49d41 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Fri, 4 Mar 2016 18:34:14 +0000 Subject: [PATCH] Add a comment about _DYNAMIC. llvm-svn: 262735 --- lld/ELF/Writer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 68c1007..961f47d 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1013,6 +1013,11 @@ template bool Writer::createSections() { for (OutputSectionBase *Sec : RegularSections) addStartStopSymbols(Sec); } + + // Add _DYNAMIC symbol. Unlike GNU gold, our _DYNAMIC symbol has no type. + // It should be okay as no one seems to care about the type. + // Even the author of gold doesn't remember why gold behaves that way. + // https://sourceware.org/ml/binutils/2002-03/msg00360.html if (isOutputDynamic()) Symtab.addSynthetic("_DYNAMIC", *Out::Dynamic, 0, STV_HIDDEN); -- 2.7.4