llvm-project/llvm/test/tools/llvm-objdump/symbol-table-elf.test

58 lines
1.7 KiB
Plaintext

# RUN: yaml2obj -D BITS=32 %s -o %t.32
# RUN: llvm-objdump --syms %t.32 > %t.32.txt
# RUN: llvm-objdump -t %t.32 | cmp - %t.32.txt
# RUN: FileCheck --check-prefix=ELF32 %s --input-file=%t.32.txt
# RUN: yaml2obj -D BITS=64 %s -o %t.64
# RUN: llvm-objdump --syms %t.64 | FileCheck --check-prefix=ELF64 %s
# ELF32: SYMBOL TABLE:
# ELF32-NEXT: 00001004 l F .text 00000000 lfoo
# ELF32-NEXT: 00001008 l O .text 00000000 lbar
# ELF32-NEXT: 00001004 g F .text 00000000 foo
# ELF32-NEXT: 00001008 g O .text 00000000 bar
# ELF64: SYMBOL TABLE:
# ELF64-NEXT: 0000000000001004 l F .text 0000000000000000 lfoo
# ELF64-NEXT: 0000000000001008 l O .text 0000000000000000 lbar
# ELF64-NEXT: 0000000000001004 g F .text 0000000000000000 foo
# ELF64-NEXT: 0000000000001008 g O .text 0000000000000000 bar
!ELF
FileHeader:
Class: ELFCLASS[[BITS]]
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Sections:
- Name: .bss
Type: SHT_NOBITS
Flags: [ SHF_ALLOC ]
AddressAlign: 0x0000000000000010
Size: 64
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
AddressAlign: 0x0000000000000010
Content: "00000000"
Symbols:
- Name: lfoo
Type: STT_FUNC
Section: .text
Value: 0x1004
- Name: lbar
Type: STT_OBJECT
Section: .text
Value: 0x1008
- Name: foo
Type: STT_FUNC
Section: .text
Value: 0x1004
Binding: STB_GLOBAL
- Name: bar
Type: STT_OBJECT
Section: .text
Value: 0x1008
Binding: STB_GLOBAL