diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-04-06 04:25:18 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-04-06 04:25:18 +0000 |
commit | 61e8ce36be7f6c086f0904939ac0d94dda129320 (patch) | |
tree | d0980b6f7140b070af955d18b74853a6230730c9 /llvm/lib/MC/MCContext.cpp | |
parent | 176efac95bba0ba9e13c6924adc59a3ac61dcae6 (diff) | |
download | bcm5719-llvm-61e8ce36be7f6c086f0904939ac0d94dda129320.tar.gz bcm5719-llvm-61e8ce36be7f6c086f0904939ac0d94dda129320.zip |
Store the sh_link of ARM_EXIDX directly in MCSectionELF.
This avoids some pretty horrible and broken name based section handling.
llvm-svn: 234142
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r-- | llvm/lib/MC/MCContext.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp index 211f1640652..5f8e3c11de3 100644 --- a/llvm/lib/MC/MCContext.cpp +++ b/llvm/lib/MC/MCContext.cpp @@ -295,11 +295,22 @@ const MCSectionELF *MCContext::getELFSection(StringRef Section, unsigned Type, StringRef Group, unsigned UniqueID, const char *BeginSymName) { MCSymbol *GroupSym = nullptr; - if (!Group.empty()) { + if (!Group.empty()) GroupSym = GetOrCreateSymbol(Group); - Group = GroupSym->getName(); - } + return getELFSection(Section, Type, Flags, EntrySize, GroupSym, UniqueID, + BeginSymName, nullptr); +} + +const MCSectionELF *MCContext::getELFSection(StringRef Section, unsigned Type, + unsigned Flags, unsigned EntrySize, + const MCSymbol *GroupSym, + unsigned UniqueID, + const char *BeginSymName, + const MCSectionELF *Associated) { + StringRef Group = ""; + if (GroupSym) + Group = GroupSym->getName(); // Do the lookup, if we have a hit, return it. auto IterBool = ELFUniquingMap.insert( std::make_pair(ELFSectionKey{Section, Group, UniqueID}, nullptr)); @@ -321,7 +332,7 @@ const MCSectionELF *MCContext::getELFSection(StringRef Section, unsigned Type, MCSectionELF *Result = new (*this) MCSectionELF(CachedName, Type, Flags, Kind, EntrySize, - GroupSym, UniqueID, Begin, nullptr); + GroupSym, UniqueID, Begin, Associated); Entry.second = Result; return Result; } |