[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

@@ -72,12 +72,15 @@ struct Section {
object::yaml::BinaryRef Content;
StringRef Link;
llvm::yaml::Hex64 AddressAlign;
// For SHT_SYMTAB; should be empty otherwise.
LocalGlobalWeakSymbols Symbols;
};
struct Object {
FileHeader Header;
std::vector<Section> Sections;
// Although in reality the symbols reside in a section, it is a lot
// cleaner and nicer if we read them from the YAML as a separate
// top-level key, which automatically ensures that invariants like there
// being a single SHT_SYMTAB section are upheld.
LocalGlobalWeakSymbols Symbols;
};
} // end namespace ELFYAML