3 # RUN: llvm-mc -filetype=obj -triple=powerpc64le %s -o %t.o
4 # RUN: ld.lld %t.o --defsym=foo=rel16+0x8000 -o %t
5 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
6 # RUN: llvm-readobj -r %t.o | FileCheck --check-prefix=REL %s
7 # RUN: llvm-readelf -S %t | FileCheck --check-prefix=SEC %s
8 # RUN: llvm-readelf -x .eh_frame %t | FileCheck --check-prefix=HEX %s
10 .section .R_PPC64_REL14,"ax",@progbits
11 # FIXME This does not produce a relocation
14 # CHECK-LABEL: Disassembly of section .R_PPC64_REL14:
15 # CHECK: bt 2, 0x10010198
17 .section .R_PPC64_REL16,"ax",@progbits
20 li 3, foo-rel16-
1@ha
# R_PPC64_REL16_HA
22 li 4, foo-rel16+
0x7fff@h
# R_PPC64_REL16_HI
23 li 4, foo-rel16+
0x8000@h
24 li 5, foo-rel16-
1@
l # R_PPC64_REL16_LO
26 # CHECK-LABEL: Disassembly of section .R_PPC64_REL16:
31 # CHECK-NEXT: li 5, 32767
32 # CHECK-NEXT: li 5, -32768
34 .section .R_PPC64_REL24,"ax",@progbits
36 # CHECK-LABEL: Disassembly of section .R_PPC64_REL24:
37 # CHECK: 100101b0: b 0x10010198
39 .section .REL32_AND_REL64,"ax",@progbits
41 .cfi_personality 148, rel64
46 # REL: .rela.eh_frame {
47 # REL-NEXT: 0x12 R_PPC64_REL64 .REL32_AND_REL64 0x4
48 # REL-NEXT: 0x28 R_PPC64_REL32 .REL32_AND_REL64 0x0
51 # SEC: .REL32_AND_REL64 PROGBITS 00000000100101b4
53 ## CIE Personality Address: 0x100101b4-(0x10000168+2)+4 = 0x1004e
54 ## FDE PC Begin: 0x100101b4-(0x10000178+8) = 0x10034
55 # HEX: section '.eh_frame':
56 # HEX-NEXT: 0x10000158
57 # HEX-NEXT: 0x10000168 {{....}}4e00 01000000 0000{{....}}
58 # HEX-NEXT: 0x10000178 {{[0-9a-f]+}} {{[0-9a-f]+}} 34000100