2 ## Prior to Android V, there was a bug that caused RELR relocations to be
3 ## applied after packed relocations. This meant that resolvers referenced by
4 ## IRELATIVE relocations in the packed relocation section would read unrelocated
5 ## globals when --pack-relative-relocs=android+relr is enabled. Work around this
6 ## by placing IRELATIVE in .rela.plt.
8 # RUN: rm -rf %t && split-file %s %t && cd %t
9 # RUN: llvm-mc -filetype=obj -triple=aarch64-linux-android a.s -o a.o
10 # RUN: llvm-mc -filetype=obj -triple=aarch64-linux-android b.s -o b.o
11 # RUN: ld.lld -shared b.o -o b.so
12 # RUN: ld.lld -pie --pack-dyn-relocs=android+relr -z separate-loadable-segments a.o b.so -o a
13 # RUN: llvm-readobj -r a | FileCheck %s
14 # RUN: llvm-objdump -d a | FileCheck %s --check-prefix=ASM
17 # CHECK-NEXT: 0x30000 R_AARCH64_RELATIVE -
20 # CHECK-NEXT: 0x30020 R_AARCH64_JUMP_SLOT bar 0x0
21 # CHECK-NEXT: 0x30028 R_AARCH64_IRELATIVE - 0x10000
25 # ASM-NEXT: adrp x16, 0x30000
26 # ASM-NEXT: ldr x17, [x16, #0x28]
27 # ASM-NEXT: add x16, x16, #0x28
32 .type foo, %gnu_indirect_function