diff options
| author | Eric Christopher <echristo@gmail.com> | 2018-07-02 00:16:39 +0000 |
|---|---|---|
| committer | Eric Christopher <echristo@gmail.com> | 2018-07-02 00:16:39 +0000 |
| commit | 53054141a70d40965b3056b03c4dcc704a4e0504 (patch) | |
| tree | 6c8e04812c2489284a43610b576422bde8a296ec /llvm/lib | |
| parent | df99cdb95b88fa64c6e0a1f4ff9bb918ea85c964 (diff) | |
| download | bcm5719-llvm-53054141a70d40965b3056b03c4dcc704a4e0504.tar.gz bcm5719-llvm-53054141a70d40965b3056b03c4dcc704a4e0504.zip | |
Add an entry for rodata constant merge sections to the default
section flags in the ELF assembler. This matches the defaults
given in the rest of MC.
Fixes PR37997 where we couldn't assemble our own assembly output
without warnings.
llvm-svn: 336072
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/MC/MCParser/ELFAsmParser.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCParser/ELFAsmParser.cpp b/llvm/lib/MC/MCParser/ELFAsmParser.cpp index 93513a2c415..67e3512cc5b 100644 --- a/llvm/lib/MC/MCParser/ELFAsmParser.cpp +++ b/llvm/lib/MC/MCParser/ELFAsmParser.cpp @@ -486,6 +486,9 @@ static bool hasPrefix(StringRef SectionName, StringRef Prefix) { // defaults. static unsigned defaultSectionFlags(StringRef SectionName) { + if (hasPrefix(SectionName, ".rodata.cst")) + return ELF::SHF_ALLOC | ELF::SHF_MERGE; + if (hasPrefix(SectionName, ".rodata.") || SectionName == ".rodata1") return ELF::SHF_ALLOC; |

