diff options
author | Prakhar Bahuguna <prakhar.bahuguna@arm.com> | 2016-12-15 07:59:15 +0000 |
---|---|---|
committer | Prakhar Bahuguna <prakhar.bahuguna@arm.com> | 2016-12-15 07:59:15 +0000 |
commit | e640c6f765c82c0fefd3b231e0e7022d33cc82c9 (patch) | |
tree | 7a0b53f5a67b2c6786c189bac851dcb939240e0f /llvm/lib/MC/MCParser/ELFAsmParser.cpp | |
parent | 52a7dd7d7825b269ae569db0e2bcb193c7698666 (diff) | |
download | bcm5719-llvm-e640c6f765c82c0fefd3b231e0e7022d33cc82c9.tar.gz bcm5719-llvm-e640c6f765c82c0fefd3b231e0e7022d33cc82c9.zip |
Allow ELF section flags to be specified numerically
Summary:
GAS already allows flags for sections to be specified directly as a
numeric value. This functionality is particularly useful for setting
processor or application-specific values that may not be directly
supported or understood by LLVM. This patch allows LLVM to use numeric
section flag values verbatim if specified by the assembly file.
Reviewers: grosbach, rafael, t.p.northover, rengolin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27451
llvm-svn: 289785
Diffstat (limited to 'llvm/lib/MC/MCParser/ELFAsmParser.cpp')
-rw-r--r-- | llvm/lib/MC/MCParser/ELFAsmParser.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCParser/ELFAsmParser.cpp b/llvm/lib/MC/MCParser/ELFAsmParser.cpp index 8bfb475635c..8d7ba0d0336 100644 --- a/llvm/lib/MC/MCParser/ELFAsmParser.cpp +++ b/llvm/lib/MC/MCParser/ELFAsmParser.cpp @@ -264,6 +264,10 @@ bool ELFAsmParser::ParseSectionName(StringRef &SectionName) { static unsigned parseSectionFlags(StringRef flagsStr, bool *UseLastGroup) { unsigned flags = 0; + // If a valid numerical value is set for the section flag, use it verbatim + if (!flagsStr.getAsInteger(0, flags)) + return flags; + for (char i : flagsStr) { switch (i) { case 'a': |