2 # Check R_MIPS_GOT16 relocation calculation.
4 # RUN: echo "SECTIONS { \
5 # RUN: . = 0x20000; .text : { *(.text) } \
6 # RUN: . = 0x30000; .got : { *(.got) } \
9 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t-be.o
10 # RUN: ld.lld %t-be.o --script %t.script -o %t-be.exe
11 # RUN: llvm-readobj --sections -r --symbols -A %t-be.exe \
12 # RUN: | FileCheck -check-prefix=ELF %s
13 # RUN: llvm-objdump --no-print-imm-hex -d %t-be.exe | FileCheck --check-prefix=DIS %s
15 # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux %s -o %t-el.o
16 # RUN: ld.lld %t-el.o --script %t.script -o %t-el.exe
17 # RUN: llvm-readobj --sections -r --symbols -A %t-el.exe \
18 # RUN: | FileCheck -check-prefix=ELF %s
19 # RUN: llvm-objdump --no-print-imm-hex -d %t-el.exe | FileCheck --check-prefix=DIS %s
21 # RUN: ld.lld -shared %t-be.o --script %t.script -o %t-be.so
22 # RUN: llvm-readobj --sections -r --symbols -A %t-be.so \
23 # RUN: | FileCheck -check-prefix=ELF %s
24 # RUN: llvm-objdump --no-print-imm-hex -d %t-be.so | FileCheck --check-prefix=DIS %s
26 # RUN: ld.lld -shared %t-el.o --script %t.script -o %t-el.so
27 # RUN: llvm-readobj --sections -r --symbols -A %t-el.so \
28 # RUN: | FileCheck -check-prefix=ELF %s
29 # RUN: llvm-objdump --no-print-imm-hex -d %t-el.so | FileCheck --check-prefix=DIS %s
45 # ELF-NEXT: SHF_MIPS_GPREL
54 # ELF-NEXT: Value: 0x[[V1:[0-9A-F]+]]
57 # ELF-NEXT: Canonical gp value: 0x37FF0
60 # ELF: Address: 0x30008
61 # ELF-NEXT: Access: -32744
62 # ELF-NEXT: Initial: 0x[[V1]]
64 # "v1 GOT entry address" - _gp
65 # 0x30008 - 0x37FF0 = -0x7fe8 == 0x8018 == 32792