llvm.org GIT mirror llvm / 3043522
[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 Alexander Shaposhnikov 2 years ago
3 changed file(s) with 20 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
1919 # LLVM-STDOUT-NEXT: Group {
2020 # LLVM-STDOUT-NEXT: Name: .group
2121 # LLVM-STDOUT-NEXT: Index: 2
22 # LLVM-STDOUT-NEXT: Link: 5
23 # LLVM-STDOUT-NEXT: Info: 1
2224 # LLVM-STDOUT-NEXT: Type: COMDAT
2325 # LLVM-STDOUT-NEXT: Signature: bar
2426 # LLVM-STDOUT-NEXT: Section(s) in group [
2830 # LLVM-STDOUT-NEXT: Group {
2931 # LLVM-STDOUT-NEXT: Name: .group1
3032 # LLVM-STDOUT-NEXT: Index: 4
33 # LLVM-STDOUT-NEXT: Link: 5
34 # LLVM-STDOUT-NEXT: Info: 2
3135 # LLVM-STDOUT-NEXT: Type: COMDAT
3236 # LLVM-STDOUT-NEXT: Signature: zed
3337 # LLVM-STDOUT-NEXT: Section(s) in group [
2020 CHECK-NEXT: Group {
2121 CHECK-NEXT: Name: .group (92)
2222 CHECK-NEXT: Index: 1
23 CHECK-NEXT: Link: 23
24 CHECK-NEXT: Info: 17
2325 CHECK-NEXT: Type: COMDAT (0x1)
2426 CHECK-NEXT: Signature: _Z3fooIcEvT_
2527 CHECK-NEXT: Section(s) in group [
3032 CHECK-NEXT: Group {
3133 CHECK-NEXT: Name: .group (92)
3234 CHECK-NEXT: Index: 2
35 CHECK-NEXT: Link: 23
36 CHECK-NEXT: Info: 18
3337 CHECK-NEXT: Type: COMDAT (0x1)
3438 CHECK-NEXT: Signature: _Z3fooIiEvT_
3539 CHECK-NEXT: Section(s) in group [
24812481 StringRef Signature;
24822482 uint64_t ShName;
24832483 uint64_t Index;
2484 uint32_t Link;
2485 uint32_t Info;
24842486 uint32_t Type;
24852487 std::vector Members;
24862488 };
25072509
25082510 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec));
25092511 StringRef Signature = StrTable.data() + Sym->st_name;
2510 Ret.push_back({Name, Signature, Sec.sh_name, I - 1, Data[0], {}});
2512 Ret.push_back({Name,
2513 Signature,
2514 Sec.sh_name,
2515 I - 1,
2516 Sec.sh_link,
2517 Sec.sh_info,
2518 Data[0],
2519 {}});
25112520
25122521 std::vector &GM = Ret.back().Members;
25132522 for (uint32_t Ndx : Data.slice(1)) {
37793788 DictScope D(W, "Group");
37803789 W.printNumber("Name", G.Name, G.ShName);
37813790 W.printNumber("Index", G.Index);
3791 W.printNumber("Link", G.Link);
3792 W.printNumber("Info", G.Info);
37823793 W.printHex("Type", getGroupType(G.Type), G.Type);
37833794 W.startLine() << "Signature: " << G.Signature << "\n";
37843795