[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gcl-devel] bug in sfaslbfd.c
From: |
Camm Maguire |
Subject: |
Re: [Gcl-devel] bug in sfaslbfd.c |
Date: |
11 Oct 2002 15:46:43 -0400 |
Greetings, and thanks for your report! I'm committing a fix to this,
please check it out. We need to pass '0' to the openr so that the
format type will make a sane default -- bfd relocations are used on
many different platforms now, and I can't see any other way of
specifying the binary file format used by gcc in a reasonable fashion.
BTW, are you interested in helping as a gcl developer? I still have
your earlier xp and socket requests in my queue. If you'd be
interested, please register at savannah and send me your user id.
Take care,
Peter Wood <address@hidden> writes:
> Hi
>
> On x86 Gnu/Linux, using Gcl from CVS downloaded Mon Sep 16 22:11:07
> CEST 2002.
>
> In gcl/o/sfaslbfd.c in function 'fasload':
>
> ...
>
> if (!(b=bfd_openr(filename,0)))
> FEerror("Cannot open bfd");
>
> if (!bfd_check_format(b,bfd_object))
> FEerror("Unknown bfd format");
>
> ...
>
> Setting the target to NULL in the call to bfd_openr causes the call to
> bfd_check_format to set the bfd 'errno' to 3 ("wrong format"), when
> calling #'load from lisp. FError is _not_ signalled, since
> bfd_check_format succeeds, so it's invisible from lisp, by default.
>
> This bug can be confirmed by adding the following debug statements,
> using bfd_get_error which 'returns the current BFD error condition'
>
> ...
>
> bfd_error_type myerr
> ...
>
> if (!(b=bfd_openr(filename,0)))
> FEerror("Cannot open bfd");
>
> if ((myerr = bfd_get_error()) != 0) {
> printf("1. myerr = %d\n", myerr);
> bfd_set_error(0);
> }
>
> if (!bfd_check_format(b,bfd_object))
> FEerror("Unknown bfd format");
>
> if ((myerr = bfd_get_error()) != 0) {
> printf("2. myerr = %d\n", myerr);
> bfd_set_error(0);
>
> ...
>
> With the above additions, a call to #'load results in the following
> output:
>
> >(load "bfd-lisp")
>
> Loading bfd-lisp.o
> 2. myerr = 3
> start address -T 0x8920000 Finished loading bfd-lisp.o
> 7728
>
> I fixed the bug (for this machine) by replacing the NULL (0)parameter
> in the call to bfd_openr with the target name "elf32-i386". Maybe
> this could be set up by config? There is also a call to bfd_openr in
> sfasli.c which uses a NULL target parameter, and which needs to be
> specified.
>
> After which:
>
> (load "bfd-lisp")
>
> Loading bfd-lisp.o
> start address -T 0x88b3000 Finished loading bfd-lisp.o
> 7728
>
> To be honest, after looking at the *ancient* bfd 'documentation' I
> think it might be BFD's bug, not GCL's. Regardless, its not nice to
> have the bfd_errno set permanently.
>
> Regards,
> Peter
>
>
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
>
>
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah