47 lines · plain
1# REQUIRES: aarch642# RUN: split-file %s %t3 4# RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-linux %t/test.s -o %t.o5# RUN: ld.lld -shared --script %t/script %t.o -o %t.so6# RUN: ld.lld -pie --script %t/script %t.o -o %t.exe7# RUN: llvm-readobj -r %t.so | FileCheck --check-prefix=RELOCS-SHARED %s8# RUN: llvm-readobj -r %t.exe | FileCheck --check-prefix=RELOCS-PIE %s9# RUN: llvm-objdump --no-print-imm-hex --no-show-raw-insn -d %t.so | FileCheck --check-prefix=DISAS %s10 11## Check if the R_AARCH64_LD64_GOTPAGE_LO15 generates the GOT entries.12# RELOCS-SHARED: Relocations [13# RELOCS-SHARED-NEXT: Section (5) .rela.dyn {14# RELOCS-SHARED-NEXT: 0x{{[0-9A-F]+}} R_AARCH64_GLOB_DAT global1 0x{{[0-9A-F]+}}15# RELOCS-SHARED-NEXT: 0x{{[0-9A-F]+}} R_AARCH64_GLOB_DAT global2 0x{{[0-9A-F]+}}16# RELOCS-SHARED-NEXT: }17# RELOCS-SHARED-NEXT: ]18 19# RELOCS-PIE: Relocations [20# RELOCS-PIE-NEXT: Section (5) .rela.dyn {21# RELOCS-PIE-NEXT: 0x{{[0-9A-F]+}} R_AARCH64_RELATIVE - 0x{{[0-9A-F]+}}22# RELOCS-PIE-NEXT: 0x{{[0-9A-F]+}} R_AARCH64_RELATIVE - 0x{{[0-9A-F]+}}23# RELOCS-PIE-NEXT: }24# RELOCS-PIE-NEXT: ]25 26# DISAS: adrp x0, 0xf00027# DISAS-NEXT: ldr x0, [x0, #4088]28# DISAS-NEXT: ldr x1, [x0, #4096]29 30#--- script31SECTIONS {32 .got (0x10000 - 8) : { *.got }33}34 35#--- test.s36.globl _start37.type _start,@function38_start:39 adrp x0, _GLOBAL_OFFSET_TABLE_40 ldr x0, [x0, #:gotpage_lo15:global1]41 ldr x1, [x0, #:gotpage_lo15:global2]42 43.type global1,@object44.comm global1,8,845.type global2,@object46.comm global2,8,847