summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2015-04-22 15:26:43 +0000
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2015-04-22 15:26:43 +0000
commit9f3dbff08a30f3289558e6f8ba95b412824e5120 (patch)
tree2f24b11384bdf34ab778a10b888893f9f067489f /llvm/tools
parentc75a192f23bff277033994cc274dd3de8615c836 (diff)
downloadbcm5719-llvm-9f3dbff08a30f3289558e6f8ba95b412824e5120.tar.gz
bcm5719-llvm-9f3dbff08a30f3289558e6f8ba95b412824e5120.zip
Support arm32 R_ARM_V4BX relocation format
ARM32 ELF R_ARM_V4BX relocation format is a special relocation type that records the location of an ARMv4t BX instruction to enable a static linker to generate ARMv4 compatible instructions. This relocation does not contain a reference symbol. This patch enabled its creation by removing the requeriment of a relocation symbol target in ELFState<ELFT>::writeSectionContent. llvm-svn: 235513
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/yaml2obj/yaml2elf.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/tools/yaml2obj/yaml2elf.cpp b/llvm/tools/yaml2obj/yaml2elf.cpp
index 5d4c26379be..17dbe8b03da 100644
--- a/llvm/tools/yaml2obj/yaml2elf.cpp
+++ b/llvm/tools/yaml2obj/yaml2elf.cpp
@@ -357,12 +357,11 @@ ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader,
auto &OS = CBA.getOSAndAlignedOffset(SHeader.sh_offset);
for (const auto &Rel : Section.Relocations) {
- unsigned SymIdx;
- if (SymN2I.lookup(Rel.Symbol, SymIdx)) {
- errs() << "error: Unknown symbol referenced: '" << Rel.Symbol
- << "' at YAML relocation.\n";
- return false;
- }
+ unsigned SymIdx = 0;
+ // Some special relocation, R_ARM_v4BX for instance, does not have
+ // an external reference. So it ignores the return value of lookup()
+ // here.
+ SymN2I.lookup(Rel.Symbol, SymIdx);
if (IsRela) {
Elf_Rela REntry;
OpenPOWER on IntegriCloud