Files
llvm/test/tools/llvm-readobj/elf-invalid-versioning.test
T
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

43 lines
1.3 KiB
Plaintext

# RUN: yaml2obj %s -o %t
# RUN: llvm-readelf -V %t | FileCheck %s --check-prefix=INVALID
# INVALID: Version symbols section '.gnu.version' contains 2 entries:
# INVALID-NEXT: Addr: 0000000000200210 Offset: 0x000040 Link: 5 (.dynsym)
# INVALID-NEXT: 000: 0 (*local*) 3 (*invalid*)
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Entry: 0x0000000000201000
Sections:
- Name: .gnu.version
Type: SHT_GNU_versym
Flags: [ SHF_ALLOC ]
Address: 0x0000000000200210
Link: .dynsym
AddressAlign: 0x0000000000000002
EntSize: 0x0000000000000002
Entries: [ 0, 3 ]
- Name: .gnu.version_r
Type: SHT_GNU_verneed
Flags: [ SHF_ALLOC ]
Address: 0x0000000000200250
Link: .dynstr
AddressAlign: 0x0000000000000004
Info: 0x0000000000000001
Dependencies:
- Version: 1
File: somefile
Entries:
- Name: '' # invalid name
Hash: 1937
Flags: 233
Other: 3
DynamicSymbols:
- Name: f
Binding: STB_GLOBAL
...