forked from OSchip/llvm-project
[ELF/AArch64] Add support for R_AARCH64_LDST16_ABS_LO12_NC relocation.
Found while trying to self-host the toolchain that libLTO needs it. llvm-svn: 257854
This commit is contained in:
parent
2c22a86f94
commit
2dfc5fd1ea
|
@ -1271,6 +1271,7 @@ bool AArch64TargetInfo::needsCopyRel(uint32_t Type, const SymbolBody &S) const {
|
|||
case R_AARCH64_ADR_PREL_LO21:
|
||||
case R_AARCH64_ADR_PREL_PG_HI21:
|
||||
case R_AARCH64_LDST8_ABS_LO12_NC:
|
||||
case R_AARCH64_LDST16_ABS_LO12_NC:
|
||||
case R_AARCH64_LDST32_ABS_LO12_NC:
|
||||
case R_AARCH64_LDST64_ABS_LO12_NC:
|
||||
case R_AARCH64_LDST128_ABS_LO12_NC:
|
||||
|
@ -1384,6 +1385,9 @@ void AArch64TargetInfo::relocateOne(uint8_t *Loc, uint8_t *BufEnd,
|
|||
case R_AARCH64_LDST128_ABS_LO12_NC:
|
||||
or32le(Loc, (SA & 0x0FF8) << 6);
|
||||
break;
|
||||
case R_AARCH64_LDST16_ABS_LO12_NC:
|
||||
or32le(Loc, (SA & 0x0FFC) << 9);
|
||||
break;
|
||||
case R_AARCH64_LDST8_ABS_LO12_NC:
|
||||
or32le(Loc, (SA & 0xFFF) << 10);
|
||||
break;
|
||||
|
|
|
@ -136,3 +136,17 @@ foo128:
|
|||
# CHECK: 1104c: 74 16 c0 3d ldr q20, [x19, #80]
|
||||
#foo128:
|
||||
# 11050: 66 6f 6f 00 .word
|
||||
|
||||
.section .R_AARCH64_LDST16_ABS_LO12_NC,"ax",@progbits
|
||||
ldst16:
|
||||
ldr h17, [x19, :lo12:foo16]
|
||||
foo16:
|
||||
.asciz "foo"
|
||||
.size mystr, 3
|
||||
|
||||
# S = 0x11054, A = 0x4
|
||||
# R = ((S + A) & 0x0FFC) << 9 = 0xb000
|
||||
# 0xb000 | 0x7d400271 = 0x7d40b271
|
||||
# CHECK: Disassembly of section .R_AARCH64_LDST16_ABS_LO12_NC:
|
||||
# CHECK-NEXT: ldst16:
|
||||
# CHECK-NEXT: 11054: 71 b2 40 7d ldr h17, [x19, #88]
|
||||
|
|
Loading…
Reference in New Issue