diff options
author | Sean Silva <silvas@purdue.edu> | 2013-06-18 23:14:03 +0000 |
---|---|---|
committer | Sean Silva <silvas@purdue.edu> | 2013-06-18 23:14:03 +0000 |
commit | afcf60fe15999ea07193118f447a34f41171e433 (patch) | |
tree | 50990c3d24b6d6181abb247883b52fcfb8bcd273 /lib/Object | |
parent | bd4bd3686d5e623514cc7564227a6fa45254c610 (diff) | |
download | external_llvm-afcf60fe15999ea07193118f447a34f41171e433.zip external_llvm-afcf60fe15999ea07193118f447a34f41171e433.tar.gz external_llvm-afcf60fe15999ea07193118f447a34f41171e433.tar.bz2 |
[yaml2obj][ELF] Rudimentary symbol table support.
Currently, we only output the name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184255 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object')
-rw-r--r-- | lib/Object/ELFYAML.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Object/ELFYAML.cpp b/lib/Object/ELFYAML.cpp index e0e95be..32a759d 100644 --- a/lib/Object/ELFYAML.cpp +++ b/lib/Object/ELFYAML.cpp @@ -260,6 +260,10 @@ void MappingTraits<ELFYAML::FileHeader>::mapping(IO &IO, IO.mapOptional("Entry", FileHdr.Entry, Hex64(0)); } +void MappingTraits<ELFYAML::Symbol>::mapping(IO &IO, ELFYAML::Symbol &Symbol) { + IO.mapOptional("Name", Symbol.Name, StringRef()); +} + void MappingTraits<ELFYAML::Section>::mapping(IO &IO, ELFYAML::Section &Section) { IO.mapOptional("Name", Section.Name, StringRef()); @@ -269,6 +273,12 @@ void MappingTraits<ELFYAML::Section>::mapping(IO &IO, IO.mapOptional("Content", Section.Content); IO.mapOptional("Link", Section.Link); IO.mapOptional("AddressAlign", Section.AddressAlign, Hex64(0)); + // TODO: Error if `Type` is SHT_SYMTAB and this is not present, or if + // `Type` is *not* SHT_SYMTAB and this *is* present. (By SHT_SYMTAB I + // also mean SHT_DYNSYM, but for simplicity right now we just do + // SHT_SYMTAB). Want to be able to share the predicate with consumers of + // this structure. + IO.mapOptional("Symbols", Section.Symbols); } void MappingTraits<ELFYAML::Object>::mapping(IO &IO, ELFYAML::Object &Object) { |