diff options
| author | Daniel Sanders <daniel.sanders@imgtec.com> | 2015-06-02 15:28:29 +0000 |
|---|---|---|
| committer | Daniel Sanders <daniel.sanders@imgtec.com> | 2015-06-02 15:28:29 +0000 |
| commit | f85028359dd5a25deadc497de3c314612b1f404a (patch) | |
| tree | bdc395d36ee2ff49fedb7ee99423f7b71f177a83 /llvm/lib/ExecutionEngine/RuntimeDyld | |
| parent | db220dbf023b5c8573d7da2e951cf53a5e71cef7 (diff) | |
| download | bcm5719-llvm-f85028359dd5a25deadc497de3c314612b1f404a.tar.gz bcm5719-llvm-f85028359dd5a25deadc497de3c314612b1f404a.zip | |
[mips][mcjit] Add support for R_MIPS_PC32.
Summary:
This allows us to resolve relocations for DW_EH_PE_pcrel TType encodings
in the exception handling LSDA.
Also fixed a nearby typo.
Reviewers: petarj, vkalintiris
Reviewed By: vkalintiris
Subscribers: vkalintiris, llvm-commits
Differential Revision: http://reviews.llvm.org/D10127
llvm-svn: 238844
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld')
| -rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp index 8679368d773..3bd8a477112 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp @@ -480,7 +480,7 @@ void RuntimeDyldELF::resolveMIPSRelocation(const SectionEntry &Section, uint32_t *TargetPtr = (uint32_t *)(Section.Address + Offset); Value += Addend; - DEBUG(dbgs() << "resolveMipselocation, LocalAddress: " + DEBUG(dbgs() << "resolveMIPSRelocation, LocalAddress: " << Section.Address + Offset << " FinalAddress: " << format("%p", Section.LoadAddress + Offset) << " Value: " << format("%x", Value) << " Type: " << format("%x", Type) @@ -504,6 +504,10 @@ void RuntimeDyldELF::resolveMIPSRelocation(const SectionEntry &Section, case ELF::R_MIPS_LO16: *TargetPtr = ((*TargetPtr) & 0xffff0000) | (Value & 0xffff); break; + case ELF::R_MIPS_PC32: + uint32_t FinalAddress = (Section.LoadAddress + Offset); + writeBytesUnaligned(Value + Addend - FinalAddress, (uint8_t *)TargetPtr, 4); + break; } } |

