[yaml2obj][ELF] Make symbol table top-level key.

Although in reality the symbol table in ELF resides in a section, the
standard requires that there be no more than one SHT_SYMTAB. To enforce
this constraint, it is cleaner to group all the symbols under a
top-level `Symbols` key on the object file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184627 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sean Silva
2013-06-22 01:38:00 +00:00
parent 681dafbb6c
commit 068463b714
5 changed files with 40 additions and 43 deletions

View File

@@ -10,21 +10,19 @@ Sections:
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_WRITE ]
Content: "DEADBEEF"
- Name: .symtab
Type: SHT_SYMTAB
Symbols:
Local:
- Name: local_symbol
Type: STT_OBJECT
Section: .data
Global:
- Name: global_symbol
Type: STT_OBJECT
Section: .data
Weak:
- Name: weak_symbol
Type: STT_OBJECT
Section: .data
Symbols:
Local:
- Name: local_symbol
Type: STT_OBJECT
Section: .data
Global:
- Name: global_symbol
Type: STT_OBJECT
Section: .data
Weak:
- Name: weak_symbol
Type: STT_OBJECT
Section: .data
# CHECK: Symbol {
# CHECK: Name: (0)

View File

@@ -16,16 +16,14 @@ Sections:
# This YAML file is a valid relocatable object that,
# when linked and run on x86_64, will go into an
# infloop.
- Name: .symtab
Type: SHT_SYMTAB
Symbols:
Global:
- Name: main
Type: STT_FUNC
Section: .text
Value: 0x1
Size: 2
- Name: undefined_symbol
Symbols:
Global:
- Name: main
Type: STT_FUNC
Section: .text
Value: 0x1
Size: 2
- Name: undefined_symbol
# CHECK: Symbols [
# CHECK-NEXT: Symbol {