2 # Check R_MIPS_32 relocation calculation.
4 # RUN: echo "SECTIONS { \
5 # RUN: . = 0x10000; .data ALIGN(0x1000) : { *(.data) } \
8 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t-be.o
9 # RUN: ld.lld -shared %t-be.o -script %t.script -o %t-be.so
10 # RUN: llvm-objdump -t -s %t-be.so | FileCheck --check-prefixes=SYM,BE %s
11 # RUN: llvm-readelf -r -s --dynamic-table -A %t-be.so \
12 # RUN: | FileCheck -check-prefix=REL %s
14 # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux %s -o %t-el.o
15 # RUN: ld.lld -shared %t-el.o -script %t.script -o %t-el.so
16 # RUN: llvm-objdump -t -s %t-el.so | FileCheck --check-prefixes=SYM,EL %s
17 # RUN: llvm-readelf --dynamic-table -r -s -A %t-el.so \
18 # RUN: | FileCheck -check-prefix=REL %s
23 .word v2+4 # R_MIPS_32 target v2 addend 4
25 .word v1 # R_MIPS_32 target v1 addend 0
28 # SYM: 00011000 l .data 00000000 v1
30 # BE: Contents of section .data:
31 # BE-NEXT: {{.*}} 00000004 00011000
34 # EL: Contents of section .data:
35 # EL-NEXT: {{.*}} 04000000 00100100
38 # REL: Dynamic section
43 # REL: Relocation section
44 # REL: {{.*}} R_MIPS_REL32 [[V2:[0-9a-f]+]]
45 # REL-NEXT: {{.*}} R_MIPS_REL32 {{$}}
48 # REL: {{.*}}: [[V2]] {{.*}} v2
51 # REL: {{.*}} -32744(gp) [[V2]] {{.*}} v2