diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-05-25 00:14:12 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-05-25 00:14:12 +0000 |
| commit | b910e566049ffd9b1f285b29cd4dfe124aad3a12 (patch) | |
| tree | aa9dd201385584a680108431abb3fe8d75693313 /llvm/lib/MC/MCContext.cpp | |
| parent | 172d59c105ea99da09bbbef25698e94b8358bf20 (diff) | |
| download | bcm5719-llvm-b910e566049ffd9b1f285b29cd4dfe124aad3a12.tar.gz bcm5719-llvm-b910e566049ffd9b1f285b29cd4dfe124aad3a12.zip | |
Revert r270569 (teach llvm-mc to generate compressed debug sections in zlib
style). It appears that current ELF linkers are not ready for this.
llvm-svn: 270638
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
| -rw-r--r-- | llvm/lib/MC/MCContext.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp index aa15ff69904..67463e583d7 100644 --- a/llvm/lib/MC/MCContext.cpp +++ b/llvm/lib/MC/MCContext.cpp @@ -285,6 +285,22 @@ MCSectionMachO *MCContext::getMachOSection(StringRef Segment, StringRef Section, Segment, Section, TypeAndAttributes, Reserved2, Kind, Begin); } +void MCContext::renameELFSection(MCSectionELF *Section, StringRef Name) { + StringRef GroupName; + if (const MCSymbol *Group = Section->getGroup()) + GroupName = Group->getName(); + + unsigned UniqueID = Section->getUniqueID(); + ELFUniquingMap.erase( + ELFSectionKey{Section->getSectionName(), GroupName, UniqueID}); + auto I = ELFUniquingMap.insert(std::make_pair( + ELFSectionKey{Name, GroupName, UniqueID}, + Section)) + .first; + StringRef CachedName = I->first.SectionName; + const_cast<MCSectionELF *>(Section)->setSectionName(CachedName); +} + MCSectionELF *MCContext::createELFRelSection(StringRef Name, unsigned Type, unsigned Flags, unsigned EntrySize, const MCSymbolELF *Group, |

