This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] aout relocs
msnyder@sonic.net writes:
> As near as I can tell, if reloc_size is zero, the routine does
> nothing useful. Maybe it will never be zero, but if it is, a few
> iffy things will happen:
>
> * we'll call malloc with a size of zero, which is ill defined,
> and later free the result
No, we'll call bfd_malloc with a size of zero. That is not
ill-defined. It will either return NULL, or not, as (confusingly)
specified in the C standard. Passing a NULL pointer to free will
always work.
> * we'll call bfd_bread with a size of zero, and
Which is fine.
> * a potentially null pointer may slip thru the cracks.
I'm not sure which pointer you mean here.
> 2007-07-25 Michael Snyder <msnyder@access-company.com>
>
> * aoutx.h (NAME): Return TRUE if reloc_size is zero.
I have no particular objection to this patch, but the ChangeLog entry
is wrong. Emacs ^x 4 a will misfire in these functions; you have to
fill in the name manually.
I have to ask, though: why a.out?
Ian