1# REQUIRES: aarch64
2
3# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-none %s -o %t.o
4# RUN: ld.lld --hash-style=sysv -shared %t.o -o %t
5# RUN: llvm-objdump %t -d --no-show-raw-insn | FileCheck %s --check-prefix=DISASM
6# RUN: llvm-readelf %t --symbols | FileCheck %s --check-prefix=SYM
7
8# It would be much easier to understand/read this test if llvm-objdump would print
9# the immediates in hex.
10# IMM = hex(65540) = 0x10004
11# PC = 0x10000
12# As the relocation is PC-relative, IMM + PC = 0x20004 which is the VA of the
13# correct symbol.
14
15# DISASM: Disassembly of section .text:
16# DISASM-EMPTY:
17# DISASM-NEXT: <$x.0>:
18# DISASM-NEXT:   1022c:       ldr     x8, 0x30294
19
20# SYM: Symbol table '.symtab'
21# SYM:  0000000000030294     0 NOTYPE  LOCAL  DEFAULT    6 patatino
22
23  ldr x8, patatino
24  .data
25  .zero 4
26patatino:
27