2 # RUN: llvm-mc -filetype=obj -triple=hexagon-unknown-elf %s -o %t.o
3 # RUN: llvm-readobj -r %t.o | FileCheck -check-prefix=RELOC %s
4 # RUN: ld.lld %t.o -o %t
5 ## shared needs -z notext because of the R_HEX_IE_16/32_X(R_GOT) static
7 # RUN: ld.lld -z notext -shared %t.o -o %t.so
8 # RUN: llvm-objdump -d --no-show-raw-insn --print-imm-hex %t | FileCheck %s
9 # RUN: llvm-readobj -x .got %t | FileCheck -check-prefix=GOT %s
10 # RUN: llvm-objdump -d --no-show-raw-insn --print-imm-hex %t.so | \
11 # RUN: FileCheck -check-prefix=SHARED %s
12 # RUN: llvm-readobj -r %t.so | FileCheck -check-prefix=RELA %s
15 .type _start, @function
18 # RELOC: 0x0 R_HEX_IE_32_6_X a 0x0
19 # RELOC-NEXT: 0x4 R_HEX_IE_16_X a 0x0
20 # CHECK: { immext(#0x30180)
21 # CHECK-NEXT: r2 = memw(##0x301a4) }
24 # RELOC-NEXT: 0x8 R_HEX_IE_LO16 a 0x0
25 # CHECK: { r2.l = #0x1a4 }
27 # RELOC-NEXT: 0xC R_HEX_IE_HI16 a 0x0
28 # CHECK: { r2.h = #0x3 }
32 # GOT: Hex dump of section '.got':
33 # GOT-NEXT: 0x000301a4 f0ffffff f4ffffff f8ffffff fcffffff
39 # RELOC: 0x30 R_HEX_IE_GOT_32_6_X a 0x0
40 # RELOC-NEXT: 0x34 R_HEX_IE_GOT_16_X a 0x0
41 # SHARED: { immext(#0xfffeffc0)
42 # SHARED-NEXT: r2 = memw(##0xfffefff0) }
45 # RELOC-NEXT: 0x38 R_HEX_IE_GOT_LO16 a 0x0
46 # SHARED: { r2.l = #0xfff0 }
48 # RELOC-NEXT: 0x3C R_HEX_IE_GOT_HI16 a 0x0
49 # SHARED: { r2.h = #0xfffe }
52 # RELOC: 0x44 R_HEX_IE_GOT_11_X a 0x0
53 # SHARED: { immext(#0xfffeffc0)
54 # SHARED-NEXT: r0 = !cmp.eq(r1,##-0x10010) }
55 r0=!cmp.eq
(r1,##a@iegot)
57 # RELA: 0x203C4 R_HEX_TPREL_32 a 0x0
58 # RELA-NEXT: 0x203C8 R_HEX_TPREL_32 b 0x0
59 # RELA-NEXT: 0x203CC R_HEX_TPREL_32 c 0x0
60 # RELA-NEXT: 0x203D0 R_HEX_TPREL_32 d 0x0
66 .section .tdata,"awT",@progbits