summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ObjectYAML
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2019-02-21 12:21:43 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2019-02-21 12:21:43 +0000
commit623ae72ad46d378d6a2e40abf67d3c5e627bef7c (patch)
tree4baa8da9fe68fe64a574bc6f6c3d4f0e702c40ed /llvm/lib/ObjectYAML
parentb173d75c49afdc9a41507a2018d71476a9c0d198 (diff)
downloadbcm5719-llvm-623ae72ad46d378d6a2e40abf67d3c5e627bef7c.tar.gz
bcm5719-llvm-623ae72ad46d378d6a2e40abf67d3c5e627bef7c.zip
[yaml2obj][obj2yaml] - Support SHT_GNU_verdef (.gnu.version_d) 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/symverdefs.html Differential revision: https://reviews.llvm.org/D58437 llvm-svn: 354574
Diffstat (limited to 'llvm/lib/ObjectYAML')
-rw-r--r--llvm/lib/ObjectYAML/ELFYAML.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/lib/ObjectYAML/ELFYAML.cpp b/llvm/lib/ObjectYAML/ELFYAML.cpp
index 3eac787a728..e51454cb759 100644
--- a/llvm/lib/ObjectYAML/ELFYAML.cpp
+++ b/llvm/lib/ObjectYAML/ELFYAML.cpp
@@ -868,6 +868,12 @@ static void sectionMapping(IO &IO, ELFYAML::NoBitsSection &Section) {
IO.mapOptional("Size", Section.Size, Hex64(0));
}
+static void sectionMapping(IO &IO, ELFYAML::VerdefSection &Section) {
+ commonSectionMapping(IO, Section);
+ IO.mapRequired("Info", Section.Info);
+ IO.mapRequired("Entries", Section.Entries);
+}
+
static void sectionMapping(IO &IO, ELFYAML::SymverSection &Section) {
commonSectionMapping(IO, Section);
IO.mapRequired("Entries", Section.Entries);
@@ -956,6 +962,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_verdef:
+ if (!IO.outputting())
+ Section.reset(new ELFYAML::VerdefSection());
+ sectionMapping(IO, *cast<ELFYAML::VerdefSection>(Section.get()));
+ break;
case ELF::SHT_GNU_versym:
if (!IO.outputting())
Section.reset(new ELFYAML::SymverSection());
@@ -1014,6 +1025,17 @@ void MappingTraits<ELFYAML::DynamicEntry>::mapping(IO &IO,
IO.mapRequired("Value", Rel.Val);
}
+void MappingTraits<ELFYAML::VerdefEntry>::mapping(IO &IO,
+ ELFYAML::VerdefEntry &E) {
+ assert(IO.getContext() && "The IO context is not initialized");
+
+ IO.mapRequired("Version", E.Version);
+ IO.mapRequired("Flags", E.Flags);
+ IO.mapRequired("VersionNdx", E.VersionNdx);
+ IO.mapRequired("Hash", E.Hash);
+ IO.mapRequired("Names", E.VerNames);
+}
+
void MappingTraits<ELFYAML::VerneedEntry>::mapping(IO &IO,
ELFYAML::VerneedEntry &E) {
assert(IO.getContext() && "The IO context is not initialized");
OpenPOWER on IntegriCloud