76 changes: 38 additions & 38 deletions lld/test/ELF/arm-thunk-multipass-plt.s
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// REQUIRES: arm
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv5-none-linux-gnueabi %s -o %t
// RUN: ld.lld %t -o %t2 --shared
// RUN: llvm-objdump --start-address=7340044 --stop-address=7340048 --triple=armv5-none-linux-gnueabi -d %t2 | FileCheck %s
// RUN: llvm-objdump --start-address=8388620 --stop-address=8388624 --triple=thumbv5-none-linux-gnueabi -d %t2 | FileCheck %s --check-prefix=CHECK-CALL
// RUN: llvm-objdump --start-address=13631520 --stop-address=13631584 --triple=armv5-none-linux-gnueabi -d %t2 | FileCheck %s --check-prefix=CHECK-PLT
// When we create a thunk to a PLT entry the relocation is redirected to the
// Thunk, changing its expression to a non-PLT equivalent. If the thunk
// becomes unusable we need to restore the relocation expression to the PLT
// form so that when we create a new thunk it targets the PLT.
// RUN: llvm-objdump --no-show-raw-insn --start-address=7340044 --stop-address=7340048 --triple=armv5-none-linux-gnueabi -d %t2 | FileCheck %s
// RUN: llvm-objdump --no-show-raw-insn --start-address=8388620 --stop-address=8388624 --triple=thumbv5-none-linux-gnueabi -d %t2 | FileCheck %s --check-prefix=CHECK-CALL
// RUN: llvm-objdump --no-show-raw-insn --start-address=13631520 --stop-address=13631584 --triple=armv5-none-linux-gnueabi -d %t2 | FileCheck %s --check-prefix=CHECK-PLT
/// When we create a thunk to a PLT entry the relocation is redirected to the
/// Thunk, changing its expression to a non-PLT equivalent. If the thunk
/// becomes unusable we need to restore the relocation expression to the PLT
/// form so that when we create a new thunk it targets the PLT.

// Test case that checks the case:
// - Thunk is created on pass 1 to a PLT entry for preemptible
// - Some other Thunk added in the same pass moves the thunk to
// preemptible out of range of its caller.
// - New Thunk is created on pass 2 to PLT entry for preemptible
/// Test case that checks the case:
/// - Thunk is created on pass 1 to a PLT entry for preemptible
/// - Some other Thunk added in the same pass moves the thunk to
/// preemptible out of range of its caller.
/// - New Thunk is created on pass 2 to PLT entry for preemptible

.globl preemptible
.globl preemptible2
Expand Down Expand Up @@ -41,9 +41,9 @@ needsplt:

.section .text.07, "ax", %progbits
.space (1024 * 1024)
// 0x70000c + 8 + 0x60002c = 0xd00040 = preemptible@plt
// CHECK: 0070000c <__ARMV5PILongThunk_preemptible>:
// CHECK-NEXT: 70000c: 0b 00 18 ea b #6291500
/// 0x70000c + 8 + 0x60002c = 0xd00040 = preemptible@plt
// CHECK: 0070000c <__ARMV5PILongThunk_preemptible>:
// CHECK-NEXT: 70000c: b #6291500

.section .text.08, "ax", %progbits
.space (1024 * 1024) - 4
Expand All @@ -52,8 +52,8 @@ needsplt:
.balign 2
bl preemptible
bl preemptible2
// 0x80000c + 4 - 100004 = 0x70000c = __ARMv5PILongThunk_preemptible
// CHECK-CALL: 80000c: ff f6 fe ef blx #-1048580
/// 0x80000c + 4 - 100004 = 0x70000c = __ARMv5PILongThunk_preemptible
// CHECK-CALL: 80000c: blx #-1048580
.balign 2
.globl preemptible
.type preemptible, %function
Expand All @@ -72,24 +72,24 @@ preemptible2:
// CHECK-PLT: Disassembly of section .plt:
// CHECK-PLT-EMPTY:
// CHECK-PLT-NEXT: 00d00020 <$a>:
// CHECK-PLT-NEXT: d00020: 04 e0 2d e5 str lr, [sp, #-4]!
// CHECK-PLT-NEXT: d00024: 00 e6 8f e2 add lr, pc, #0, #12
// CHECK-PLT-NEXT: d00028: 02 ea 8e e2 add lr, lr, #8192
// CHECK-PLT-NEXT: d0002c: 94 f0 be e5 ldr pc, [lr, #148]!
// CHECK-PLT: 00d00030 <$d>:
// CHECK-PLT-NEXT: d00030: d4 d4 d4 d4 .word 0xd4d4d4d4
// CHECK-PLT-NEXT: d00034: d4 d4 d4 d4 .word 0xd4d4d4d4
// CHECK-PLT-NEXT: d00038: d4 d4 d4 d4 .word 0xd4d4d4d4
// CHECK-PLT-NEXT: d0003c: d4 d4 d4 d4 .word 0xd4d4d4d4
// CHECK-PLT: 00d00040 <$a>:
// CHECK-PLT-NEXT: d00040: 00 c6 8f e2 add r12, pc, #0, #12
// CHECK-PLT-NEXT: d00044: 02 ca 8c e2 add r12, r12, #8192
// CHECK-PLT-NEXT: d00048: 7c f0 bc e5 ldr pc, [r12, #124]!
// CHECK-PLT: 00d0004c <$d>:
// CHECK-PLT-NEXT: d0004c: d4 d4 d4 d4 .word 0xd4d4d4d4
// CHECK-PLT: 00d00050 <$a>:
// CHECK-PLT-NEXT: d00050: 00 c6 8f e2 add r12, pc, #0, #12
// CHECK-PLT-NEXT: d00054: 02 ca 8c e2 add r12, r12, #8192
// CHECK-PLT-NEXT: d00058: 70 f0 bc e5 ldr pc, [r12, #112]!
// CHECK-PLT: 00d0005c <$d>:
// CHECK-PLT-NEXT: d0005c: d4 d4 d4 d4 .word 0xd4d4d4d4
// CHECK-PLT-NEXT: d00020: str lr, [sp, #-4]!
// CHECK-PLT-NEXT: add lr, pc, #0, #12
// CHECK-PLT-NEXT: add lr, lr, #32, #20
// CHECK-PLT-NEXT: ldr pc, [lr, #148]!
// CHECK-PLT: 00d00030 <$d>:
// CHECK-PLT-NEXT: d00030: d4 d4 d4 d4 .word 0xd4d4d4d4
// CHECK-PLT-NEXT: d00034: d4 d4 d4 d4 .word 0xd4d4d4d4
// CHECK-PLT-NEXT: d00038: d4 d4 d4 d4 .word 0xd4d4d4d4
// CHECK-PLT-NEXT: d0003c: d4 d4 d4 d4 .word 0xd4d4d4d4
// CHECK-PLT: 00d00040 <$a>:
// CHECK-PLT-NEXT: d00040: add r12, pc, #0, #12
// CHECK-PLT-NEXT: d00044: add r12, r12, #32, #20
// CHECK-PLT-NEXT: d00048: ldr pc, [r12, #124]!
// CHECK-PLT: 00d0004c <$d>:
// CHECK-PLT-NEXT: d0004c: d4 d4 d4 d4 .word 0xd4d4d4d4
// CHECK-PLT: 00d00050 <$a>:
// CHECK-PLT-NEXT: d00050: add r12, pc, #0, #12
// CHECK-PLT-NEXT: d00054: add r12, r12, #32, #20
// CHECK-PLT-NEXT: d00058: ldr pc, [r12, #112]!
// CHECK-PLT: 00d0005c <$d>:
// CHECK-PLT-NEXT: d0005c: d4 d4 d4 d4 .word 0xd4d4d4d4
16 changes: 8 additions & 8 deletions lld/test/ELF/arm-thunk-nosuitable.s
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// REQUIRES: arm
// RUN: llvm-mc %s --arm-add-build-attributes --triple=armv7a-linux-gnueabihf --filetype=obj -o %t.o
// RUN: ld.lld %t.o -o %t
// RUN: llvm-objdump --triple=thumbv7a -d --start-address=0x2110b4 --stop-address=0x2110be %t | FileCheck %s
// RUN: llvm-objdump --triple=thumbv7a -d --start-address=0x2200b4 --stop-address=0x2200be %t | FileCheck %s

