public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* RE: [RFC] slipping in symbol prefixes automagically via PROVIDE()  in linker scripts
@ 2006-07-31 10:25 Will Newton
  2006-07-31 16:47 ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Will Newton @ 2006-07-31 10:25 UTC (permalink / raw)
  To: Nick Clifton, Mike Frysinger; +Cc: binutils, Bernd Schmidt, Jie Zhang


Hi Nick,
 
> > with the new binutils-2.17, it'd be good to switch to using the 
> > generic elf.sc file ... but this _ prefix is standing in the way
> 
> Which symbols in the elf.sc need this prefix and do not 
> already have it ?  I looked through the file and it seems 
> that most symbols are provided in an underscore prefixed 
> version and a non-underscore prefixed version. 
>   Or is it that you want to have *double* underscore prefixed 
> versions and single underscore prefixed versions ?  (If so, 
> are the double underscore prefixed versions really necessary ?)

I had a similar problem with an unreleased port I maintain. The symbols
that were problematic, which is by no means an exhaustive list, were:

__preinit_array_start
__preinit_array_end
__init_array_start
__init_array_end
__fini_array_start
__fini_array_end

>    ${RELOCATING+${END_SYMBOLS-_end = .; PROVIDE (${PREFIX}end = .);}}
> 
> and in your bfin.sh file define PREFIX as "_".

This looks like a much cleaner way of doing it than copying and editing
elf.sc as we currently do.

******************
This e-mail has been sent from Imagination Technologies Limited.
PowerVR, Metagence, Ensigma and PURE Digital are divisions
of Imagination Technologies Limited.

The information contained in this e-mail, including any attachment,
is confidential and may be legally privileged.  It is intended solely
for the addressee(s) and access to this e-mail by anyone else is
unauthorised.  If you are not the intended recipient, any disclosure,
copying or distribution or use of the information contained in this 
e-mail, is prohibited and may be unlawful.  If you have received this
e-mail in error, please notify the sender by return e-mail and then
delete it from your system.

Internet communications cannot be guaranteed to be secure,
error or virus-free.  The sender does not accept liability for any errors
or omissions which arise as a result.

Any views expressed in this message are those of the author, except
where the author specifies and, with authority, states them to be the
views of Imagination Technologies Limited.

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [RFC] slipping in symbol prefixes automagically via PROVIDE() in linker scripts
@ 2006-07-30 19:45 Mike Frysinger
  2006-07-31 10:12 ` Nick Clifton
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2006-07-30 19:45 UTC (permalink / raw)
  To: binutils; +Cc: Bernd Schmidt, Jie Zhang

[-- Attachment #1: Type: text/plain, Size: 1112 bytes --]

the blackfin architecture has a symbol prefix of '_' (so in gcc, 
__USER_LABEL_PREFIX__ is defined to _) ...

with the old binutils blackfin port (2.15), there is a 
binutils/ld/scripttempl/bfin.sc which duplicated a lot of stuff from the 
normal elf.sc, so adding the _ prefix to symbols was trivial

with the new binutils-2.17, it'd be good to switch to using the generic elf.sc 
file ... but this _ prefix is standing in the way ... there seems to be two 
ways to deal with this at the moment:
- copy elf.sc to bfin.sc again and just insert the _ symbols as needed
- tweak PROVIDE() to automatically insert a configurable prefix

from what i can tell after reading the ld docs, PROVIDE is generally for 
setting up automatic symbol values when referenced via higher level code 
(like C) ... so making PROVIDE "smarter" and having it insert the same 
prefixes that higher level language parsers seems like a good idea to me :)

thoughts ?  am i off base with the PROVIDE() tweak ?  other solutions ?  is 
blackfin eternally screwed and forced to maintain a mostly duplicate elf.sc ?
-mike

[-- Attachment #2: Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-08-02  9:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-31 10:25 [RFC] slipping in symbol prefixes automagically via PROVIDE() in linker scripts Will Newton
2006-07-31 16:47 ` Mike Frysinger
2006-08-02  9:25   ` Nick Clifton
  -- strict thread matches above, loose matches on Subject: below --
2006-07-30 19:45 Mike Frysinger
2006-07-31 10:12 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).