diff options
| author | Shankar Easwaran <shankare@codeaurora.org> | 2015-02-21 04:28:26 +0000 |
|---|---|---|
| committer | Shankar Easwaran <shankare@codeaurora.org> | 2015-02-21 04:28:26 +0000 |
| commit | 6fbbe201766818c9c682637b931e5e4d50c25a07 (patch) | |
| tree | 1317d12fca6286233b2c559b2f8e6b1bb7ed59a7 /llvm/lib/Object | |
| parent | cf4bdde33a0450f212e7577b71a7bcfe5213cb15 (diff) | |
| download | bcm5719-llvm-6fbbe201766818c9c682637b931e5e4d50c25a07.tar.gz bcm5719-llvm-6fbbe201766818c9c682637b931e5e4d50c25a07.zip | |
[obj2yaml/yaml2obj] Add SHT_GROUP support.
This adds section group support to the tools obj2yaml and yaml2obj.
llvm-svn: 230124
Diffstat (limited to 'llvm/lib/Object')
| -rw-r--r-- | llvm/lib/Object/ELFYAML.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/llvm/lib/Object/ELFYAML.cpp b/llvm/lib/Object/ELFYAML.cpp index 7cfada893ad..cce05cf7124 100644 --- a/llvm/lib/Object/ELFYAML.cpp +++ b/llvm/lib/Object/ELFYAML.cpp @@ -506,6 +506,7 @@ static void commonSectionMapping(IO &IO, ELFYAML::Section &Section) { IO.mapOptional("Address", Section.Address, Hex64(0)); IO.mapOptional("Link", Section.Link, StringRef()); IO.mapOptional("AddressAlign", Section.AddressAlign, Hex64(0)); + IO.mapOptional("Info", Section.Info, StringRef()); } static void sectionMapping(IO &IO, ELFYAML::RawContentSection &Section) { @@ -516,10 +517,19 @@ static void sectionMapping(IO &IO, ELFYAML::RawContentSection &Section) { static void sectionMapping(IO &IO, ELFYAML::RelocationSection &Section) { commonSectionMapping(IO, Section); - IO.mapOptional("Info", Section.Info, StringRef()); IO.mapOptional("Relocations", Section.Relocations); } +static void groupSectionMapping(IO &IO, ELFYAML::Group &group) { + commonSectionMapping(IO, group); + IO.mapRequired("Members", group.Members); +} + +void MappingTraits<ELFYAML::SectionOrType>::mapping( + IO &IO, ELFYAML::SectionOrType §ionOrType) { + IO.mapRequired("SectionOrType", sectionOrType.sectionNameOrType); +} + void MappingTraits<std::unique_ptr<ELFYAML::Section>>::mapping( IO &IO, std::unique_ptr<ELFYAML::Section> &Section) { ELFYAML::ELF_SHT sectionType; @@ -535,6 +545,11 @@ void MappingTraits<std::unique_ptr<ELFYAML::Section>>::mapping( Section.reset(new ELFYAML::RelocationSection()); sectionMapping(IO, *cast<ELFYAML::RelocationSection>(Section.get())); break; + case ELF::SHT_GROUP: + if (!IO.outputting()) + Section.reset(new ELFYAML::Group()); + groupSectionMapping(IO, *cast<ELFYAML::Group>(Section.get())); + break; default: if (!IO.outputting()) Section.reset(new ELFYAML::RawContentSection()); |

