1 ## Show that references in disassembly are labelled with the correct symbol.
2 # RUN: yaml2obj %s --docnum=1 -o %t
3 # RUN: llvm-objdump %t -d | FileCheck %s --check-prefix=EXEC
5 # EXEC: Disassembly of section .text1:
6 # EXEC: 4000: e8 00 00 00 00 callq 0 <third>
7 # EXEC: Disassembly of section .text2:
8 # EXEC: 4005: e8 12 34 56 78 callq 2018915346 <fourth+0x78563412>
20 Flags: [SHF_ALLOC, SHF_EXECINSTR]
21 Content: 'e800000000' # Case 1: Referencing an address with a symbol.
24 Flags: [SHF_ALLOC, SHF_EXECINSTR]
26 Content: 'e812345678' # Case 2: Referencing an address without a symbol.
29 Flags: [SHF_ALLOC, SHF_EXECINSTR]
45 # RUN: yaml2obj %s --docnum=2 -o %t.o
46 # RUN: llvm-objdump %t.o -d | FileCheck %s --check-prefix=REL
48 # REL: Disassembly of section .text1:
50 # REL-NEXT: 0000000000000000 .text1:
51 # REL-NEXT: 0: e8 00 00 00 00 callq 0 <.text1+0x5>
53 # REL-NEXT: Disassembly of section .text2:
55 # REL-NEXT: 0000000000000000 .text2:
56 # REL-NEXT: 0: e8 00 00 00 00 callq 0 <sym2>
58 # REL-NEXT: Disassembly of section .text3:
60 # REL-NEXT: 0000000000000000 .text3:
61 # REL-NEXT: 0: e8 00 00 00 00 callq 0 <.text3+0x5>
72 Flags: [SHF_ALLOC, SHF_EXECINSTR]
73 Content: 'e800000000' # Case 1: Instruction is patched by a relocation.
83 Flags: [SHF_ALLOC, SHF_EXECINSTR]
84 Content: 'e800000000' # Case 2: Referencing an address with a matching symbol in that section.
87 Flags: [SHF_ALLOC, SHF_EXECINSTR]
88 Content: 'e800000000' # Case 3: Referencing an address without a matching symbol in that section.
92 # Shouldn't be picked, despite matching value, as not in right section.
96 # Symbol in correct section, with right value should be picked for disassembly of .text2.
100 # Symbol referenced by relocation could be picked for disassembly of .text1, but isn't.