This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Question: BFD_FAIL
Ian Lance Taylor wrote:
> msnyder@sonic.net writes:
>
> > Are we meant to assume that BFD_FAIL does not return?
>
> That would be an unwise assumption. As you have seen, it does
> return.
>
> > void
> > _bfd_set_gp_value (bfd *abfd, bfd_vma v)
> > {
> > if (! abfd)
> > BFD_FAIL ();
> > if (abfd->format != bfd_object)
> > return;
>
> Yep, looks wrong. Came in here:
>
> 2003-05-17 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
>
> * bfd.c (_bfd_get_gp_value): Prevent illegal access for abfd null
> pointers.
> (_bfd_set_gp_value): Likewise.
I think that's the correct fix. Ok?
Thiemo
2007-07-25 Thiemo Seufer <ths@mips.com>
* bfd.c (_bfd_set_gp_value): Use abort instead of BFD_FAIL.
Index: bfd.c
===================================================================
RCS file: /cvs/src/src/bfd/bfd.c,v
retrieving revision 1.96
diff -u -p -r1.96 bfd.c
--- bfd.c 3 Jul 2007 14:26:39 -0000 1.96
+++ bfd.c 25 Jul 2007 20:35:27 -0000
@@ -1020,7 +1020,7 @@ void
_bfd_set_gp_value (bfd *abfd, bfd_vma v)
{
if (! abfd)
- BFD_FAIL ();
+ abort ();
if (abfd->format != bfd_object)
return;