aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Object
diff options
context:
space:
mode:
authorSean Silva <silvas@purdue.edu>2013-06-22 01:38:00 +0000
committerSean Silva <silvas@purdue.edu>2013-06-22 01:38:00 +0000
commit068463b714bd53fffd41322a5654b4f359c2166c (patch)
tree78bbe3b036bd29783bed1505bfaab0162b42611d /include/llvm/Object
parent681dafbb6c605b96b141accf428923076606ec9e (diff)
downloadexternal_llvm-068463b714bd53fffd41322a5654b4f359c2166c.zip
external_llvm-068463b714bd53fffd41322a5654b4f359c2166c.tar.gz
external_llvm-068463b714bd53fffd41322a5654b4f359c2166c.tar.bz2
[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
Diffstat (limited to 'include/llvm/Object')
-rw-r--r--include/llvm/Object/ELFYAML.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/llvm/Object/ELFYAML.h b/include/llvm/Object/ELFYAML.h
index b6c7556..fca965f 100644
--- a/include/llvm/Object/ELFYAML.h
+++ b/include/llvm/Object/ELFYAML.h
@@ -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