summaryrefslogtreecommitdiff
path: root/tools/yaml2obj/yaml2elf.cpp
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
commitc728e851dc1990b10a7765413004d7d39b6fc029 (patch)
treefad5e3ab945f02b89b06f15b89c6a6b6dafaa8ab /tools/yaml2obj/yaml2elf.cpp
parent8b94db17a43a9d847fb088ac49bafde15ba61a6d (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235513 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/yaml2obj/yaml2elf.cpp')
-rw-r--r--tools/yaml2obj/yaml2elf.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/yaml2obj/yaml2elf.cpp b/tools/yaml2obj/yaml2elf.cpp
index 5d4c26379be..17dbe8b03da 100644
--- a/tools/yaml2obj/yaml2elf.cpp
+++ b/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;