mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
RuntimeDyldELF: add R_AARCH64_ADD_ABS_LO12_NC reloc
Differential revision: https://reviews.llvm.org/D28115 llvm-svn: 290598
This commit is contained in:
parent
57321df98a
commit
647a39b28b
@ -453,6 +453,15 @@ void RuntimeDyldELF::resolveAArch64Relocation(const SectionEntry &Section,
|
|||||||
support::ulittle32_t::ref{TargetPtr} = TargetValue;
|
support::ulittle32_t::ref{TargetPtr} = TargetValue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ELF::R_AARCH64_ADD_ABS_LO12_NC: {
|
||||||
|
// Operation: S + A
|
||||||
|
uint64_t Result = Value + Addend;
|
||||||
|
|
||||||
|
// Immediate goes in bits 21:10 of LD/ST instruction, taken
|
||||||
|
// from bits 11:0 of X
|
||||||
|
*TargetPtr |= ((Result & 0xfff) << 10);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case ELF::R_AARCH64_LDST32_ABS_LO12_NC: {
|
case ELF::R_AARCH64_LDST32_ABS_LO12_NC: {
|
||||||
// Operation: S + A
|
// Operation: S + A
|
||||||
uint64_t Result = Value + Addend;
|
uint64_t Result = Value + Addend;
|
||||||
|
@ -14,6 +14,9 @@ g:
|
|||||||
movk x0, #:abs_g1_nc:f
|
movk x0, #:abs_g1_nc:f
|
||||||
# R_AARCH64_MOVW_UABS_G0_NC
|
# R_AARCH64_MOVW_UABS_G0_NC
|
||||||
movk x0, #:abs_g0_nc:f
|
movk x0, #:abs_g0_nc:f
|
||||||
|
a:
|
||||||
|
# R_AARCH64_ADD_ABS_LO12_NC
|
||||||
|
add x0, x0, :lo12:f
|
||||||
ret
|
ret
|
||||||
.Lfunc_end0:
|
.Lfunc_end0:
|
||||||
.size g, .Lfunc_end0-g
|
.size g, .Lfunc_end0-g
|
||||||
@ -31,3 +34,7 @@ k:
|
|||||||
# rtdyld-check: *{4}(g + 8) = 0xf2b13560
|
# rtdyld-check: *{4}(g + 8) = 0xf2b13560
|
||||||
# rtdyld-check: *{4}(g + 12) = 0xf299bde0
|
# rtdyld-check: *{4}(g + 12) = 0xf299bde0
|
||||||
# rtdyld-check: *{8}k = f
|
# rtdyld-check: *{8}k = f
|
||||||
|
|
||||||
|
## f & 0xFFF = 0xdef (bits 11:0 of f)
|
||||||
|
## 0xdef << 10 = 0x37bc00
|
||||||
|
# rtdyld-check: *{4}(a) = 0x9137bc00
|
||||||
|
Loading…
x
Reference in New Issue
Block a user