This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [RFA:] elflink.h: Don't set linker-script symbols to STT_OBJECT (BSF_OBJECT).
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Cc: binutils at sources dot redhat dot com, ian at airs dot com, eric at andante dot org
- Date: Tue, 19 Mar 2002 17:55:07 +1030
- Subject: Re: [RFA:] elflink.h: Don't set linker-script symbols to STT_OBJECT (BSF_OBJECT).
- References: <200203190621.HAA11260@ignucius.axis.se>
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