xref: /llvm-project/llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbol-labels-rel.test (revision 71e2ca6e32105b35aeadeab25010e8f999c47c23)
1## Show which labels are printed in disassembly of a relocatable object.
2
3# RUN: yaml2obj %s -o %t
4# RUN: llvm-objdump %t -d | FileCheck %s --implicit-check-not=stt_section \
5# RUN:                                   --implicit-check-not=first \
6# RUN:                                   --implicit-check-not=second \
7# RUN:                                   --implicit-check-not=third \
8# RUN:                                   --implicit-check-not=fourth \
9# RUN:                                   --implicit-check-not=absolute \
10# RUN:                                   --implicit-check-not=other
11
12# CHECK: {{.*}}: file format {{.*}}
13# CHECK: Disassembly of section .text:
14# CHECK: 0000000000000000 <first>:
15# CHECK: 0000000000000001 <second>:
16# CHECK: 0000000000000002 <third>:
17# CHECK: Disassembly of section .text2:
18# CHECK: 0000000000000004 <other>:
19
20--- !ELF
21FileHeader:
22  Class:   ELFCLASS64
23  Data:    ELFDATA2LSB
24  Type:    ET_REL
25  Machine: EM_X86_64
26Sections:
27  - Name:    .text
28    Type:    SHT_PROGBITS
29    Flags:   [SHF_ALLOC, SHF_EXECINSTR]
30    Content: '909090909090'
31  - Name:    .text2
32    Type:    SHT_PROGBITS
33    Flags:   [SHF_ALLOC, SHF_EXECINSTR]
34    Content: '9090909090'
35Symbols:
36  - Name:    first
37    Value:   0
38    Section: .text
39    Size:    2
40  - Name:    second # Shows, with first, that symbol sizes are not used to delineate functions.
41    Value:   1
42    Size:    1
43    Section: .text
44  - Name:    third # Shows, with fourth, that first symbol is picked.
45    Value:   2
46    Section: .text
47  - Name:    fourth
48    Value:   2
49    Section: .text
50  - Name:    stt_section # Shows that STT_SECTION symbols are ignored even if no other symbol present.
51    Value:   3
52    Type:    STT_SECTION
53    Section: .text
54  - Name:    absolute # Show that absolute symbols are ignored.
55    Value:   4
56    Index:   SHN_ABS
57  - Name:    other # Show that symbols in other sections are ignored.
58    Value:   4
59    Section: .text2
60