summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/ELFObjectWriter.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-04-06 04:25:18 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-04-06 04:25:18 +0000
commit61e8ce36be7f6c086f0904939ac0d94dda129320 (patch)
treed0980b6f7140b070af955d18b74853a6230730c9 /llvm/lib/MC/ELFObjectWriter.cpp
parent176efac95bba0ba9e13c6924adc59a3ac61dcae6 (diff)
downloadbcm5719-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/ELFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 807a2ce35e0..2004b1b8a2d 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -1546,19 +1546,8 @@ void ELFObjectWriter::writeSection(MCAssembler &Asm,
}
if (TargetObjectWriter->getEMachine() == ELF::EM_ARM &&
- Section.getType() == ELF::SHT_ARM_EXIDX) {
- StringRef SecName(Section.getSectionName());
- if (SecName == ".ARM.exidx") {
- sh_link = SectionIndexMap.lookup(Asm.getContext().getELFSection(
- ".text", ELF::SHT_PROGBITS, ELF::SHF_EXECINSTR | ELF::SHF_ALLOC));
- } else if (SecName.startswith(".ARM.exidx")) {
- StringRef GroupName =
- Section.getGroup() ? Section.getGroup()->getName() : "";
- sh_link = SectionIndexMap.lookup(Asm.getContext().getELFSection(
- SecName.substr(sizeof(".ARM.exidx") - 1), ELF::SHT_PROGBITS,
- ELF::SHF_EXECINSTR | ELF::SHF_ALLOC, 0, GroupName));
- }
- }
+ Section.getType() == ELF::SHT_ARM_EXIDX)
+ sh_link = SectionIndexMap.lookup(Section.getAssociatedSection());
WriteSecHdrEntry(ShStrTabBuilder.getOffset(Section.getSectionName()),
Section.getType(),
OpenPOWER on IntegriCloud