[ELF] Refine isExported/isPreemptible condition
[llvm-project.git] / lld / test / ELF / aarch64-fpic-got.s
blob8fb5e9d66513155b5207ba77faac97f95ebb3431
1 # REQUIRES: aarch64
3 # RUN: rm -rf %t && split-file %s %t && cd %t
5 # RUN: llvm-mc -filetype=obj -triple=aarch64 %p/Inputs/shared.s -o lib.o
6 # RUN: ld.lld -shared lib.o -soname lib.so -o lib.so
8 ## Checks if got access to dynamic objects is done through a got relative
9 ## dynamic relocation and not using plt relative (R_AARCH64_JUMP_SLOT).
10 # RELOC: .rela.dyn {
11 # RELOC-NEXT: 0x220318 R_AARCH64_GLOB_DAT bar 0x0
12 # RELOC-NEXT: }
14 #--- small.s
16 # RUN: llvm-mc -filetype=obj -triple=aarch64 small.s -o small.o
17 # RUN: ld.lld lib.so small.o -o small
18 # RUN: llvm-readobj -r small | FileCheck --check-prefix=RELOC %s
19 # RUN: llvm-objdump -d --no-show-raw-insn small | FileCheck --check-prefix=DIS-SMALL %s
21 ## page(0x220318) & 0xff8 = 0x318
22 # DIS-SMALL: <_start>:
23 # DIS-SMALL-NEXT: adrp x0, 0x220000
24 # DIS-SMALL-NEXT: ldr x0, [x0, #0x318]
26 .globl _start
27 _start:
28 adrp x0, :got:bar
29 ldr x0, [x0, :got_lo12:bar]
31 #--- tiny.s
33 # RUN: llvm-mc -filetype=obj -triple=aarch64 tiny.s -o tiny.o
34 # RUN: ld.lld lib.so tiny.o -o tiny
35 # RUN: llvm-readobj -r tiny | FileCheck --check-prefix=RELOC %s
36 # RUN: llvm-objdump -d --no-show-raw-insn tiny | FileCheck --check-prefix=DIS-TINY %s
38 # DIS-TINY: <_start>:
39 # DIS-TINY-NEXT: ldr x0, 0x220318
41 .globl _start
42 _start:
43 ldr x0, :got:bar