[gn] port afa8aeeeec (RISCVGenExegesis.inc)
[llvm-project.git] / lld / test / ELF / linkerscript / non-absolute.s
blob61d030ca5d0e3356d2ca06bce04d4a9dda42c0e5
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t1.o
3 # RUN: echo "SECTIONS { A = . - 0x10; B = A + 0x1; }" > %t.script
4 # RUN: ld.lld -shared %t1.o --script %t.script -o %t
5 # RUN: llvm-objdump --no-print-imm-hex -d %t | FileCheck %s --check-prefix=DUMP
6 # RUN: llvm-readobj --symbols %t | FileCheck %s --check-prefix=SYMBOL
8 # B = A + 0x1 = -0x10 + 0x1 = -0xf -> 0xFFFFFFFFFFFFFFF1
9 # B - (0x94+6) = -0xf - (0x94+6) = -169
10 # DUMP: Disassembly of section .text:
11 # DUMP-EMPTY:
12 # DUMP-NEXT: <foo>:
13 # DUMP-NEXT: 94: {{.*}} -169(%rip), %eax
15 # SYMBOL: Symbol {
16 # SYMBOL: Name: B
17 # SYMBOL-NEXT: Value: 0xFFFFFFFFFFFFFFF1
18 # SYMBOL-NEXT: Size: 0
19 # SYMBOL-NEXT: Binding: Local
20 # SYMBOL-NEXT: Type: None
21 # SYMBOL-NEXT: Other [
22 # SYMBOL-NEXT: STV_HIDDEN
23 # SYMBOL-NEXT: ]
24 # SYMBOL-NEXT: Section: .dynsym
25 # SYMBOL-NEXT: }
27 .text
28 .globl foo
29 .type foo, @function
30 foo:
31 movl B(%rip), %eax
33 .hidden B