This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] PE image checksum
- From: Casper Hornstrup <chorns at users dot sourceforge dot net>
- To: DJ Delorie <dj at delorie dot com>
- Cc: binutils at sourceware dot cygnus dot com
- Date: Thu, 20 Dec 2001 16:02:21 -0500
- Subject: Re: [PATCH] PE image checksum
- References: <01120101184103.02008@exception.adsl.dk> <200112200423.fBK4NF413328@envy.delorie.com>
On Wednesday 19 December 2001 23:23, you wrote:
> Have you tried this patch? It looks to me like you're trying to
> compute the checksum of the file before the file is even written out
> (only the initial header is written at that point).
AFAICS coff_write_object_contents () writes the last of the PE image.
I have built an Windows NT device driver using ld with the this patch
applied. Objdump -p shows the checksum value of the PE image and I have used
an utility (found somewhere on the Internet) that tests wether the PE
checksum is correct to verify the checksum. Windows NT loads the device
driver when the PE image checksum is there, but not when it is zero.
> EXEC_P means that there's an aoutheader. Use COFF_IMAGE_WITH_PE to
> conditionalize code for PE executables.
So the patch should be within #ifdef COFF_IMAGE_WITH_PE?
Casper Hornstrup