mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[RuntimeDyld][AArch64] Add explicit addends before calling relocationValueRef.
relocationValueRef uses the addend, so it has to be set before the call. llvm-svn: 244574
This commit is contained in:
parent
65fd48e951
commit
3f10ab0d27
@ -272,15 +272,14 @@ public:
|
|||||||
|
|
||||||
RelocationEntry RE(getRelocationEntry(SectionID, Obj, RelI));
|
RelocationEntry RE(getRelocationEntry(SectionID, Obj, RelI));
|
||||||
RE.Addend = decodeAddend(RE);
|
RE.Addend = decodeAddend(RE);
|
||||||
RelocationValueRef Value(
|
|
||||||
getRelocationValueRef(Obj, RelI, RE, ObjSectionToID));
|
|
||||||
|
|
||||||
assert((ExplicitAddend == 0 || RE.Addend == 0) && "Relocation has "\
|
assert((ExplicitAddend == 0 || RE.Addend == 0) && "Relocation has "\
|
||||||
"ARM64_RELOC_ADDEND and embedded addend in the instruction.");
|
"ARM64_RELOC_ADDEND and embedded addend in the instruction.");
|
||||||
if (ExplicitAddend) {
|
if (ExplicitAddend)
|
||||||
RE.Addend = ExplicitAddend;
|
RE.Addend = ExplicitAddend;
|
||||||
Value.Offset = ExplicitAddend;
|
|
||||||
}
|
RelocationValueRef Value(
|
||||||
|
getRelocationValueRef(Obj, RelI, RE, ObjSectionToID));
|
||||||
|
|
||||||
bool IsExtern = Obj.getPlainRelocationExternal(RelInfo);
|
bool IsExtern = Obj.getPlainRelocationExternal(RelInfo);
|
||||||
if (!IsExtern && RE.IsPCRel)
|
if (!IsExtern && RE.IsPCRel)
|
||||||
|
@ -55,6 +55,18 @@ ldr2:
|
|||||||
ldr x0, [x0, _ptr@GOTPAGEOFF]
|
ldr x0, [x0, _ptr@GOTPAGEOFF]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
# rtdyld-check: decode_operand(add1, 2) = (tgt+8)[11:2] << 2
|
||||||
|
.globl _test_explicit_addend_reloc
|
||||||
|
.align 4
|
||||||
|
_test_explicit_addend_reloc:
|
||||||
|
add1:
|
||||||
|
add x0, x0, tgt@PAGEOFF+8
|
||||||
|
|
||||||
|
.align 3
|
||||||
|
tgt:
|
||||||
|
.long 0
|
||||||
|
.long 0
|
||||||
|
.long 7
|
||||||
|
|
||||||
# Test ARM64_RELOC_UNSIGNED relocation. The absolute 64-bit address of the
|
# Test ARM64_RELOC_UNSIGNED relocation. The absolute 64-bit address of the
|
||||||
# function should be stored at the 8-byte memory location.
|
# function should be stored at the 8-byte memory location.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user