2017-09-21 07:49:50 +08:00
|
|
|
# REQUIRES: aarch64
|
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-none %s -o %t.o
|
2017-10-06 17:37:44 +08:00
|
|
|
# RUN: ld.lld --hash-style=sysv -shared %t.o -o %t
|
2019-08-20 16:34:56 +08:00
|
|
|
# RUN: llvm-objdump %t -d --no-show-raw-insn | FileCheck %s --check-prefix=DISASM
|
2018-11-07 03:34:22 +08:00
|
|
|
# RUN: llvm-readelf %t --symbols | FileCheck %s --check-prefix=SYM
|
2017-09-21 07:49:50 +08:00
|
|
|
|
|
|
|
# It would be much easier to understand/read this test if llvm-objdump would print
|
|
|
|
# the immediates in hex.
|
|
|
|
# IMM = hex(65540) = 0x10004
|
|
|
|
# PC = 0x10000
|
|
|
|
# As the relocation is PC-relative, IMM + PC = 0x20004 which is the VA of the
|
|
|
|
# correct symbol.
|
|
|
|
|
|
|
|
# DISASM: Disassembly of section .text:
|
2019-05-01 18:40:48 +08:00
|
|
|
# DISASM-EMPTY:
|
2017-09-21 07:49:50 +08:00
|
|
|
# DISASM-NEXT: $x.0:
|
2019-08-20 16:34:56 +08:00
|
|
|
# DISASM-NEXT: 1022c: ldr x8, #131176
|
2017-09-21 07:49:50 +08:00
|
|
|
|
|
|
|
# SYM: Symbol table '.symtab'
|
2019-08-20 16:34:56 +08:00
|
|
|
# SYM: 0000000000030294 0 NOTYPE LOCAL DEFAULT 6 patatino
|
2017-09-21 07:49:50 +08:00
|
|
|
|
|
|
|
ldr x8, patatino
|
|
|
|
.data
|
|
|
|
.zero 4
|
|
|
|
patatino:
|