mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
c21ea7e2f4
Linkers (ld.bfd/gold/lld) place the section header table at the very end. This allows tools to strip it, which is optional in executable/shared objects. In addition, if we add or section, the size of the section header table will change. Placing the section header table in the end keeps section offsets unchanged. yaml2obj currently places the section header table immediately after the program header. Follow what linkers do to make offset updating easier. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D67221 llvm-svn: 371074
43 lines
1.3 KiB
Plaintext
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: 6 (.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
|
|
...
|