[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / pack-dyn-relocs-loop.s
blob11ba91488a274b8aa1b245b33ecc71f8b9a9274f
1 // REQUIRES: arm, aarch64
3 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux-android %s -o %t.o
4 // RUN: ld.lld -shared %t.o -o %t.so --pack-dyn-relocs=android -z norelro -z separate-code
5 // RUN: llvm-readobj -S %t.so | FileCheck %s
7 // This test is making sure the Android packed relocation support doesn't
8 // cause an infinite loop due to the size of the section oscillating
9 // (because the size of the section impacts the layout of the following
10 // sections).
12 // This test is very sensitive to the exact section sizes and offsets,
13 // so check that they don't change.
14 // CHECK: Name: .rela.dyn (33)
15 // CHECK-NEXT: Type: SHT_ANDROID_RELA (0x60000002)
16 // CHECK-NEXT: Flags [ (0x2)
17 // CHECK-NEXT: SHF_ALLOC (0x2)
18 // CHECK-NEXT: ]
19 // CHECK-NEXT: Address: 0x1D8
20 // CHECK-NEXT: Offset: 0x1D8
21 // CHECK-NEXT: Size: 21
23 // CHECK: Name: x (43)
24 // CHECK-NEXT: Type: SHT_PROGBITS (0x1)
25 // CHECK-NEXT: Flags [ (0x2)
26 // CHECK-NEXT: SHF_ALLOC (0x2)
27 // CHECK-NEXT: ]
28 // CHECK-NEXT: Address: 0x1ED
29 // CHECK-NEXT: Offset: 0x1ED
30 // CHECK-NEXT: Size: 65036
32 // CHECK: Name: barr (45)
33 // CHECK-NEXT: Type: SHT_PROGBITS (0x1)
34 // CHECK-NEXT: Flags [ (0x2)
35 // CHECK-NEXT: SHF_ALLOC (0x2)
36 // CHECK-NEXT: ]
37 // CHECK-NEXT: Address: 0xFFFA
38 // CHECK-NEXT: Offset: 0xFFFA
39 // CHECK-NEXT: Size: 0
41 // CHECK: Name: foo (62)
42 // CHECK-NEXT: Type: SHT_PROGBITS (0x1)
43 // CHECK-NEXT: Flags [ (0x3)
44 // CHECK-NEXT: SHF_ALLOC (0x2)
45 // CHECK-NEXT: SHF_WRITE (0x1)
46 // CHECK-NEXT: ]
47 // CHECK-NEXT: Address: 0x10004
48 // CHECK-NEXT: Offset: 0x10004
49 // CHECK-NEXT: Size: 24
52 .data
53 .long 0
55 .section foo,"aw"
56 foof:
57 .quad foof
58 .quad bar-53
59 .quad bar
61 .section x,"a"
62 .zero 65036
64 .section barr,"a"
65 .p2align 1
66 bar: