summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2019-02-19 14:53:48 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2019-02-19 14:53:48 +0000
commit0621b795878c1105f2aff097e6a217c700676540 (patch)
tree8bfac8ca07fbfea1ec471c897fc3aa72a7f1384a /llvm/include
parent6aae216109544a9d87b1332642632292595ca7a6 (diff)
downloadbcm5719-llvm-0621b795878c1105f2aff097e6a217c700676540.tar.gz
bcm5719-llvm-0621b795878c1105f2aff097e6a217c700676540.zip
Recommit r354328, r354329 "[obj2yaml][yaml2obj] - Add support of parsing/dumping of the .gnu.version_r section."
Fix: Replace assert(!IO.getContext() && "The IO context is initialized already"); with assert(IO.getContext() && "The IO context is not initialized"); (this was introduced in r354329, where I tried to quickfix the darwin BB and seems copypasted the assert from the wrong place). Original commit message: 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: 354335
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/ObjectYAML/ELFYAML.h35
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);
};
OpenPOWER on IntegriCloud