1 // RUN
: llvm-mc
-triple
=aarch64-none-linux-gnu
-filetype
=obj
%s
-o
-| llvm-objdump
-r
- | FileCheck
%s
3 // CHECK
: RELOCATION RECORDS FOR
[.text]
5 .file "/home/espindola/llvm/llvm/test/CodeGen/AArch64/basic-pic.ll"
8 .type get_globalvar,@function
9 get_globalvar
: // @get_globalvar
13 ldr x0
, [x0
, #:got_lo12:var]
17 .size get_globalvar, .Ltmp0-get_globalvar
20 // CHECK
: R_AARCH64_ADR_GOT_PAGE var
21 // CHECK
: R_AARCH64_LD64_GOT_LO12_NC var
23 .globl get_globalvaraddr
24 .type get_globalvaraddr,@function
25 get_globalvaraddr
: // @get_globalvaraddr
29 ldr x0
, [x0
, #:got_lo12:var]
32 .size get_globalvaraddr, .Ltmp1-get_globalvaraddr
34 // CHECK
: R_AARCH64_ADR_GOT_PAGE var
35 // CHECK
: R_AARCH64_LD64_GOT_LO12_NC var
38 .type get_hiddenvar,@function
39 get_hiddenvar
: // @get_hiddenvar
43 ldr w0
, [x0
, #:lo12:hiddenvar]
46 .size get_hiddenvar, .Ltmp2-get_hiddenvar
48 // CHECK
: R_AARCH64_ADR_PREL_PG_HI21 hiddenvar
49 // CHECK
: R_AARCH64_LDST32_ABS_LO12_NC hiddenvar
51 .globl get_hiddenvaraddr
52 .type get_hiddenvaraddr,@function
53 get_hiddenvaraddr
: // @get_hiddenvaraddr
57 add x0
, x0
, #:lo12:hiddenvar
60 .size get_hiddenvaraddr, .Ltmp3-get_hiddenvaraddr
62 // CHECK
: R_AARCH64_ADR_PREL_PG_HI21 hiddenvar
63 // CHECK
: R_AARCH64_ADD_ABS_LO12_NC hiddenvar
66 .type get_func,@function
67 get_func
: // @get_func
70 adrp x0
, :got
:get_func
71 ldr x0
, [x0
, #:got_lo12:get_func]
74 .size get_func, .Ltmp4-get_func
77 // Particularly important that the ADRP gets
a relocation
, LLVM tends to think
78 // it can relax it because it knows where get_func is. It can
't!
79 // CHECK: R_AARCH64_ADR_GOT_PAGE get_func
80 // CHECK: R_AARCH64_LD64_GOT_LO12_NC get_func
82 .type var,@object // @var
90 .hidden hiddenvar // @hiddenvar
91 .type hiddenvar,@object