diff options
author | George Rimar <grimar@accesssoftek.com> | 2019-02-19 14:03:14 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2019-02-19 14:03:14 +0000 |
commit | c09f2cd0cbe4b356704de0f903880dd4e2e9c843 (patch) | |
tree | 2157a178233b443e47fc9327656476210e181f5c /llvm/include | |
parent | 95e29763d42833a99f8c813470947e7544a14db0 (diff) | |
download | bcm5719-llvm-c09f2cd0cbe4b356704de0f903880dd4e2e9c843.tar.gz bcm5719-llvm-c09f2cd0cbe4b356704de0f903880dd4e2e9c843.zip |
[obj2yaml][yaml2obj] - Add support of parsing/dumping of the .gnu.version_r section.
The section is described here:
https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/symverrqmts.html
Patch just teaches obj2yaml/yaml2obj to dump and parse such sections.
We did the finalization of string tables very late,
and I had to move the logic to make it a bit earlier.
That was needed in this patch since .gnu.version_r adds strings to .dynstr.
This might also be useful for implementing other special sections.
Everything else changed in this patch seems to be straightforward.
Differential revision: https://reviews.llvm.org/D58119
llvm-svn: 354328
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/ObjectYAML/ELFYAML.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/llvm/include/llvm/ObjectYAML/ELFYAML.h b/llvm/include/llvm/ObjectYAML/ELFYAML.h index e194e59a485..0e8206fc36e 100644 --- a/llvm/include/llvm/ObjectYAML/ELFYAML.h +++ b/llvm/include/llvm/ObjectYAML/ELFYAML.h @@ -121,6 +121,7 @@ struct Section { RawContent, Relocation, NoBits, + Verneed, MipsABIFlags }; SectionKind Kind; @@ -167,6 +168,30 @@ struct NoBitsSection : Section { } }; +struct VernauxEntry { + uint32_t Hash; + uint16_t Flags; + uint16_t Other; + StringRef Name; +}; + +struct VerneedEntry { + uint16_t Version; + StringRef File; + std::vector<VernauxEntry> AuxV; +}; + +struct VerneedSection : Section { + std::vector<VerneedEntry> VerneedV; + llvm::yaml::Hex64 Info; + + VerneedSection() : Section(SectionKind::Verneed) {} + + static bool classof(const Section *S) { + return S->Kind == SectionKind::Verneed; + } +}; + struct Group : Section { // Members of a group contain a flag and a list of section indices // that are part of the group. @@ -238,6 +263,8 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::DynamicEntry) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::ProgramHeader) LLVM_YAML_IS_SEQUENCE_VECTOR(std::unique_ptr<llvm::ELFYAML::Section>) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::Symbol) +LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::VernauxEntry) +LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::VerneedEntry) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::Relocation) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::SectionOrType) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::SectionName) @@ -381,6 +408,14 @@ template <> struct MappingTraits<ELFYAML::DynamicEntry> { static void mapping(IO &IO, ELFYAML::DynamicEntry &Rel); }; +template <> struct MappingTraits<ELFYAML::VerneedEntry> { + static void mapping(IO &IO, ELFYAML::VerneedEntry &E); +}; + +template <> struct MappingTraits<ELFYAML::VernauxEntry> { + static void mapping(IO &IO, ELFYAML::VernauxEntry &E); +}; + template <> struct MappingTraits<ELFYAML::Relocation> { static void mapping(IO &IO, ELFYAML::Relocation &Rel); }; |