summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/ELFObjectFile.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-10-13 22:30:10 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-10-13 22:30:10 +0000
commit834bd602e6343e16d6fd5505d6e1813f22d7d01c (patch)
tree11d575c070de53e37ab40351d752e1847e0079d9 /llvm/lib/Object/ELFObjectFile.cpp
parent9ca5c425826329d5b23300bbc8a1a7c10a19c64d (diff)
downloadbcm5719-llvm-834bd602e6343e16d6fd5505d6e1813f22d7d01c.tar.gz
bcm5719-llvm-834bd602e6343e16d6fd5505d6e1813f22d7d01c.zip
ELF: Fix the section that relocations apply to. Add test to verify. Patch by Danil Malyshev!
llvm-svn: 141901
Diffstat (limited to 'llvm/lib/Object/ELFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/ELFObjectFile.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp
index f30d6a03699..257d08cadff 100644
--- a/llvm/lib/Object/ELFObjectFile.cpp
+++ b/llvm/lib/Object/ELFObjectFile.cpp
@@ -762,7 +762,7 @@ relocation_iterator ELFObjectFile<target_endianness, is64Bits>
const Elf_Shdr *sec = reinterpret_cast<const Elf_Shdr *>(Sec.p);
typename RelocMap_t::const_iterator ittr = SectionRelocMap.find(sec);
if (sec != 0 && ittr != SectionRelocMap.end()) {
- RelData.w.a = getSection(ittr->second[0])->sh_link;
+ RelData.w.a = getSection(ittr->second[0])->sh_info;
RelData.w.b = ittr->second[0];
RelData.w.c = 0;
}
@@ -780,7 +780,7 @@ relocation_iterator ELFObjectFile<target_endianness, is64Bits>
// Get the index of the last relocation section for this section.
std::size_t relocsecindex = ittr->second[ittr->second.size() - 1];
const Elf_Shdr *relocsec = getSection(relocsecindex);
- RelData.w.a = relocsec->sh_link;
+ RelData.w.a = relocsec->sh_info;
RelData.w.b = relocsecindex;
RelData.w.c = relocsec->sh_size / relocsec->sh_entsize;
}
@@ -1114,7 +1114,7 @@ ELFObjectFile<target_endianness, is64Bits>::ELFObjectFile(MemoryBuffer *Object
SymbolTableSections.push_back(sh);
}
if (sh->sh_type == ELF::SHT_REL || sh->sh_type == ELF::SHT_RELA) {
- SectionRelocMap[getSection(sh->sh_link)].push_back(i);
+ SectionRelocMap[getSection(sh->sh_info)].push_back(i);
}
++sh;
}
OpenPOWER on IntegriCloud