This is the mail archive of the bfd@sourceware.cygnus.com mailing list for the bfd project.


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

Re: A patch for elf.c


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