[PATCH] make coff_compute_checksum faster

Nick Clifton nickc@redhat.com
Wed May 3 14:39:31 GMT 2023


Hi Oleg,

> This makes linking faster by reading 8 MB of data at once instead of
> reading 2 bytes at once. This drastically reduces the number of system
> calls.

Thanks very much.  I have applied your patch with one small change:

> +  buf = (unsigned char *)bfd_malloc (0x800000);

I replaced the use of a magic number in the malloc, and subsequent
read, with a #define'd value:

   buf = (unsigned char *) bfd_malloc (COFF_CHECKSUM_BUFFER_SIZE);

It just makes it easier to change the buffer size, should that
become needed in the future.

Cheers
   Nick



More information about the Binutils mailing list