3 # RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux %s -o %t.o
4 # RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux %p/Inputs/shared.s -o %t-lib.o
5 # RUN: ld.lld -shared %t-lib.o -soname t-lib.so -o %t-lib.so
7 # RUN: ld.lld %t-lib.so %t.o -o %t.exe
8 # RUN: llvm-readobj -r %t.exe | FileCheck --check-prefix=RELOC %s
9 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.exe | FileCheck --check-prefix=DIS %s
11 ## Checks if got access to dynamic objects is done through a got relative
12 ## dynamic relocation and not using plt relative (R_AARCH64_JUMP_SLOT).
14 # RELOC-NEXT: 0x220320 R_AARCH64_GLOB_DAT bar 0x0
17 ## page(0x220320) - page(0x210000) = 65536
18 ## page(0x220320) & 0xff8 = 800
20 # DIS-NEXT: 210258: adrp x0, 0x220000
21 # DIS-NEXT: 21025c: ldr x0, [x0, #800]
26 ldr x0
, [x0
, :got_lo12
:bar
]