2 # Check handling of N32 ABI relocation records.
4 # RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \
5 # RUN: -target-abi n32 -o %t.o %s
6 # RUN: echo "SECTIONS { \
7 # RUN: . = 0x20000; .text ALIGN(0x100) : { *(.text) } \
9 # RUN: ld.lld %t.o -script %t.script -o %t.exe
10 # RUN: llvm-objdump -t -d -s --no-show-raw-insn %t.exe | FileCheck %s
11 # RUN: llvm-readelf -h %t.exe | FileCheck -check-prefix=ELF %s
15 .type __start, @function
18 lui $gp
,%hi
(%neg(%gp_rel
(__start
))) # R_MIPS_GPREL16
22 daddiu $gp
,$gp
,%lo
(%neg(%gp_rel
(__start
))) # R_MIPS_GPREL16
26 .section .rodata,"a",@progbits
27 .gpword(loc) # R_MIPS_GPREL32
29 # CHECK: 00020104 l .text 00000000 loc
30 # CHECK: 00028100 l .got 00000000 .hidden _gp
31 # CHECK: 00020100 g F .text 00000000 __start
33 # CHECK: Contents of section .rodata:
34 # CHECK-NEXT: {{[0-9a-f]+}} ffff8004
37 # CHECK: Disassembly of section .text:
39 # CHECK-NEXT: <__start>:
40 # CHECK-NEXT: 20100: lui $gp, 1
41 # ^-- 0x20100 - 0x28100
45 # CHECK-NEXT: 20104: daddiu $gp, $gp, -32768
46 # ^-- 0x20100 - 0x28100
51 # ELF: Data: 2's complement, big endian
52 # ELF: Version: 1 (current)
53 # ELF: OS/ABI: UNIX - System V
55 # ELF: Type: EXEC (Executable file)
56 # ELF: Machine: MIPS R3000
58 # ELF: Entry point address: 0x20100
59 # ELF: Flags: 0x60000026, pic, cpic, abi2, mips64