1 ## Show that references in disassembly are labelled with the correct symbol.
2 # RUN: yaml2obj %s --docnum=1 -o %t
3 # RUN: llvm-objdump --no-print-imm-hex %t -d | FileCheck %s --check-prefix=EXEC
6 # EXEC-NEXT: 4000: e8 00 00 00 00 callq 0x4005 <third>
8 # EXEC-NEXT: 4005: e8 12 34 56 78 callq 0x7856741c <data1+0x7856241c>
9 # EXEC-LABEL: <fourth>:
10 # EXEC-NEXT: 400a: 8b 05 f0 0f 00 00 movl 4080(%rip), %eax # 0x5000 <data1>
22 Flags: [SHF_ALLOC, SHF_EXECINSTR]
23 Content: 'e800000000' # Case 1: Referencing an address with a symbol.
26 Flags: [SHF_ALLOC, SHF_EXECINSTR]
28 Content: 'e812345678' # Case 2: Referencing an address without a symbol.
31 Flags: [SHF_ALLOC, SHF_EXECINSTR]
33 Content: '8b05f00f0000' # Case 3: Memory operands
36 Flags: [SHF_ALLOC, SHF_WRITE]
55 # RUN: yaml2obj %s --docnum=2 -o %t.o
56 # RUN: llvm-objdump --no-print-imm-hex %t.o -d | FileCheck %s --check-prefix=REL
58 # REL: Disassembly of section .text1:
60 # REL-NEXT: 0000000000000000 <.text1>:
61 # REL-NEXT: 0: e8 00 00 00 00 callq 0x5 <.text1+0x5>
63 # REL-NEXT: Disassembly of section .text2:
65 # REL-NEXT: 0000000000000000 <.text2>:
66 # REL-NEXT: 0: e8 00 00 00 00 callq 0x5 <sym2>
68 # REL-NEXT: Disassembly of section .text3:
70 # REL-NEXT: 0000000000000000 <.text3>:
71 # REL-NEXT: 0: e8 00 00 00 00 callq 0x5 <.text3+0x5>
82 Flags: [SHF_ALLOC, SHF_EXECINSTR]
83 Content: 'e800000000' # Case 1: Instruction is patched by a relocation.
93 Flags: [SHF_ALLOC, SHF_EXECINSTR]
94 Content: 'e800000000' # Case 2: Referencing an address with a matching symbol in that section.
97 Flags: [SHF_ALLOC, SHF_EXECINSTR]
98 Content: 'e800000000' # Case 3: Referencing an address without a matching symbol in that section.
102 # Shouldn't be picked, despite matching value, as not in right section.
106 # Symbol in correct section, with right value should be picked for disassembly of .text2.
110 # Symbol referenced by relocation could be picked for disassembly of .text1, but isn't.