This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PE image checksum


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]