summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser/ELFAsmParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MCParser/ELFAsmParser.cpp')
-rw-r--r--llvm/lib/MC/MCParser/ELFAsmParser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCParser/ELFAsmParser.cpp b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
index 9883018dd15..d6c4e451259 100644
--- a/llvm/lib/MC/MCParser/ELFAsmParser.cpp
+++ b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
@@ -271,9 +271,11 @@ bool ELFAsmParser::ParseDirectiveSection(StringRef, SMLoc) {
unsigned Type = MCSectionELF::SHT_NULL;
// Set the defaults first.
- if (SectionName == ".fini" || SectionName == ".init") {
+ if (SectionName == ".fini" || SectionName == ".init" || SectionName == ".rodata") {
Type = MCSectionELF::SHT_PROGBITS;
Flags |= MCSectionELF::SHF_ALLOC;
+ }
+ if (SectionName == ".fini" || SectionName == ".init") {
Flags |= MCSectionELF::SHF_EXECINSTR;
}
OpenPOWER on IntegriCloud