[uClibc]system-dependent asm in `initfini.c'?

Erik Andersen andersen at codepoet.org
Thu Aug 22 12:03:54 UTC 2002


On Thu Aug 22, 2002 at 03:39:55PM +0900, Miles Bader wrote:
> When compiling `uclibc/build/rte-ma1-cb/libc/sysdeps/linux/common', it
> tries to produce `crti.o' from `crti.S', which is itself produced via a
> perl script from the output of compiling `initfini.c' to assembly.

Yup.  These files are needed to support constructors and
destructors.  Building the files this way seemed far better 
than trying to code this stuff N times using arch specific 
asm.

> On my system, it dies with the following errors:
> 
>    v850e-elf-gcc -Wall -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -Os -fno-builtin -c crti.S -o crti.o
>    initfini.c: Assembler messages:
>    initfini.c:6: Error: Unknown pseudo-op:  `.hidden'
>    initfini.c:19: Error: Unknown pseudo-op:  `.hidden'
> 
> The `.hidden' is explicitly inserted into the assembly by initfini.c.
> 
> So, what is this `.hidden'?  It obviously isn't portable.

Using `.hidden' hides the specified symbol to ensure that the
local symbol is the one actually used locally.   It is mostly
relevant when you might be linking an app vs a library (shared or
static) which could define a function with the same name.  For
some arches, this is necessary so that ctors/dtors (which use the
sepcial symbols _init and _fini) don't get overridden by the
ctors/dtors in a library.  

Nasty stuff though, I agree.  I added it at the request of the
SuperH (sh) architecture people, who apparently require it...  I
have just changed things to wrap the use of .hidden in a special
'HAVE_DOT_HIDDEN' ifdef to only enable it when supported.
Agreeable?

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the uClibc mailing list