Files
archived-llvm/test/Object/objdump-sectionheaders.test
George Rimar 38d4353156 [yaml2obj][obj2yaml] - Do not create a symbol table by default.
This patch tries to resolve problems faced in D68943
and uses some of the code written by Konrad Wilhelm Kleine
in that patch.

Previously, yaml2obj tool always created a .symtab section.
This patch changes that. With it we only create it when
have a "Symbols:" tag in the YAML document or when
we need to create it because it is used by another section(s).

obj2yaml follows the new behavior and does not print "Symbols:"
anymore when there is no symbol table.

Differential revision: https://reviews.llvm.org/D69041

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375361 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-20 14:47:17 +00:00

42 lines
1.3 KiB
Plaintext

# RUN: yaml2obj %s > %t.elf-x86-64
# RUN: llvm-objdump -h %t.elf-x86-64 | FileCheck %s
# To verify this, use readelf -S, not objdump -h. Binutils objdump filters the
# results in a way that we don't emulate.
# CHECK: Sections:
# CHECK: Idx Name Size VMA Type
# CHECK: 0 00000000 0000000000000000
# CHECK: 1 .text 00000026 0000000000000000 TEXT
# CHECK: 2 .rodata.str1.1 0000000d 0000000000000026 DATA
# CHECK: 3 .note.GNU-stack 00000000 0000000000000033
# CHECK: 4 .rela.text 00000000 0000000000000038
# CHECK: 5 .symtab 00000018 0000000000000000
# CHECK: 6 .strtab 00000001 0000000000000000
# CHECK: 7 .shstrtab 00000045 0000000000000000
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Size: 0x26
- Name: .rodata.str1.1
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_MERGE, SHF_STRINGS ]
Address: 0x0000000000000026
Size: 0xd
- Name: .note.GNU-stack
Type: SHT_PROGBITS
Address: 0x0000000000000033
- Name: .rela.text
Type: SHT_RELA
Address: 0x0000000000000038
Info: .text
Relocations: