summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/Writer.cpp')
-rw-r--r--lld/ELF/Writer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 941a6d81ff9..de9a2f9fe7d 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -267,7 +267,8 @@ template <class ELFT> void Writer<ELFT>::createSyntheticSections() {
Out<ELFT>::VerDef = make<VersionDefinitionSection<ELFT>>();
// Initialize linker generated sections
- Symtab<ELFT>::X->Sections.push_back(createCommentSection<ELFT>());
+ if (!Config->Relocatable)
+ Symtab<ELFT>::X->Sections.push_back(createCommentSection<ELFT>());
if (Config->BuildId == BuildIdKind::Fast)
In<ELFT>::BuildId = make<BuildIdFastHash<ELFT>>();
OpenPOWER on IntegriCloud