diff options
author | George Rimar <grimar@accesssoftek.com> | 2016-11-29 16:11:09 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2016-11-29 16:11:09 +0000 |
commit | 9b3ae73fc8bf5de598f9a56e9aeb8b0acd3fdaf0 (patch) | |
tree | 0759c91c737fa425402914c1c8e1c8ff4814f5d5 /lld/ELF/InputSection.cpp | |
parent | 3fb5a6dc9e0c30af868c85ac77c94ebec836b08a (diff) | |
download | bcm5719-llvm-9b3ae73fc8bf5de598f9a56e9aeb8b0acd3fdaf0.tar.gz bcm5719-llvm-9b3ae73fc8bf5de598f9a56e9aeb8b0acd3fdaf0.zip |
[ELF] - Disable emiting multiple output sections when merging is disabled.
When -O0 is specified, we do not do section merging.
Though before this patch several sections were generated instead
of single, what is useless.
Differential revision: https://reviews.llvm.org/D27041
llvm-svn: 288151
Diffstat (limited to 'lld/ELF/InputSection.cpp')
-rw-r--r-- | lld/ELF/InputSection.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 2fcb39bfda2..a0190564633 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -80,6 +80,12 @@ InputSectionBase<ELFT>::InputSectionBase(elf::ObjectFile<ELFT> *File, if (V > UINT32_MAX) fatal(toString(File) + ": section sh_addralign is too large"); Alignment = V; + + // If it is not a mergeable section, overwrite the flag so that the flag + // is consistent with the class. This inconsistency could occur when + // string merging is disabled using -O0 flag. + if (!Config->Relocatable && !isa<MergeInputSection<ELFT>>(this)) + this->Flags &= ~(SHF_MERGE | SHF_STRINGS); } template <class ELFT> |