// Create a conditional branch too far away from a precreated thunk
// section. This will need a thunk section created within range.
/// Create a conditional branch too far away from a precreated thunk
/// section. This will need a thunk section created within range.
.syntax unified
.thumb

Expand All @@ -13,17 +13,17 @@
.globl _start
.type _start, %function
_start:
// Range of +/- 1 Megabyte, new ThunkSection will need creating after
// .text.1
/// Range of +/- 1 Megabyte, new ThunkSection will need creating after
/// .text.1
beq.w target
.section .text.1, "ax", %progbits
bx lr

// CHECK: <_start>:
// CHECK-NEXT: 2110b4: 00 f0 00 80 beq.w #0
// CHECK-NEXT: 2200b4: 00 f0 00 80 beq.w #0
// CHECK: <__Thumbv7ABSLongThunk_target>:
// CHECK-NEXT: 2110b8: 00 f0 01 90 b.w #12582914
// CHECK: 2110bc: 70 47 bx lr
// CHECK-NEXT: 2200b8: 00 f0 01 90 b.w #12582914
// CHECK: 2200bc: 70 47 bx lr

.section .text.2, "ax", %progbits
.space 12 * 1024 * 1024
Expand Down
18 changes: 9 additions & 9 deletions lld/test/ELF/arm-thunk-re-add.s
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
// RUN: llvm-objdump -d %t.so --start-address=17825800 --stop-address=17825826 --triple=thumbv7a-linux-gnueabihf | FileCheck --check-prefix=CHECK2 %s
// RUN: llvm-objdump -d %t.so --start-address=17825824 --stop-address=17825892 --triple=armv7a-linux-gnueabihf | FileCheck --check-prefix=CHECK3 %s

// A branch to a Thunk that we create on pass N, can drift out of range if
// other Thunks are added in between. In this case we must create a new Thunk
// for the branch that is in range. We also need to make sure that if the
// destination of the Thunk is in the PLT the new Thunk also targets the PLT
/// A branch to a Thunk that we create on pass N, can drift out of range if
/// other Thunks are added in between. In this case we must create a new Thunk
/// for the branch that is in range. We also need to make sure that if the
/// destination of the Thunk is in the PLT the new Thunk also targets the PLT
.syntax unified
.thumb

Expand Down Expand Up @@ -64,7 +64,7 @@ tfunc\suff\():
FUNCTION 29
FUNCTION 30
FUNCTION 31
// Precreated Thunk Pool goes here
/// Precreated Thunk Pool goes here
// CHECK1: <__ThumbV7PILongThunk_imported>:
// CHECK1-NEXT: 1000004: 40 f2 30 0c movw r12, #48
// CHECK1-NEXT: 1000008: c0 f2 10 0c movt r12, #16
Expand All @@ -81,7 +81,7 @@ tfunc\suff\():
.section .text.33, "ax", %progbits
.space 0x80000 - 0x14
.section .text.34, "ax", %progbits
// Need a Thunk to the PLT entry, can use precreated ThunkSection
/// Need a Thunk to the PLT entry, can use precreated ThunkSection
.globl callers
.type callers, %function
callers:
Expand All @@ -103,7 +103,7 @@ callers:
// CHECK3-NEXT: <$a>:
// CHECK3-NEXT: 1100020: 04 e0 2d e5 str lr, [sp, #-4]!
// CHECK3-NEXT: 1100024: 00 e6 8f e2 add lr, pc, #0, #12
// CHECK3-NEXT: 1100028: 02 ea 8e e2 add lr, lr, #8192
// CHECK3-NEXT: 1100028: 20 ea 8e e2 add lr, lr, #32
// CHECK3-NEXT: 110002c: 94 f0 be e5 ldr pc, [lr, #148]!
// CHECK3: <$d>:
// CHECK3-NEXT: 1100030: d4 d4 d4 d4 .word 0xd4d4d4d4
Expand All @@ -112,13 +112,13 @@ callers:
// CHECK3-NEXT: 110003c: d4 d4 d4 d4 .word 0xd4d4d4d4
// CHECK3: <$a>:
// CHECK3-NEXT: 1100040: 00 c6 8f e2 add r12, pc, #0, #12
// CHECK3-NEXT: 1100044: 02 ca 8c e2 add r12, r12, #8192
// CHECK3-NEXT: 1100044: 20 ca 8c e2 add r12, r12, #32
// CHECK3-NEXT: 1100048: 7c f0 bc e5 ldr pc, [r12, #124]!
// CHECK3: <$d>:
// CHECK3-NEXT: 110004c: d4 d4 d4 d4 .word 0xd4d4d4d4
// CHECK3: <$a>:
// CHECK3-NEXT: 1100050: 00 c6 8f e2 add r12, pc, #0, #12
// CHECK3-NEXT: 1100054: 02 ca 8c e2 add r12, r12, #8192
// CHECK3-NEXT: 1100054: 20 ca 8c e2 add r12, r12, #32
// CHECK3-NEXT: 1100058: 70 f0 bc e5 ldr pc, [r12, #112]!
// CHECK3: <$d>:
// CHECK3-NEXT: 110005c: d4 d4 d4 d4 .word 0xd4d4d4d4
20 changes: 10 additions & 10 deletions lld/test/ELF/arm-tls-gd-nonpreemptible.s
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
// RUN: ld.lld %t --shared -o %t3.so
// RUN: llvm-objdump -s %t3.so | FileCheck --check-prefix=CHECK-SHARED %s

