A patch for elf.c

Stan Shebs shebs@cygnus.com
Wed Dec 9 16:27:00 GMT 1998


law@hurl.cygnus.com (Jeffrey A Law) writes:

> Once one understands precisely why clearing one or more memory locations is
> fixing a bug, once can decide if clearing one or more fields or a whole
> structure/array is the best solution.
> 
> I believe gdb operates under a similar guidelines.

Yes.  There is actually a real reason to not just automatically zero
everything - in some cases, the blocks are very large, and it's known
that they will be overwritten soon, such as when BFD reads in a whole
section.  So zeroing all allocated blocks chews execution time
uselessly.

This is just a GNU standard.  In my other program (Xconq), everything
is zeroed upon allocation, and the rest of the code is designed to
exploit that.

							Stan



More information about the Bfd mailing list