This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Providing C level symbols via linker scripts
- From: Mike Frysinger <vapier at gentoo dot org>
- To: binutils at sourceware dot org
- Cc: "Will Newton" <will dot newton at imgtec dot com>
- Date: Tue, 21 Mar 2006 13:48:22 -0500
- Subject: Re: Providing C level symbols via linker scripts
- Geoman: IS A RETARD
- References: <0D107966AF6D79418315B7C5549F4B51204B69@lemail1.le.imgtec.org>
On Tuesday 21 March 2006 09:27, Will Newton wrote:
> This is normally not a problem, but some software e.g. uClibc
> wishes to reference symbols defined in the linker scripts such as
> __init_array_start, but because they are referenced in C the symbol
> referenced is actually ___init_array_start (i.e. 3 leading underscores
> rather than 2). This results in an undefined symbol at link time.
> Obviously I can hack the uClibc code to get the right symbol, but I was
> wondering if there was a better solution to this problem?
how is this a bug in uClibc ? the C symbol name is "__init_array_start" thus
your architecture should be providing "___init_array_start" via binutils ...
unless you dont handle init/fini stuff, then just disable global constructors
support in uClibc ...
> Do other architectures have this problem e.g. sh?
blackfin is the only arch i know of that utilizes the USER_PREFIX in gcc to
prepend an underscore ... no standard linux arch utilizes a prefix
(alpha/amd64/arm/hppa/ia64/m68k/mips/ppc/ppc64/s390/sh/sparc/x86)
-mike