summaryrefslogtreecommitdiff
path: root/lib/MC
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2009-10-07 20:57:20 +0000
committerKevin Enderby <enderby@apple.com>2009-10-07 20:57:20 +0000
commit5440f6309d6b714475a631b12307432c719cd066 (patch)
treebcf3ab50942c1d159fcc94ee1aef55c326ad2aed /lib/MC
parent99c372e72396f660291942c62cae10768a9360ef (diff)
downloadllvm-5440f6309d6b714475a631b12307432c719cd066.tar.gz
llvm-5440f6309d6b714475a631b12307432c719cd066.tar.bz2
llvm-5440f6309d6b714475a631b12307432c719cd066.tar.xz
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/MC')
-rw-r--r--lib/MC/MCSectionMachO.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/MC/MCSectionMachO.cpp b/lib/MC/MCSectionMachO.cpp
index 33f5087d1e..b3aeb9c178 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 &&