// For an executable, we write the module index 1 and the offset into the TLS
// directly into the GOT. For a shared library we can only write the offset
// into the TLS directly if the symbol is non-preemptible
/// For an executable, we write the module index 1 and the offset into the TLS
/// directly into the GOT. For a shared library we can only write the offset
/// into the TLS directly if the symbol is non-preemptible

.text
.syntax unified
Expand All @@ -30,9 +30,9 @@ func:
.L3:
nop
.p2align 2
// Generate R_ARM_TLS_GD32 relocations
// These can be resolved at static link time for executables as 1 is always the
// module index and the offset into tls is known at static link time
/// Generate R_ARM_TLS_GD32 relocations
/// These can be resolved at static link time for executables as 1 is always the
/// module index and the offset into tls is known at static link time
.Lt0: .word x1(TLSGD) + (. - .L0 - 8)
.Lt1: .word x2(TLSGD) + (. - .L1 - 8)
.Lt2: .word x3(TLSGD) + (. - .L2 - 8)
Expand Down Expand Up @@ -64,9 +64,9 @@ x4:
.space 4

// CHECK: Contents of section .got:
// CHECK-NEXT: 12140 01000000 00000000 01000000 04000000
// CHECK-NEXT: 12150 01000000 08000000 01000000 0c000000
// CHECK-NEXT: 30140 01000000 00000000 01000000 04000000
// CHECK-NEXT: 30150 01000000 08000000 01000000 0c000000

// CHECK-SHARED: Contents of section .got:
// CHECK-SHARED-NEXT: 22a8 00000000 00000000 00000000 04000000
// CHECK-SHARED-NEXT: 22b8 00000000 00000000 00000000 00000000
// CHECK-SHARED-NEXT: 202a8 00000000 00000000 00000000 04000000
// CHECK-SHARED-NEXT: 202b8 00000000 00000000 00000000 00000000
58 changes: 29 additions & 29 deletions lld/test/ELF/arm-tls-gd32.s
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
// RUN: llvm-readobj -S --dyn-relocations %t.so | FileCheck --check-prefix=SEC %s
// RUN: llvm-objdump -d --triple=armv7a-linux-gnueabi %t.so | FileCheck %s

// Test the handling of the global-dynamic TLS model. Dynamic Loader finds
// module index R_ARM_TLS_DTPMOD32 and the offset within the module
// R_ARM_TLS_DTPOFF32. One of the variables is hidden which permits relaxation
// to local dynamic
/// Test the handling of the global-dynamic TLS model. Dynamic Loader finds
/// module index R_ARM_TLS_DTPMOD32 and the offset within the module
/// R_ARM_TLS_DTPOFF32. One of the variables is hidden which permits relaxation
/// to local dynamic

.text
.syntax unified
Expand All @@ -23,17 +23,17 @@ func:
nop

.p2align 2
// Generate R_ARM_TLS_GD32 relocations
// Allocates a pair of GOT entries dynamically relocated by R_ARM_TLS_DTPMOD32
// and R_ARM_TLS_DTPOFF32 respectively. The literal contains the offset of the
// first GOT entry from the place
/// Generate R_ARM_TLS_GD32 relocations
/// Allocates a pair of GOT entries dynamically relocated by R_ARM_TLS_DTPMOD32
/// and R_ARM_TLS_DTPOFF32 respectively. The literal contains the offset of the
/// first GOT entry from the place
.Lt0: .word x(TLSGD) + (. - .L0 - 8)
.Lt1: .word y(TLSGD) + (. - .L1 - 8)
.Lt2: .word z(TLSGD) + (. - .L2 - 8)

// __thread int x = 10
// __thread int y;
// __thread int z __attribute((visibility("hidden")))
/// __thread int x = 10
/// __thread int y;
/// __thread int z __attribute((visibility("hidden")))

.hidden z
.globl z
Expand Down Expand Up @@ -62,7 +62,7 @@ x:
// SEC-NEXT: SHF_TLS
// SEC-NEXT: SHF_WRITE
// SEC-NEXT: ]
// SEC-NEXT: Address: 0x2210
// SEC-NEXT: Address: 0x20210
// SEC: Size: 4
// SEC: Name: .tbss
// SEC-NEXT: Type: SHT_NOBITS
Expand All @@ -71,7 +71,7 @@ x:
// SEC-NEXT: SHF_TLS
// SEC-NEXT: SHF_WRITE
// SEC-NEXT: ]
// SEC-NEXT: Address: 0x2214
// SEC-NEXT: Address: 0x20214
// SEC: Size: 8

// SEC: Name: .got
Expand All @@ -80,26 +80,26 @@ x:
// SEC-NEXT: SHF_ALLOC
// SEC-NEXT: SHF_WRITE
// SEC-NEXT: ]
// SEC-NEXT: Address: 0x2264
// SEC-NEXT: Address: 0x20264
// SEC: Size: 24

// SEC: Dynamic Relocations {
// SEC-NEXT: 0x2274 R_ARM_TLS_DTPMOD32 -
// SEC-NEXT: 0x2264 R_ARM_TLS_DTPMOD32 x
// SEC-NEXT: 0x2268 R_ARM_TLS_DTPOFF32 x
// SEC-NEXT: 0x226C R_ARM_TLS_DTPMOD32 y
// SEC-NEXT: 0x2270 R_ARM_TLS_DTPOFF32 y
// SEC-NEXT: 0x20274 R_ARM_TLS_DTPMOD32 -
// SEC-NEXT: 0x20264 R_ARM_TLS_DTPMOD32 x
// SEC-NEXT: 0x20268 R_ARM_TLS_DTPOFF32 x
// SEC-NEXT: 0x2026C R_ARM_TLS_DTPMOD32 y
// SEC-NEXT: 0x20270 R_ARM_TLS_DTPOFF32 y


