[RFC] slipping in symbol prefixes automagically via PROVIDE() in linker scripts

Mike Frysinger vapier@gentoo.org
Sun Jul 30 19:45:00 GMT 2006


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20060730/f59f8e12/attachment.sig>


More information about the Binutils mailing list