diff options
author | Alexander Shaposhnikov <shal1t712@gmail.com> | 2018-03-12 22:40:09 +0000 |
---|---|---|
committer | Alexander Shaposhnikov <shal1t712@gmail.com> | 2018-03-12 22:40:09 +0000 |
commit | 8febe3dcf4e8b5be5e1c1401b5a38375ce7aecf0 (patch) | |
tree | 8d399eef287a5d40b6a8f9a0b9784d8cd1f5b6da /llvm/tools/llvm-readobj | |
parent | 4ecdb44a64c7aab7f46d522fbeaadb5912efb271 (diff) | |
download | bcm5719-llvm-8febe3dcf4e8b5be5e1c1401b5a38375ce7aecf0.tar.gz bcm5719-llvm-8febe3dcf4e8b5be5e1c1401b5a38375ce7aecf0.zip |
[llvm-readobj] Extend the output of -elf-section-groups
This diff extends the output of -elf-section-groups
(llvm style, gnu style is unchanged since it's meant to be
compatible with binutils readelf) with sh_link and sh_info.
This change will enable us to use llvm-readobj -elf-section-groups
for testing llvm-objcopy's support for .group sections.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D44280
llvm-svn: 327341
Diffstat (limited to 'llvm/tools/llvm-readobj')
-rw-r--r-- | llvm/tools/llvm-readobj/ELFDumper.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp index 65533f69804..81b1bd04e12 100644 --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -2482,6 +2482,8 @@ struct GroupSection { StringRef Signature; uint64_t ShName; uint64_t Index; + uint32_t Link; + uint32_t Info; uint32_t Type; std::vector<GroupMember> Members; }; @@ -2508,7 +2510,14 @@ std::vector<GroupSection> getGroups(const ELFFile<ELFT> *Obj) { StringRef Name = unwrapOrError(Obj->getSectionName(&Sec)); StringRef Signature = StrTable.data() + Sym->st_name; - Ret.push_back({Name, Signature, Sec.sh_name, I - 1, Data[0], {}}); + Ret.push_back({Name, + Signature, + Sec.sh_name, + I - 1, + Sec.sh_link, + Sec.sh_info, + Data[0], + {}}); std::vector<GroupMember> &GM = Ret.back().Members; for (uint32_t Ndx : Data.slice(1)) { @@ -3780,6 +3789,8 @@ void LLVMStyle<ELFT>::printGroupSections(const ELFO *Obj) { DictScope D(W, "Group"); W.printNumber("Name", G.Name, G.ShName); W.printNumber("Index", G.Index); + W.printNumber("Link", G.Link); + W.printNumber("Info", G.Info); W.printHex("Type", getGroupType(G.Type), G.Type); W.startLine() << "Signature: " << G.Signature << "\n"; |