// CHECK-LABEL: 000011f8 <func>:
// CHECK-NEXT: 11f8: 00 f0 20 e3 nop
// CHECK-NEXT: 11fc: 00 f0 20 e3 nop
// CHECK-NEXT: 1200: 00 f0 20 e3 nop
// CHECK-LABEL: 000101f8 <func>:
// CHECK-NEXT: 101f8: 00 f0 20 e3 nop
// CHECK-NEXT: 101fc: 00 f0 20 e3 nop
// CHECK-NEXT: 10200: 00 f0 20 e3 nop

// (0x2264 - 0x1204) + (0x1204 - 0x11f8 - 8) = 0x1064
// CHECK: 1204: 64 10 00 00
// (0x226c - 0x1204) + (0x1204 - 0x11fc - 8) = 0x1068
// CHECK-NEXT: 1208: 68 10 00 00
// (0x2274 - 0x1204) + (0x1204 - 0x1200 - 8) = 0x106c
// CHECK-NEXT: 120c: 6c 10 00 00
/// (0x20264 - 0x1204) + (0x10204 - 0x101f8 - 8) = 0x1f064
// CHECK: 10204: 64 00 01 00
/// (0x2026c - 0x10204) + (0x10204 - 0x101fc - 8) = 0x10068
// CHECK-NEXT: 10208: 68 00 01 00
/// (0x20274 - 0x10204) + (0x10204 - 0x10200 - 8) = 0x1006c
// CHECK-NEXT: 1020c: 6c 00 01 00

44 changes: 22 additions & 22 deletions lld/test/ELF/arm-tls-ie32.s
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
// RUN: llvm-readobj -S --dyn-relocations %t.so | FileCheck --check-prefix=SEC %s
// RUN: llvm-objdump -d --triple=armv7a-linux-gnueabi %t.so | FileCheck %s

// Test the handling of the initial-exec TLS model. Relative location within
// static TLS is a run-time constant computed by dynamic loader as a result
// of the R_ARM_TLS_TPOFF32 relocation.
/// Test the handling of the initial-exec TLS model. Relative location within
/// static TLS is a run-time constant computed by dynamic loader as a result
/// of the R_ARM_TLS_TPOFF32 relocation.

.syntax unified
.arm
Expand All @@ -22,16 +22,16 @@ func:
nop

.p2align 2
// Generate R_ARM_TLS_IE32 static relocations
// Allocates a GOT entry dynamically relocated by R_ARM_TLS_TPOFF32
// literal contains the offset of the GOT entry from the place
/// Generate R_ARM_TLS_IE32 static relocations
/// Allocates a GOT entry dynamically relocated by R_ARM_TLS_TPOFF32
/// literal contains the offset of the GOT entry from the place
.Lt0: .word x(gottpoff) + (. - .L0 - 8)
.Lt1: .word y(gottpoff) + (. - .L1 - 8)
.Lt2: .word .TLSSTART(gottpoff) + (. - .L2 - 8)

// __thread int x = 10
// __thread int y;
// __thread int z __attribute((visibility("hidden")))
/// __thread int x = 10
/// __thread int y;
/// __thread int z __attribute((visibility("hidden")))
.hidden z
.globl z
.globl y
Expand Down Expand Up @@ -73,25 +73,25 @@ x:
// SEC-NEXT: SHF_ALLOC
// SEC-NEXT: SHF_WRITE
// SEC-NEXT: ]
// SEC-NEXT: Address: 0x2254
// SEC-NEXT: Address: 0x20254
// SEC: Size: 12


// SEC: Dynamic Relocations {
// SEC: 0x225C R_ARM_TLS_TPOFF32
// SEC: 0x2254 R_ARM_TLS_TPOFF32 x
// SEC: 0x2258 R_ARM_TLS_TPOFF32 y
// SEC: 0x2025C R_ARM_TLS_TPOFF32
// SEC: 0x20254 R_ARM_TLS_TPOFF32 x
// SEC: 0x20258 R_ARM_TLS_TPOFF32 y

// CHECK: Disassembly of section .text:
// CHECK-EMPTY:
// CHECK-NEXT: <func>:
// CHECK-NEXT: 11e8: 00 f0 20 e3 nop
// CHECK-NEXT: 11ec: 00 f0 20 e3 nop
// CHECK-NEXT: 11f0: 00 f0 20 e3 nop
// CHECK-NEXT: 101e8: 00 f0 20 e3 nop
// CHECK-NEXT: 101ec: 00 f0 20 e3 nop
// CHECK-NEXT: 101f0: 00 f0 20 e3 nop

// (0x2254 - 0x11f4) + (0x11f4 - 0x11e8 - 8) = 0x1064
// CHECK: 11f4: 64 10 00 00
// (0x2258 - 0x11f8) + (0x11f8 - 0x11ec - 8) = 0x1064
// CHECK-NEXT: 11f8: 64 10 00 00
// (0x225c - 0x11f8) + (0x11f8 - 0x11f0 - 8) = 0x1064
// CHECK-NEXT: 11fc: 64 10 00 00
/// (0x20254 - 0x101f4) + (0x101f4 - 0x101e8 - 8) = 0x10064
// CHECK: 101f4: 64 00 01 00
/// (0x20258 - 0x101f8) + (0x101f8 - 0x101ec - 8) = 0x10064
// CHECK-NEXT: 101f8: 64 00 01 00
/// (0x2025c - 0x101f8) + (0x101f8 - 0x101f0 - 8) = 0x10064
// CHECK-NEXT: 101fc: 64 00 01 00
30 changes: 15 additions & 15 deletions lld/test/ELF/arm-tls-ldm32.s
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
// RUN: ld.lld %t.o -o %t
// RUN: llvm-objdump -d --triple=armv7a-linux-gnueabi %t | FileCheck --check-prefix=CHECK-EXE %s

