File: objdump-symbol-table.test

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (86 lines) | stat: -rw-r--r-- 3,321 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# RUN: yaml2obj %p/Inputs/COFF/i386.yaml | llvm-objdump -t - \
# RUN:              | FileCheck %s -check-prefix COFF-i386

# COFF-i386: file format
# COFF-i386: SYMBOL TABLE:
# COFF-i386: [  0](sec  1)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .text
# COFF-i386: AUX scnlen 0x24 nreloc 3 nlnno 0 checksum 0x0 assoc 1 comdat 0
# COFF-i386: [  2](sec  2)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .data
# COFF-i386: AUX scnlen 0xd nreloc 0 nlnno 0 checksum 0x0 assoc 2 comdat 0
# COFF-i386: [  4](sec  1)(fl 0x00)(ty  20)(scl   2) (nx 0) 0x00000000 _main
# COFF-i386: [  5](sec  2)(fl 0x00)(ty   0)(scl   3) (nx 0) 0x00000000 L_.str
# COFF-i386: [  6](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 _puts
# COFF-i386: [  7](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 _SomeOtherFunction

# RUN: yaml2obj %s -o %t.elf-i386
# RUN: llvm-objdump -t %t.elf-i386 | FileCheck %s --check-prefix=ELF-i386

# ELF-i386: {{.*}}elf-i386:     file format
# ELF-i386: SYMBOL TABLE:
# ELF-i386: 00000000 l    df *ABS*  00000000 trivial-object-test.s
# ELF-i386: 00000000 l    d  .text  00000000 .text
# ELF-i386: 00000024 l    d  .rodata.str1.1 00000000 .rodata.str1.1
# ELF-i386: 00000031 l    d  .note.GNU-stack        00000000 .note.GNU-stack
# ELF-i386: 00000000 g     F .text  00000024 main
# ELF-i386: 00000000         *UND*  00000000 SomeOtherFunction
# ELF-i386: 00000000         *UND*  00000000 puts

--- !ELF
FileHeader:
  Class:   ELFCLASS32
  Data:    ELFDATA2LSB
  Type:    ET_REL
  Machine: EM_386
Sections:
  - Name:    .text
    Type:    SHT_PROGBITS
    Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
  - Name:    .rodata.str1.1
    Type:    SHT_PROGBITS
    Flags:   [ SHF_ALLOC, SHF_MERGE, SHF_STRINGS ]
    Address: 0x0000000000000024
  - Name:    .note.GNU-stack
    Type:    SHT_PROGBITS
    Address: 0x0000000000000031
Symbols:
  - Name:    trivial-object-test.s
    Type:    STT_FILE
    Index:   SHN_ABS
  - Name:    .text
    Type:    STT_SECTION
    Section: .text
  - Name:    .rodata.str1.1
    Type:    STT_SECTION
    Section: .rodata.str1.1
  - Name:    .note.GNU-stack
    Type:    STT_SECTION
    Section: .note.GNU-stack
  - Name:    main
    Type:    STT_FUNC
    Section: .text
    Binding: STB_GLOBAL
    Size:    0x0000000000000024
  - Name:    SomeOtherFunction
    Binding: STB_GLOBAL
  - Name:    puts
    Binding: STB_GLOBAL

# RUN: llvm-objdump -t %p/Inputs/trivial-object-test.macho-i386 \
# RUN:              | FileCheck %s -check-prefix macho-i386

# macho-i386: trivial-object-test.macho-i386:        file format mach-o 32-bit i386
# macho-i386: SYMBOL TABLE:
# macho-i386: 00000000 g     F __TEXT,__text  _main
# macho-i386: 00000000         *UND*          _SomeOtherFunction
# macho-i386: 00000000         *UND*          _puts

# RUN: llvm-objdump -t %p/Inputs/shared-object-test.elf-i386 \
# RUN:              | FileCheck %s -check-prefix ELF-shared

# ELF-shared: shared-object-test.elf-i386:     file format
# ELF-shared: SYMBOL TABLE:
# ELF-shared: 00000200 l     F .text 00000003 local_func
# ELF-shared: 000012b8 l     O *ABS*           00000000 .hidden _GLOBAL_OFFSET_TABLE_
# ELF-shared: 00001248 l     O *ABS*           00000000 .hidden _DYNAMIC
# ELF-shared: 000012c4 g     O .data           00000004 defined_sym
# ELF-shared: 000001f0 g     F .text 00000003 global_func