diff options
author | Sean Silva <silvas@purdue.edu> | 2013-06-19 00:11:59 +0000 |
---|---|---|
committer | Sean Silva <silvas@purdue.edu> | 2013-06-19 00:11:59 +0000 |
commit | 5ba1225fb074f8035668637292d994d4c39757d1 (patch) | |
tree | 6e80c771ce271284279776d09b8a5ec22a119dce /lib/Object | |
parent | 70a3dc1bc2b16748a8a79d1d11d2b1603c38c032 (diff) | |
download | external_llvm-5ba1225fb074f8035668637292d994d4c39757d1.zip external_llvm-5ba1225fb074f8035668637292d994d4c39757d1.tar.gz external_llvm-5ba1225fb074f8035668637292d994d4c39757d1.tar.bz2 |
[yaml2obj][ELF] Support st_info through `Binding` and `Type` YAML keys.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184263 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object')
-rw-r--r-- | lib/Object/ELFYAML.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/Object/ELFYAML.cpp b/lib/Object/ELFYAML.cpp index 32a759d..9c7bf2a 100644 --- a/lib/Object/ELFYAML.cpp +++ b/lib/Object/ELFYAML.cpp @@ -251,6 +251,29 @@ void ScalarBitSetTraits<ELFYAML::ELF_SHF>::bitset(IO &IO, #undef BCase } +void ScalarEnumerationTraits<ELFYAML::ELF_STB>::enumeration( + IO &IO, ELFYAML::ELF_STB &Value) { +#define ECase(X) IO.enumCase(Value, #X, ELF::X); + ECase(STB_LOCAL) + ECase(STB_GLOBAL) + ECase(STB_WEAK) +#undef ECase +} + +void ScalarEnumerationTraits<ELFYAML::ELF_STT>::enumeration( + IO &IO, ELFYAML::ELF_STT &Value) { +#define ECase(X) IO.enumCase(Value, #X, ELF::X); + ECase(STT_NOTYPE) + ECase(STT_OBJECT) + ECase(STT_FUNC) + ECase(STT_SECTION) + ECase(STT_FILE) + ECase(STT_COMMON) + ECase(STT_TLS) + ECase(STT_GNU_IFUNC) +#undef ECase +} + void MappingTraits<ELFYAML::FileHeader>::mapping(IO &IO, ELFYAML::FileHeader &FileHdr) { IO.mapRequired("Class", FileHdr.Class); @@ -262,6 +285,8 @@ void MappingTraits<ELFYAML::FileHeader>::mapping(IO &IO, void MappingTraits<ELFYAML::Symbol>::mapping(IO &IO, ELFYAML::Symbol &Symbol) { IO.mapOptional("Name", Symbol.Name, StringRef()); + IO.mapOptional("Binding", Symbol.Binding, ELFYAML::ELF_STB(0)); + IO.mapOptional("Type", Symbol.Type, ELFYAML::ELF_STT(0)); } void MappingTraits<ELFYAML::Section>::mapping(IO &IO, |