diff options
author | Kevin Enderby <enderby@apple.com> | 2009-10-07 20:57:20 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2009-10-07 20:57:20 +0000 |
commit | 5440f6309d6b714475a631b12307432c719cd066 (patch) | |
tree | bcf3ab50942c1d159fcc94ee1aef55c326ad2aed /lib | |
parent | 99c372e72396f660291942c62cae10768a9360ef (diff) | |
download | external_llvm-5440f6309d6b714475a631b12307432c719cd066.zip external_llvm-5440f6309d6b714475a631b12307432c719cd066.tar.gz external_llvm-5440f6309d6b714475a631b12307432c719cd066.tar.bz2 |
Fixed MCSectionMachO::ParseSectionSpecifier to allow an attribute of "none" so
that a symbol stub section with no attributes can be parsed as in:
.section __TEXT,__picsymbolstub4,symbol_stubs,none,16
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/MC/MCSectionMachO.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/MC/MCSectionMachO.cpp b/lib/MC/MCSectionMachO.cpp index 33f5087..b3aeb9c 100644 --- a/lib/MC/MCSectionMachO.cpp +++ b/lib/MC/MCSectionMachO.cpp @@ -40,8 +40,8 @@ static const struct { /// SectionAttrDescriptors - This is an array of descriptors for section /// attributes. Unlike the SectionTypeDescriptors, this is not directly indexed -/// by attribute, instead it is searched. The last entry has a zero AttrFlag -/// value. +/// by attribute, instead it is searched. The last entry has an AttrFlagEnd +/// AttrFlag value. static const struct { unsigned AttrFlag; const char *AssemblerName, *EnumName; @@ -59,7 +59,9 @@ ENTRY(0 /*FIXME*/, S_ATTR_SOME_INSTRUCTIONS) ENTRY(0 /*FIXME*/, S_ATTR_EXT_RELOC) ENTRY(0 /*FIXME*/, S_ATTR_LOC_RELOC) #undef ENTRY - { 0, "none", 0 } + { 0, "none", 0 }, // used if section has no attributes but has a stub size +#define AttrFlagEnd 0xffffffff // non legal value, multiple attribute bits set + { AttrFlagEnd, 0, 0 } }; @@ -228,7 +230,7 @@ std::string MCSectionMachO::ParseSectionSpecifier(StringRef Spec, // In. // Look up the attribute. for (unsigned i = 0; ; ++i) { - if (SectionAttrDescriptors[i].AttrFlag == 0) + if (SectionAttrDescriptors[i].AttrFlag == AttrFlagEnd) return "mach-o section specifier has invalid attribute"; if (SectionAttrDescriptors[i].AssemblerName && |