// Test the handling of the local-dynamic TLS model. Dynamic loader finds
// module index R_ARM_TLS_DTPMOD32. The offset in the next GOT slot is 0
// The R_ARM_TLS_LDO is the offset of the variable within the TLS block.
/// Test the handling of the local-dynamic TLS model. Dynamic loader finds
/// module index R_ARM_TLS_DTPMOD32. The offset in the next GOT slot is 0
/// The R_ARM_TLS_LDO is the offset of the variable within the TLS block.
.global __tls_get_addr
.text
.p2align 2
Expand Down Expand Up @@ -42,7 +42,7 @@ x:
// SEC-NEXT: SHF_TLS
// SEC-NEXT: SHF_WRITE
// SEC-NEXT: ]
// SEC-NEXT: Address: 0x21D0
// SEC-NEXT: Address: 0x201D0
// SEC: Size: 4
// SEC: Name: .tbss
// SEC-NEXT: Type: SHT_NOBITS (0x8)
Expand All @@ -51,24 +51,24 @@ x:
// SEC-NEXT: SHF_TLS
// SEC-NEXT: SHF_WRITE
// SEC-NEXT: ]
// SEC-NEXT: Address: 0x21D4
// SEC-NEXT: Address: 0x201D4
// SEC: Size: 4

// SEC: Dynamic Relocations {
// SEC-NEXT: 0x2224 R_ARM_TLS_DTPMOD32 - 0x0
// SEC-NEXT: 0x20224 R_ARM_TLS_DTPMOD32 - 0x0

// CHECK: Disassembly of section .text:
// CHECK-EMPTY:
// CHECK-NEXT: <_start>:
// CHECK-NEXT: 11c0: 00 f0 20 e3 nop
// CHECK-NEXT: 101c0: 00 f0 20 e3 nop

// (0x2224 - 0x11c4) + (0x11c4 - 0x11c0 - 8) = 0x105c
// CHECK: 11c4: 5c 10 00 00
// CHECK-NEXT: 11c8: 00 00 00 00
// CHECK-NEXT: 11cc: 04 00 00 00
/// (0x20224 - 0x101c4) + (0x101c4 - 0x101c0 - 8) = 0x1005c
// CHECK: 101c4: 5c 00 01 00
// CHECK-NEXT: 101c8: 00 00 00 00
// CHECK-NEXT: 101cc: 04 00 00 00

// CHECK-EXE: <_start>:
// CHECK-EXE-NEXT: 11114: 00 f0 20 e3 nop
// CHECK-EXE: 11118: 0c 10 00 00
// CHECK-EXE-NEXT: 1111c: 00 00 00 00
// CHECK-EXE-NEXT: 11120: 04 00 00 00
// CHECK-EXE-NEXT: 20114: 00 f0 20 e3 nop
// CHECK-EXE: 20118: 0c 00 01 00
// CHECK-EXE-NEXT: 2011c: 00 00 00 00
// CHECK-EXE-NEXT: 20120: 04 00 00 00
32 changes: 16 additions & 16 deletions lld/test/ELF/arm-tls-le32.s
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
// RUN: llvm-readobj -S --dyn-relocations %t | FileCheck --check-prefix=SEC %s
// RUN: llvm-objdump -d --triple=armv7a-linux-gnueabi %t | FileCheck %s

// Test the handling of the local exec TLS model. TLS can be resolved
// statically for an application. The code sequences assume a thread pointer
// in r9
/// Test the handling of the local exec TLS model. TLS can be resolved
/// statically for an application. The code sequences assume a thread pointer
/// in r9

.text
.syntax unified
Expand All @@ -15,15 +15,15 @@
.type _start,%function
_start:
.p2align 2
// Generate R_ARM_TLS_LE32 relocations. These resolve statically to the offset
// of the variable from the thread pointer
/// Generate R_ARM_TLS_LE32 relocations. These resolve statically to the offset
/// of the variable from the thread pointer
.Lt0: .word x(TPOFF)
.Lt1: .word y(TPOFF)
.Lt2: .word z(TPOFF)

// __thread int x = 10
// __thread int y;
// __thread int z __attribute((visibility("hidden")))
/// __thread int x = 10
/// __thread int y;
/// __thread int z __attribute((visibility("hidden")))

.hidden z
.globl z
Expand Down Expand Up @@ -52,7 +52,7 @@ x:
// SEC-NEXT: SHF_TLS
// SEC-NEXT: SHF_WRITE
// SEC-NEXT: ]
// SEC-NEXT: Address: 0x12120
// SEC-NEXT: Address: 0x30120
// SEC: Size: 4
// SEC: Name: .tbss
// SEC-NEXT: Type: SHT_NOBITS
Expand All @@ -61,7 +61,7 @@ x:
// SEC-NEXT: SHF_TLS
// SEC-NEXT: SHF_WRITE
// SEC-NEXT: ]
// SEC-NEXT: Address: 0x12124
// SEC-NEXT: Address: 0x30124
// SEC: Size: 8

// SEC: Dynamic Relocations {
Expand All @@ -70,9 +70,9 @@ x:
// CHECK: Disassembly of section .text:
// CHECK-EMPTY:
// CHECK-NEXT: <_start>:
// offset of x from Thread pointer = (TcbSize + 0x0 = 0x8)
// CHECK-NEXT: 11114: 08 00 00 00
// offset of z from Thread pointer = (TcbSize + 0x8 = 0x10)
// CHECK-NEXT: 11118: 10 00 00 00
// offset of y from Thread pointer = (TcbSize + 0x4 = 0xc)
// CHECK-NEXT: 1111c: 0c 00 00 00
/// offset of x from Thread pointer = (TcbSize + 0x0 = 0x8)
// CHECK-NEXT: 20114: 08 00 00 00
/// offset of z from Thread pointer = (TcbSize + 0x8 = 0x10)
// CHECK-NEXT: 20118: 10 00 00 00
/// offset of y from Thread pointer = (TcbSize + 0x4 = 0xc)
// CHECK-NEXT: 2011c: 0c 00 00 00
16 changes: 8 additions & 8 deletions lld/test/ELF/arm-tls-norelax-gd-ie.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
// RUN: ld.lld %t1.so %t.o -o %t
// RUN: llvm-readobj -S --dyn-relocations %t | FileCheck %s

// This tls global-dynamic sequence is with respect to a preemptible symbol but
// is in an application so a relaxation to Initial Exec would normally be
// possible. This would result in an assertion failure on ARM as the
// relaxation functions can't be implemented on ARM. Check that the sequence
// is handled as global dynamic
/// This tls global-dynamic sequence is with respect to a preemptible symbol but
/// is in an application so a relaxation to Initial Exec would normally be
/// possible. This would result in an assertion failure on ARM as the
/// relaxation functions can't be implemented on ARM. Check that the sequence
/// is handled as global dynamic

.text
.syntax unified
Expand All @@ -25,6 +25,6 @@ func:
.Lt0: .word y(TLSGD) + (. - .L0 - 8)

