Skip to content

Commit 61bccda

Browse files
committed
[LLD][ELF][ARM] Convert ADR/LDR to .inst .reloc
After D78301 MC no longer emits a relocation for this case. Change to use .inst and .reloc to synthesize the same instruction and relocation.
1 parent f44a508 commit 61bccda

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lld/test/ELF/arm-thumb-undefined-weak.s

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ _start:
2828
/// R_ARM_THM_MOVW_PREL_NC
2929
movw r0, :lower16:target - .
3030
/// R_ARM_THM_ALU_PREL_11_0
31-
adr r0, target
31+
/// adr r0, target
32+
.inst.w 0xf2af0004
33+
.reloc 0x18, R_ARM_THM_ALU_PREL_11_0, target
3234
/// R_ARM_THM_PC12
33-
ldr r0, target
35+
/// ldr r0, target
36+
.inst.w 0xf85f0004
37+
.reloc 0x1c, R_ARM_THM_PC12, target
3438
// CHECK: Disassembly of section .text:
3539
// CHECK-EMPTY:
3640
// CHECK: 200b4: {{.*}} beq.w #0 <_start+0x4>

0 commit comments

Comments
 (0)