• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// REQUIRES: arm, aarch64
2
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
6
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).
11
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
22
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
31
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
40
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
50
51
52.data
53.long 0
54
55.section foo,"aw"
56foof:
57.quad foof
58.quad bar-53
59.quad bar
60
61.section x,"a"
62.zero 65036
63
64.section barr,"a"
65.p2align 1
66bar:
67