// CHECK: Dynamic Relocations {
// CHECK-NEXT: 0x12290 R_ARM_TLS_DTPMOD32 y
// CHECK-NEXT: 0x12294 R_ARM_TLS_DTPOFF32 y
// CHECK-NEXT: 0x132A4 R_ARM_JUMP_SLOT __tls_get_addr
// CHECK-NEXT: 0x30290 R_ARM_TLS_DTPMOD32 y
// CHECK-NEXT: 0x30294 R_ARM_TLS_DTPOFF32 y
// CHECK-NEXT: 0x402A4 R_ARM_JUMP_SLOT __tls_get_addr
16 changes: 8 additions & 8 deletions lld/test/ELF/arm-tls-norelax-gd-le.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
// RUN: ld.lld %t1.so %t.o -o %t
// RUN: llvm-objdump -s %t | FileCheck %s

// This tls global-dynamic sequence is with respect to a non-preemptible
// symbol in an application so a relaxation to Local Exec would normally be
// possible. This would result in an assertion failure on ARM as the
// relaxation functions can't be implemented on ARM. Check that the sequence
// is handled as global dynamic
/// This tls global-dynamic sequence is with respect to a non-preemptible
/// symbol in an application so a relaxation to Local Exec would normally be
/// possible. This would result in an assertion failure on ARM as the
/// relaxation functions can't be implemented on ARM. Check that the sequence
/// is handled as global dynamic

.text
.syntax unified
Expand All @@ -32,10 +32,10 @@ x:
.type x, %object

// CHECK: Contents of section .got:
// Module index is always 1 for executable
// CHECK-NEXT: 12268 01000000 00000000
/// Module index is always 1 for executable
// CHECK-NEXT: 30268 01000000 00000000


// Without any definition of __tls_get_addr we get an error
/// Without any definition of __tls_get_addr we get an error
// RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s
// ERR: error: undefined symbol: __tls_get_addr
12 changes: 6 additions & 6 deletions lld/test/ELF/arm-tls-norelax-ie-le.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
// RUN: ld.lld %t1.so %t.o -o %t
// RUN: llvm-objdump -s --triple=armv7a-linux-gnueabi %t | FileCheck %s

// This tls Initial Exec sequence is with respect to a non-preemptible symbol
// so a relaxation would normally be possible. This would result in an assertion
// failure on ARM as the relaxation functions can't be implemented on ARM.
// Check that the sequence is handled as initial exec
/// This tls Initial Exec sequence is with respect to a non-preemptible symbol
/// so a relaxation would normally be possible. This would result in an assertion
/// failure on ARM as the relaxation functions can't be implemented on ARM.
/// Check that the sequence is handled as initial exec
.text
.syntax unified
.globl func
Expand Down Expand Up @@ -37,5 +37,5 @@ x2:
.type x2, %object

// CHECK: Contents of section .got:
// x1 at offset 8 from TP, x2 at offset 0xc from TP. Offsets include TCB size of 8
// CHECK-NEXT: 1227c 08000000 0c000000
/// x1 at offset 8 from TP, x2 at offset 0xc from TP. Offsets include TCB size of 8
// CHECK-NEXT: 3027c 08000000 0c000000
2 changes: 1 addition & 1 deletion lld/test/ELF/arm-tls-norelax-ld-le.s
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ x:
.word 10

// CHECK: Contents of section .got:
// CHECK-NEXT: 1227c 01000000 00000000
// CHECK-NEXT: 3027c 01000000 00000000
36 changes: 18 additions & 18 deletions lld/test/ELF/arm-undefined-weak.s
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
// RUN: ld.lld --image-base=0x10000000 %t -o %t2
// RUN: llvm-objdump --triple=armv7a-none-linux-gnueabi --no-show-raw-insn -d %t2 | FileCheck %s

// Check that the ARM ABI rules for undefined weak symbols are applied.
// Branch instructions are resolved to the next instruction. Undefined
// Symbols in relative are resolved to the place so S - P + A = A.
// We place the image-base at 0x10000000 to test that a range extensions thunk
// is not generated.
/// Check that the ARM ABI rules for undefined weak symbols are applied.
/// Branch instructions are resolved to the next instruction. Undefined
/// Symbols in relative are resolved to the place so S - P + A = A.
/// We place the image-base at 0x10000000 to test that a range extensions thunk
/// is not generated.

.syntax unified

Expand All @@ -17,25 +17,25 @@
.text
.global _start
_start:
// R_ARM_JUMP24
/// R_ARM_JUMP24
b target
// R_ARM_CALL
/// R_ARM_CALL
bl target
// R_ARM_CALL with exchange
/// R_ARM_CALL with exchange
blx target
// R_ARM_MOVT_PREL
/// R_ARM_MOVT_PREL
movt r0, :upper16:target - .
// R_ARM_MOVW_PREL_NC
/// R_ARM_MOVW_PREL_NC
movw r0, :lower16:target - .
// R_ARM_REL32
/// R_ARM_REL32
.word target - .

// CHECK: Disassembly of section .text:
// CHECK-EMPTY:
// CHECK-NEXT: 100010b4 <_start>:
// CHECK-NEXT: 100010b4: b #-4
// CHECK-NEXT: 100010b8: bl #-4
// CHECK-NEXT: 100010bc: bl #-4
// CHECK-NEXT: 100010c0: movt r0, #0
// CHECK-NEXT: 100010c4: movw r0, #0
// CHECK: 100010c8: 00 00 00 00 .word 0x00000000
// CHECK-NEXT: 100100b4 <_start>:
// CHECK-NEXT: 100100b4: b #-4
// CHECK-NEXT: 100100b8: bl #-4
// CHECK-NEXT: 100100bc: bl #-4
// CHECK-NEXT: 100100c0: movt r0, #0
// CHECK-NEXT: 100100c4: movw r0, #0
// CHECK: 100100c8: 00 00 00 00 .word 0x00000000
4 changes: 2 additions & 2 deletions lld/test/ELF/global-offset-table-position-arm.s
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// RUN: ld.lld --hash-style=sysv -shared %t -o %t2
// RUN: llvm-readobj --symbols %t2 | FileCheck %s

// The ARM _GLOBAL_OFFSET_TABLE_ should be defined at the start of the .got
/// The ARM _GLOBAL_OFFSET_TABLE_ should be defined at the start of the .got
.globl a
.type a,%object
.comm a,4,4
Expand All @@ -25,7 +25,7 @@ _start:
.data

