[PATCH] D140555: [lld][COFF]llvm-readobj COFFDumper print PEHeader CheckSum
Qfrost via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 22 07:29:50 PST 2022
Qfrost911 created this revision.
Qfrost911 added reviewers: thieta, MaskRay, aganea, efriedma.
Qfrost911 added a project: lld.
Herald added a reviewer: jhenderson.
Herald added a subscriber: StephenFan.
Herald added a project: All.
Qfrost911 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
In PEHeader, a field named "CheckSum" is not printed by llvm-readobj.
Previously, lld did not implement the PE-Checksum feature, I have implemented it in my version D139184 <https://reviews.llvm.org/D139184>, so I think it is necessary to output the value of this field via llvm-readobj.
And I will use it to achieve tests about this feature.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D140555
Files:
lld/test/COFF/hello32.test
llvm/tools/llvm-readobj/COFFDumper.cpp
Index: llvm/tools/llvm-readobj/COFFDumper.cpp
===================================================================
--- llvm/tools/llvm-readobj/COFFDumper.cpp
+++ llvm/tools/llvm-readobj/COFFDumper.cpp
@@ -737,6 +737,7 @@
W.printNumber("MinorSubsystemVersion", Hdr->MinorSubsystemVersion);
W.printNumber("SizeOfImage", Hdr->SizeOfImage);
W.printNumber("SizeOfHeaders", Hdr->SizeOfHeaders);
+ W.printNumber("CheckSum", Hdr->CheckSum);
W.printEnum ("Subsystem", Hdr->Subsystem, makeArrayRef(PEWindowsSubsystem));
W.printFlags ("Characteristics", Hdr->DLLCharacteristics,
makeArrayRef(PEDLLCharacteristics));
Index: lld/test/COFF/hello32.test
===================================================================
--- lld/test/COFF/hello32.test
+++ lld/test/COFF/hello32.test
@@ -42,6 +42,7 @@
HEADER-NEXT: MinorSubsystemVersion: 0
HEADER-NEXT: SizeOfImage: 20480
HEADER-NEXT: SizeOfHeaders: 1024
+HEADER-NEXT: CheckSum:
HEADER-NEXT: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI (0x3)
HEADER-NEXT: Characteristics [ (0x9140)
HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_APPCONTAINER (0x1000)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140555.484833.patch
Type: text/x-patch
Size: 1128 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221222/4f4966f3/attachment.bin>
More information about the llvm-commits
mailing list