summaryrefslogtreecommitdiff
path: root/tools/llvm-readobj
diff options
context:
space:
mode:
authorAlexander Shaposhnikov <shal1t712@gmail.com>2018-03-12 22:40:09 +0000
committerAlexander Shaposhnikov <shal1t712@gmail.com>2018-03-12 22:40:09 +0000
commit304352277fd008e8d749173f6d00d44f7f4326bb (patch)
tree0357256f2e254f3cb0ca555ae1fe7bab4b9b37e0 /tools/llvm-readobj
parent7b396b7a54b8b8082ac3376960f052751d955b55 (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327341 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-readobj')
-rw-r--r--tools/llvm-readobj/ELFDumper.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/llvm-readobj/ELFDumper.cpp b/tools/llvm-readobj/ELFDumper.cpp
index 65533f69804..81b1bd04e12 100644
--- a/tools/llvm-readobj/ELFDumper.cpp
+++ b/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";