// CHECK: Name: _GLOBAL_OFFSET_TABLE_
// CHECK-NEXT: Value: 0x2268
// CHECK-NEXT: Value: 0x20268
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
Expand Down
68 changes: 34 additions & 34 deletions lld/test/ELF/pack-dyn-relocs-arm2.s
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,40 @@
// RUN: llvm-readobj -r %t.exe | FileCheck %s

// CHECK: Section (5) .relr.dyn {
// CHECK-NEXT: 0x31E0 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x31E4 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x31E8 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x31EC R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x31F0 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x31F4 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x31F8 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x31FC R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3200 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3204 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3208 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x320C R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3210 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3214 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3218 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x321C R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3220 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3224 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3228 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x322C R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3230 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3234 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3238 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x323C R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3240 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3244 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3248 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x324C R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3250 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3254 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3258 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x325C R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3260 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3264 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x301E0 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x301E4 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x301E8 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x301EC R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x301F0 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x301F4 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x301F8 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x301FC R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30200 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30204 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30208 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3020C R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30210 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30214 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30218 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3021C R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30220 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30224 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30228 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3022C R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30230 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30234 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30238 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3023C R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30240 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30244 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30248 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3024C R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30250 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30254 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30258 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x3025C R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30260 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: 0x30264 R_ARM_RELATIVE - 0x0
// CHECK-NEXT: }

// RUN: llvm-readobj -S --dynamic-table %t.exe | FileCheck --check-prefix=HEADER %s
Expand Down
246 changes: 123 additions & 123 deletions lld/test/ELF/pack-dyn-relocs.s
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,44 @@
// RUN: ld.lld -pie --pack-dyn-relocs=none %t.a32.o %t.a32.so -o %t2.a32
// RUN: llvm-readobj -r %t2.a32 | FileCheck --check-prefix=UNPACKED32 %s

// Unpacked should have the relative relocations in their natural order.
// UNPACKED32: Section ({{.+}}) .rel.dyn {
// UNPACKED32-NEXT: 0x331C R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3320 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3324 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3328 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x332C R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3330 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3334 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3338 R_ARM_RELATIVE - 0x0

// UNPACKED32-NEXT: 0x3340 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3344 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3348 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x334C R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3350 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3354 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3358 R_ARM_RELATIVE - 0x0

// UNPACKED32-NEXT: 0x3364 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3368 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x336C R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3370 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3374 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3378 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x337C R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3380 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3384 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3389 R_ARM_RELATIVE - 0x0

// UNPACKED32-NEXT: 0x333C R_ARM_ABS32 bar2 0x0
// UNPACKED32-NEXT: 0x3360 R_ARM_ABS32 bar2 0x0
// UNPACKED32-NEXT: 0x338D R_ARM_ABS32 bar2 0x0
// UNPACKED32-NEXT: 0x3391 R_ARM_ABS32 bar2 0x0
// UNPACKED32-NEXT: 0x3395 R_ARM_ABS32 bar2 0x0
// UNPACKED32-NEXT: 0x3399 R_ARM_ABS32 bar2 0x0
// UNPACKED32-NEXT: 0x339D R_ARM_ABS32 bar2 0x0
// UNPACKED32-NEXT: 0x335C R_ARM_ABS32 zed2 0x0
/// Unpacked should have the relative relocations in their natural order.
/// UNPACKED32: Section ({{.+}}) .rel.dyn {
// UNPACKED32-NEXT: 0x3031C R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30320 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30324 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30328 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3032C R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30330 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30334 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30338 R_ARM_RELATIVE - 0x0

// UNPACKED32-NEXT: 0x30340 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30344 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30348 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3034C R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30350 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30354 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30358 R_ARM_RELATIVE - 0x0

// UNPACKED32-NEXT: 0x30364 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30368 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3036C R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30370 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30374 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30378 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x3037C R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30380 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30384 R_ARM_RELATIVE - 0x0
// UNPACKED32-NEXT: 0x30389 R_ARM_RELATIVE - 0x0

// UNPACKED32-NEXT: 0x3033C R_ARM_ABS32 bar2 0x0
// UNPACKED32-NEXT: 0x30360 R_ARM_ABS32 bar2 0x0
// UNPACKED32-NEXT: 0x3038D R_ARM_ABS32 bar2 0x0
// UNPACKED32-NEXT: 0x30391 R_ARM_ABS32 bar2 0x0
// UNPACKED32-NEXT: 0x30395 R_ARM_ABS32 bar2 0x0
// UNPACKED32-NEXT: 0x30399 R_ARM_ABS32 bar2 0x0
// UNPACKED32-NEXT: 0x3039D R_ARM_ABS32 bar2 0x0
// UNPACKED32-NEXT: 0x3035C R_ARM_ABS32 zed2 0x0
// UNPACKED32-NEXT: }

// RUN: ld.lld -pie --pack-dyn-relocs=android %t.a32.o %t.a32.so -o %t3.a32
Expand All @@ -69,46 +69,46 @@
// ANDROID32-HEADERS: 0x6000000F ANDROID_REL [[ADDR]]
// ANDROID32-HEADERS: 0x60000010 ANDROID_RELSZ [[SIZE]]

// Packed should have the groups of non-relative relocations first, followed
// by the larger groups of relative relocations (i.e. the 8 and 9 followed
// by the 7.)
/// Packed should have the groups of non-relative relocations first, followed
/// by the larger groups of relative relocations (i.e. the 8 and 9 followed
/// by the 7.)
// ANDROID32: Section ({{.+}}) .rel.dyn {
// ANDROID32-NEXT: 0x324C R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3250 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3254 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3258 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x325C R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3260 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3264 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3268 R_ARM_RELATIVE - 0

// ANDROID32-NEXT: 0x3294 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3298 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x329C R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x32A0 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x32A4 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x32A8 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x32AC R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x32B0 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x32B4 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3270 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3274 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3278 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x327C R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3280 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3284 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3288 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x32B9 R_ARM_RELATIVE - 0

// ANDROID32-NEXT: 0x326C R_ARM_ABS32 bar2 0
// ANDROID32-NEXT: 0x3290 R_ARM_ABS32 bar2 0
// ANDROID32-NEXT: 0x32BD R_ARM_ABS32 bar2 0
// ANDROID32-NEXT: 0x32C1 R_ARM_ABS32 bar2 0
// ANDROID32-NEXT: 0x32C5 R_ARM_ABS32 bar2 0
// ANDROID32-NEXT: 0x32C9 R_ARM_ABS32 bar2 0
// ANDROID32-NEXT: 0x32CD R_ARM_ABS32 bar2 0

