[PATCH] D87727: Match ".stack_size" with the original section name, and not the uniquified name.
Rahman Lavaee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 15 15:13:02 PDT 2020
rahmanl created this revision.
Herald added subscribers: llvm-commits, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.
rahmanl requested review of this revision.
Herald added a subscriber: MaskRay.
Without this patch, obj2yaml decodes the content of only one ".stack_size" section. Other sections are dumped with their full contents.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D87727
Files:
llvm/test/tools/obj2yaml/ELF/stack-sizes.yaml
llvm/tools/obj2yaml/elf2yaml.cpp
Index: llvm/tools/obj2yaml/elf2yaml.cpp
===================================================================
--- llvm/tools/obj2yaml/elf2yaml.cpp
+++ llvm/tools/obj2yaml/elf2yaml.cpp
@@ -520,7 +520,7 @@
// Recognize some special SHT_PROGBITS sections by name.
if (Sec.sh_type == ELF::SHT_PROGBITS) {
- auto NameOrErr = getUniquedSectionName(&Sec);
+ auto NameOrErr = Obj.getSectionName(&Sec);
if (!NameOrErr)
return NameOrErr.takeError();
Index: llvm/test/tools/obj2yaml/ELF/stack-sizes.yaml
===================================================================
--- llvm/test/tools/obj2yaml/ELF/stack-sizes.yaml
+++ llvm/test/tools/obj2yaml/ELF/stack-sizes.yaml
@@ -83,3 +83,43 @@
- Name: .stack_sizes
Type: SHT_PROGBITS
Content: ""
+
+## Check obj2yaml can dump multiple .stack_sizes.
+
+# RUN: yaml2obj --docnum=4 %s -o %t4
+# RUN: obj2yaml %t4 | FileCheck %s --check-prefix=MULTI
+
+# MULTI: --- !ELF
+# MULTI-NEXT: FileHeader:
+# MULTI-NEXT: Class: ELFCLASS64
+# MULTI-NEXT: Data: ELFDATA2LSB
+# MULTI-NEXT: Type: ET_EXEC
+# MULTI-NEXT: Machine: EM_NONE
+# MULTI-NEXT: Sections:
+# MULTI-NEXT: - Name: .stack_sizes
+# MULTI-NEXT: Type: SHT_PROGBITS
+# MULTI-NEXT: Entries:
+# MULTI-NEXT: - Address: 0x0000000000000010
+# MULTI-NEXT: Size: 0x0000000000000020
+# MULTI-NEXT: - Address: 0x0000000000000030
+# MULTI-NEXT: Size: 0x0000000000000040
+# MULTI-NEXT: - Name: '.stack_sizes (1)'
+# MULTI-NEXT: Type: SHT_PROGBITS
+# MULTI-NEXT: Entries:
+# MULTI-NEXT: - Address: 0x0000000000000050
+# MULTI-NEXT: Size: 0x0000000000000001
+# MULTI-NEXT: - Address: 0x0000000000000060
+# MULTI-NEXT: Size: 0x0000000000000002
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_EXEC
+Sections:
+ - Name: .stack_sizes
+ Type: SHT_PROGBITS
+ Content: "100000000000000020300000000000000040"
+ - Name: '.stack_sizes (1)'
+ Type: SHT_PROGBITS
+ Content: "500000000000000001600000000000000002"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87727.292036.patch
Type: text/x-patch
Size: 2111 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200915/e68e75e7/attachment.bin>
More information about the llvm-commits
mailing list