37 lines · plain
1# REQUIRES: aarch642 3# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t.o4# RUN: %lld -lSystem -arch arm64 -o %t %t.o5# RUN: llvm-objdump --macho -d --full-contents --section-headers %t | FileCheck %s6 7## FIXME: Even though we have reserved a GOT slot for _foo due to8## POINTER_TO_GOT, we should still be able to relax this GOT_LOAD reference to9## it.10# CHECK: _main:11# CHECK-NEXT: adrp x8, [[#]] ; 0x10000400012# CHECK-NEXT: ldr x8, [x8]13# CHECK-NEXT: ret14 15# CHECK: Idx Name Size VMA Type16# CHECK: [[#]] __got 00000008 0000000100004000 DATA17# CHECK: [[#]] __data 00000004 0000000100008000 DATA18 19## The relocated data should contain the difference between the addresses of20## __data and __got in little-endian form.21# CHECK: Contents of section __DATA,__data:22# CHECK-NEXT: 100008000 00c0ffff23 24.globl _main, _foo25.p2align 226_main:27 adrp x8, _foo@GOTPAGE28 ldr x8, [x8, _foo@GOTPAGEOFF]29 ret30 31.p2align 232_foo:33 ret34 35.data36.long _foo@GOT - .37