// ANDROID32-NEXT: 0x328C R_ARM_ABS32 zed2 0
// ANDROID32-NEXT: 0x3024C R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x30250 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x30254 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x30258 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3025C R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x30260 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x30264 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x30268 R_ARM_RELATIVE - 0

// ANDROID32-NEXT: 0x30294 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x30298 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3029C R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x302A0 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x302A4 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x302A8 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x302AC R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x302B0 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x302B4 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x30270 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x30274 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x30278 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x3027C R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x30280 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x30284 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x30288 R_ARM_RELATIVE - 0
// ANDROID32-NEXT: 0x302B9 R_ARM_RELATIVE - 0

// ANDROID32-NEXT: 0x3026C R_ARM_ABS32 bar2 0
// ANDROID32-NEXT: 0x30290 R_ARM_ABS32 bar2 0
// ANDROID32-NEXT: 0x302BD R_ARM_ABS32 bar2 0
// ANDROID32-NEXT: 0x302C1 R_ARM_ABS32 bar2 0
// ANDROID32-NEXT: 0x302C5 R_ARM_ABS32 bar2 0
// ANDROID32-NEXT: 0x302C9 R_ARM_ABS32 bar2 0
// ANDROID32-NEXT: 0x302CD R_ARM_ABS32 bar2 0

// ANDROID32-NEXT: 0x3028C R_ARM_ABS32 zed2 0
// ANDROID32-NEXT: }

// RUN: ld.lld -pie --pack-dyn-relocs=relr %t.a32.o %t.a32.so -o %t4.a32
Expand Down Expand Up @@ -136,54 +136,54 @@
// RELR32-HEADERS: 0x00000023 RELRSZ 0x8
// RELR32-HEADERS: 0x00000025 RELRENT 0x4

// SHT_RELR section contains address/bitmap entries
// encoding the offsets for relative relocation.
/// SHT_RELR section contains address/bitmap entries
/// encoding the offsets for relative relocation.
// RAW-RELR32: Section ({{.+}}) .relr.dyn {
// RAW-RELR32-NEXT: 0x327C
// RAW-RELR32-NEXT: 0x3027C
// RAW-RELR32-NEXT: 0x7FCFEFF
// RAW-RELR32-NEXT: }

// Decoded SHT_RELR section is same as UNPACKED,
// but contains only the relative relocations.
// Any relative relocations with odd offset stay in SHT_REL.
/// Decoded SHT_RELR section is same as UNPACKED,
/// but contains only the relative relocations.
/// Any relative relocations with odd offset stay in SHT_REL.
// RELR32: Section ({{.+}}) .rel.dyn {
// RELR32-NEXT: 0x32E9 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x329C R_ARM_ABS32 bar2 0x0
// RELR32-NEXT: 0x32C0 R_ARM_ABS32 bar2 0x0
// RELR32-NEXT: 0x32ED R_ARM_ABS32 bar2 0x0
// RELR32-NEXT: 0x32F1 R_ARM_ABS32 bar2 0x0
// RELR32-NEXT: 0x32F5 R_ARM_ABS32 bar2 0x0
// RELR32-NEXT: 0x32F9 R_ARM_ABS32 bar2 0x0
// RELR32-NEXT: 0x32FD R_ARM_ABS32 bar2 0x0
// RELR32-NEXT: 0x32BC R_ARM_ABS32 zed2 0x0
// RELR32-NEXT: 0x302E9 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x3029C R_ARM_ABS32 bar2 0x0
// RELR32-NEXT: 0x302C0 R_ARM_ABS32 bar2 0x0
// RELR32-NEXT: 0x302ED R_ARM_ABS32 bar2 0x0
// RELR32-NEXT: 0x302F1 R_ARM_ABS32 bar2 0x0
// RELR32-NEXT: 0x302F5 R_ARM_ABS32 bar2 0x0
// RELR32-NEXT: 0x302F9 R_ARM_ABS32 bar2 0x0
// RELR32-NEXT: 0x302FD R_ARM_ABS32 bar2 0x0
// RELR32-NEXT: 0x302BC R_ARM_ABS32 zed2 0x0
// RELR32-NEXT: }
// RELR32-NEXT: Section ({{.+}}) .relr.dyn {
// RELR32-NEXT: 0x327C R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x3280 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x3284 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x3288 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x328C R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x3290 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x3294 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x3298 R_ARM_RELATIVE - 0x0

// RELR32-NEXT: 0x32A0 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x32A4 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x32A8 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x32AC R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x32B0 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x32B4 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x32B8 R_ARM_RELATIVE - 0x0

// RELR32-NEXT: 0x32C4 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x32C8 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x32CC R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x32D0 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x32D4 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x32D8 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x32DC R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x32E0 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x32E4 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x3027C R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x30280 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x30284 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x30288 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x3028C R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x30290 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x30294 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x30298 R_ARM_RELATIVE - 0x0

// RELR32-NEXT: 0x302A0 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x302A4 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x302A8 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x302AC R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x302B0 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x302B4 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x302B8 R_ARM_RELATIVE - 0x0

// RELR32-NEXT: 0x302C4 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x302C8 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x302CC R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x302D0 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x302D4 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x302D8 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x302DC R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x302E0 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: 0x302E4 R_ARM_RELATIVE - 0x0
// RELR32-NEXT: }

// RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-linux %p/Inputs/shared2.s -o %t.a64.so.o
Expand Down Expand Up @@ -318,16 +318,16 @@
// RELR64-HEADERS: 0x0000000000000023 RELRSZ 0x10
// RELR64-HEADERS: 0x0000000000000025 RELRENT 0x8

// SHT_RELR section contains address/bitmap entries
// encoding the offsets for relative relocation.
/// SHT_RELR section contains address/bitmap entries
/// encoding the offsets for relative relocation.
// RAW-RELR64: Section ({{.+}}) .relr.dyn {
// RAW-RELR64-NEXT: 0x30480
// RAW-RELR64-NEXT: 0x7FCFEFF
// RAW-RELR64-NEXT: }

// Decoded SHT_RELR section is same as UNPACKED,
// but contains only the relative relocations.
// Any relative relocations with odd offset stay in SHT_RELA.
/// Decoded SHT_RELR section is same as UNPACKED,
/// but contains only the relative relocations.
/// Any relative relocations with odd offset stay in SHT_RELA.
// RELR64: Section ({{.+}}) .rela.dyn {
// RELR64-NEXT: 0x30559 R_AARCH64_RELATIVE - 0xA
// RELR64-NEXT: 0x304C0 R_AARCH64_ABS64 bar2 0x1
Expand Down