[PATCH] D44280: [llvm-readobj] Extend the output of -elf-section-groups with the field Link
Alexander Shaposhnikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 9 12:08:42 PST 2018
alexshap updated this revision to Diff 137812.
alexshap added a comment.
Add sh_info as well.
Repository:
rL LLVM
https://reviews.llvm.org/D44280
Files:
test/tools/llvm-readobj/broken-group.test
test/tools/llvm-readobj/elf-groups.test
tools/llvm-readobj/ELFDumper.cpp
Index: tools/llvm-readobj/ELFDumper.cpp
===================================================================
--- tools/llvm-readobj/ELFDumper.cpp
+++ tools/llvm-readobj/ELFDumper.cpp
@@ -2481,6 +2481,8 @@
StringRef Signature;
uint64_t ShName;
uint64_t Index;
+ uint32_t Link;
+ uint32_t Info;
uint32_t Type;
std::vector<GroupMember> Members;
};
@@ -2507,7 +2509,14 @@
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)) {
@@ -3784,6 +3793,8 @@
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";
Index: test/tools/llvm-readobj/elf-groups.test
===================================================================
--- test/tools/llvm-readobj/elf-groups.test
+++ test/tools/llvm-readobj/elf-groups.test
@@ -21,6 +21,8 @@
CHECK-NEXT: Group {
CHECK-NEXT: Name: .group (92)
CHECK-NEXT: Index: 1
+CHECK-NEXT: Link: 23
+CHECK-NEXT: Info: 17
CHECK-NEXT: Type: COMDAT (0x1)
CHECK-NEXT: Signature: _Z3fooIcEvT_
CHECK-NEXT: Section(s) in group [
@@ -31,6 +33,8 @@
CHECK-NEXT: Group {
CHECK-NEXT: Name: .group (92)
CHECK-NEXT: Index: 2
+CHECK-NEXT: Link: 23
+CHECK-NEXT: Info: 18
CHECK-NEXT: Type: COMDAT (0x1)
CHECK-NEXT: Signature: _Z3fooIiEvT_
CHECK-NEXT: Section(s) in group [
Index: test/tools/llvm-readobj/broken-group.test
===================================================================
--- test/tools/llvm-readobj/broken-group.test
+++ test/tools/llvm-readobj/broken-group.test
@@ -20,6 +20,8 @@
# LLVM-STDOUT-NEXT: Group {
# LLVM-STDOUT-NEXT: Name: .group
# LLVM-STDOUT-NEXT: Index: 2
+# LLVM-STDOUT-NEXT: Link: 5
+# LLVM-STDOUT-NEXT: Info: 1
# LLVM-STDOUT-NEXT: Type: COMDAT
# LLVM-STDOUT-NEXT: Signature: bar
# LLVM-STDOUT-NEXT: Section(s) in group [
@@ -29,6 +31,8 @@
# LLVM-STDOUT-NEXT: Group {
# LLVM-STDOUT-NEXT: Name: .group1
# LLVM-STDOUT-NEXT: Index: 4
+# LLVM-STDOUT-NEXT: Link: 5
+# LLVM-STDOUT-NEXT: Info: 2
# LLVM-STDOUT-NEXT: Type: COMDAT
# LLVM-STDOUT-NEXT: Signature: zed
# LLVM-STDOUT-NEXT: Section(s) in group [
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44280.137812.patch
Type: text/x-patch
Size: 2870 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180309/0510dbee/attachment.bin>
More information about the llvm-commits
mailing list