[PATCH] more adjustments to elf_find_function

Nick Clifton nickc@redhat.com
Tue Nov 30 15:58:00 GMT 2004


Hi Jan,

> bfd/
> 2004-11-30 Jan Beulich  <jbeulich@novell.com>
> 
> 	* elf.c (elf_find_function): Don't use the last file symbol
> ever,
> 	seen, but the last one seen prior to the symbol being reported.
> 	Don't report a filename at all for global symbols when that
> might
> 	be ambiguous/wrong.

I am not sure that this patch is quite right.  There are two possible 
problems with it:

1) It does not apply the same adjustment to arm_elf_find_function in 
elf32-arm.c.

2) I think that the transition from state==nothing_seen to 
state==symbol_seen might be in the wrong place.  What happens if the 
symbols encountered are in this order:

   STT_LOPROC
   STT_FILENAME
   STT_FUNC

The first symbol will change the state to symbol_seen, but will not set 
'func'.  The second symbol will change the state to 
file_after_symbol_seen so that when the third symbol is encountered 
'filename' will be set to NULL and no filename will be reported.

I think that the change from state nothing_seen to state symbol_seen 
ought to be inside the switch() statement, at the end of STT_FUNC.  What 
do you think ?

Cheers
   Nick



More information about the Binutils mailing list