[RFA:] elflink.h: Don't set linker-script symbols to STT_OBJECT (BSF_OBJECT).

Alan Modra amodra@bigpond.net.au
Mon Mar 18 23:25:00 GMT 2002


On Tue, Mar 19, 2002 at 07:21:37AM +0100, Hans-Peter Nilsson wrote:
> Symbols assigned in linker scripts are default set to "object"
> type (bfd BSF_OBJECT, ELF STT_OBJECT) rather than stick to
> untyped (ELF STT_NOTYPE) as would have happened with a symbol
> from an input file.  I can't see a reason to do that.  It breaks
> disassembly when one of those symbols has the same value and
> collates before the "real" symbol (collation being the fallback
> for the disassembler for chosing the symbol).  It will then only
> dump hex, not disassembly.  I see nothing wrong with what the
> disassembler does; it's the linker that shouldn't assume types
> for symbols defined in linker scripts, where no type was
> specified.  (There might be a separate issue about the lack of a
> feature to set symbol types in linker scripts...)
> 
> The following causes no regressions for i686-pc-linux-gnu
> (native), cris-axis-linux-gnu (cross) and sh64-*-elf (cross).
> 
> There are "failures" in the mmix-knuth-mmixware (cross) results,
> exactly matching the changed symbol type for symbols from the
> linker script.  I'll tweak those of course.
> 
> bfd:
> 	* elflink.h (NAME(bfd_elf,record_link_assignment)): Don't set
> 	STT_NOTYPE symbols to STT_OBJECT.

Hmm, looks like setting the symbol to STT_OBJECT was quite deliberate.

It's a long time ago for either Ian or Eric to remember this one, but
I wonder whether you have some archaelogical evidence for the purpose
of the patch?

Mon Aug  1 12:04:40 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)

	* elf64-sparc.c (ELF_MAXPAGESIZE): Define.

	ELF linker patches from Eric Youngdale <ericy@cais.cais.com>.
	* elfcode.h (elf_link_create_dynamic_sections): Set type of
	_DYNAMIC to STT_OBJECT.
	(NAME(bfd_elf,record_link_assignment)): Always create hash table
	entry.  Set type to STT_OBJECT.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list