diff options
author | Joerg Sonnenberger <joerg@bec.de> | 2013-02-16 00:32:53 +0000 |
---|---|---|
committer | Joerg Sonnenberger <joerg@bec.de> | 2013-02-16 00:32:53 +0000 |
commit | 42edeb1ba8aabcbe0e5cc846d9e5f2a9e2261292 (patch) | |
tree | ba98a2a1fc1dc2e619fd5961469ee00999cabe84 /lib/MC | |
parent | abbf9df7f42e8e3e95b02b16ebbc6a0684bb4f6d (diff) |
Derive ELF section type from the name in some cases where GNU as does
so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175327 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r-- | lib/MC/MCParser/ELFAsmParser.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/MC/MCParser/ELFAsmParser.cpp b/lib/MC/MCParser/ELFAsmParser.cpp index eb394150dd..7921abb22e 100644 --- a/lib/MC/MCParser/ELFAsmParser.cpp +++ b/lib/MC/MCParser/ELFAsmParser.cpp @@ -413,7 +413,16 @@ bool ELFAsmParser::ParseDirectiveSection(StringRef, SMLoc) { unsigned Type = ELF::SHT_PROGBITS; - if (!TypeName.empty()) { + if (TypeName.empty()) { + if (SectionName.startswith(".note")) + Type = ELF::SHT_NOTE; + else if (SectionName == ".init_array") + Type = ELF::SHT_INIT_ARRAY; + else if (SectionName == ".fini_array") + Type = ELF::SHT_FINI_ARRAY; + else if (SectionName == ".preinit_array") + Type = ELF::SHT_PREINIT_ARRAY; + } else { if (TypeName == "init_array") Type = ELF::SHT_INIT_ARRAY; else if (TypeName == "fini_array") |