diff options
| author | George Rimar <grimar@accesssoftek.com> | 2019-02-19 15:29:07 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2019-02-19 15:29:07 +0000 |
| commit | 646af08e2baf4db25f6d39db5754975e92aab612 (patch) | |
| tree | caf4c3c321eb2a51d613bb5ab07f2ddf2fbc329a /llvm/lib/ObjectYAML | |
| parent | 24fa0c18e66ca273b42862f3a472ebf6cc5931a5 (diff) | |
| download | bcm5719-llvm-646af08e2baf4db25f6d39db5754975e92aab612.tar.gz bcm5719-llvm-646af08e2baf4db25f6d39db5754975e92aab612.zip | |
[yaml2obj][obj2yaml] - Support SHT_GNU_versym (.gnu.version) section.
This patch adds support for parsing dumping the .gnu.version section.
Description of the section is: https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/symversion.html#SYMVERTBL
Differential revision: https://reviews.llvm.org/D58280
llvm-svn: 354338
Diffstat (limited to 'llvm/lib/ObjectYAML')
| -rw-r--r-- | llvm/lib/ObjectYAML/ELFYAML.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/ObjectYAML/ELFYAML.cpp b/llvm/lib/ObjectYAML/ELFYAML.cpp index bc07fae13d6..8460ad04cd0 100644 --- a/llvm/lib/ObjectYAML/ELFYAML.cpp +++ b/llvm/lib/ObjectYAML/ELFYAML.cpp @@ -872,6 +872,11 @@ static void sectionMapping(IO &IO, ELFYAML::NoBitsSection &Section) { IO.mapOptional("Size", Section.Size, Hex64(0)); } +static void sectionMapping(IO &IO, ELFYAML::SymverSection &Section) { + commonSectionMapping(IO, Section); + IO.mapRequired("Entries", Section.Entries); +} + static void sectionMapping(IO &IO, ELFYAML::VerneedSection &Section) { commonSectionMapping(IO, Section); IO.mapRequired("Info", Section.Info); @@ -955,6 +960,11 @@ void MappingTraits<std::unique_ptr<ELFYAML::Section>>::mapping( Section.reset(new ELFYAML::MipsABIFlags()); sectionMapping(IO, *cast<ELFYAML::MipsABIFlags>(Section.get())); break; + case ELF::SHT_GNU_versym: + if (!IO.outputting()) + Section.reset(new ELFYAML::SymverSection()); + sectionMapping(IO, *cast<ELFYAML::SymverSection>(Section.get())); + break; case ELF::SHT_GNU_verneed: if (!IO.outputting()) Section.reset(new ELFYAML::VerneedSection()); |

