[PATCH] more adjustments to elf_find_function

Alan Modra amodra@bigpond.net.au
Wed Dec 1 22:11:00 GMT 2004


On Wed, Dec 01, 2004 at 09:09:37AM +0100, Jan Beulich wrote:
> they would just introduce a little more overhead.

That's one reason why I disagree with the patch.

The others are:
- you obviously cannot reliably choose the right filename for global
  symbols if there is more than one file symbol.
- for local symbols, your code relies on ld -r continuing to leave file
  symbols unsorted, which I see as a minor violation of the ELF spec.

Unnecessary, useless code doesn't help maintainability.  Granted, this
instance isn't serious;  I'm just objecting on principle.  If you
commented the code with

/* ??? Given multiple file symbols, it is impossible to reliably
   choose the right file name for global symbols.  File symbols are
   local symbols, and thus all file symbols must sort before any
   global symbols.  The ELF spec says that a file symbol must sort
   before other local symbols, but currently ld -r doesn't do this.
   So, for ld -r output, it is possible to make a better choice of
   file name for local symbols by ignoring file symbols appearing
   after a given local symbol.  */

then given that Nick has already okayed the patch, I'd withdraw my
objections.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list