summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/ELFObjectWriter.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-03-30 13:39:16 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-03-30 13:39:16 +0000
commitc9d069222e4307acb25288c3b2614c0e93560d51 (patch)
treed166a563df84b2aacec204f87b07d98ef5de19ac /llvm/lib/MC/ELFObjectWriter.cpp
parent48906062df9fc46e661aae542a7ce4278111c690 (diff)
downloadbcm5719-llvm-c9d069222e4307acb25288c3b2614c0e93560d51.tar.gz
bcm5719-llvm-c9d069222e4307acb25288c3b2614c0e93560d51.zip
Special case the creation of relocation sections.
These sections are never looked up and we know when have to create them. Use that to save adding them to the regular map and avoid a symbol->string->symbol conversion for the group symbol. This also makes the implementation independent of the details of how unique sections are implemented. llvm-svn: 233539
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index c99a3ee5e26..6be37bfd641 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -1167,15 +1167,12 @@ ELFObjectWriter::createRelocationSection(MCAssembler &Asm,
EntrySize = is64Bit() ? sizeof(ELF::Elf64_Rel) : sizeof(ELF::Elf32_Rel);
unsigned Flags = 0;
- StringRef Group = "";
- if (Section.getFlags() & ELF::SHF_GROUP) {
+ if (Section.getFlags() & ELF::SHF_GROUP)
Flags = ELF::SHF_GROUP;
- Group = Section.getGroup()->getName();
- }
- const MCSectionELF *RelaSection = Ctx.getELFSection(
+ const MCSectionELF *RelaSection = Ctx.createELFRelSection(
RelaSectionName, hasRelocationAddend() ? ELF::SHT_RELA : ELF::SHT_REL,
- Flags, EntrySize, Group, true);
+ Flags, EntrySize, Section.getGroup());
return &Asm.getOrCreateSectionData(*RelaSection);
}
OpenPOWER on IntegriCloud