This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug in xsym.c ?


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 

	


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