This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Bug in xsym.c ?
- From: Elias Athanasopoulos <elathan at phys dot uoa dot gr>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: kdienes at apple dot com, binutils at sources dot redhat dot com
- Date: Sat, 8 Mar 2003 21:51:21 +0200
- Subject: Re: Bug in xsym.c ?
- References: <m3d6l6p4iy.fsf@workshop.nickc.cambridge.redhat.com>
Hi Nick,
On Wed, Mar 05, 2003 at 09:05:25AM +0000, Nick Clifton wrote:
> Hi Klee,
>
> I ran across a problem compiling bfd/xsym.c on a Solaris platform
> the other day. The function bfd_sym_fetch_type_information_table_ent()
> was testing a variable called 'index' which is not defined. It was
> not clear from the context what the test was supposed to be doing,
> but my best guess was that it was intended to check that a parameter
> called 'entry' was non-NULL.
>
> I created a patch like this. Is it correct ?
>
> ! if (entry == 0)
> return -1;
>
> if (bfd_seek (abfd, offset, SEEK_SET) < 0)
I believe the test should be made against the 'offset' variable.
Although this is not a proof:
[anteater at neutrino bfd]$ grep bfd_sym_fetch_type_information_table_entry *.c
xsym.c:bfd_sym_fetch_type_information_table_entry (abfd, entry, offset)
xsym.c: if (bfd_sym_fetch_type_information_table_entry (abfd, entry, tindex) < 0)
xsym.c: if (bfd_sym_fetch_type_information_table_entry (abfd, &entry, index) < 0)
As I understand it, 'offset' should have been named 'index'.
Elias
--
University of Athens I bet the human brain
Physics Department is a kludge --Marvin Minsky