[RFC] Fix MIPS strong_alias definition in libc-internal.h

Khem Raj khem at mvista.com
Mon Jan 16 20:17:56 UTC 2006


Steven J. Hill said the following on 01/14/2006 11:02 AM:

> Greetings.
>
> I wanted comments on this patch before applying it. This change
> is necessary in order for MIPS to build with the latest GCC-4.1.0
> series compilers, otherwise I get a warning message from the
> assembler and the alias is not defined leading to undefined symbols
> during linking. I am guessing that this works for GCC-3.x compilers
> and maybe even the GCC-4.0 and GCC-4.2 series. Comments please.
>
> -Steve
>
>------------------------------------------------------------------------
>
>diff -ur -x .svn /data/svn-ext/uClibc-nptl/include/libc-internal.h uClibc/include/libc-internal.h
>--- /data/svn-ext/uClibc-nptl/include/libc-internal.h	2006-01-05 21:16:36.493821500 -0600
>+++ uClibc/include/libc-internal.h	2006-01-11 18:47:11.000000000 -0600
>@@ -53,9 +53,15 @@
> # define C_SYMBOL_NAME(name) name
> #endif
> 
>+#ifndef __mips__
> # define strong_alias(name, aliasname)					\
>   .global C_SYMBOL_NAME (aliasname) ;					\
>   .set C_SYMBOL_NAME(aliasname),C_SYMBOL_NAME(name)
>+#else
>+# define strong_alias(name, aliasname)					\
>+  .global C_SYMBOL_NAME (aliasname) ;					\
>+  C_SYMBOL_NAME(aliasname) = C_SYMBOL_NAME(name)
>+#endif
> 
> # define weak_alias(name, aliasname)					\
>   .weak C_SYMBOL_NAME(aliasname) ;					\
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>uClibc mailing list
>uClibc at uclibc.org
>http://busybox.net/cgi-bin/mailman/listinfo/uclibc
>
What binutils version are you compiling it with? Recently there has been 
some changes in sysmbol assignment behaviors. For more details you can 
refer to this thread on binuitls ml.

http://sourceware.org/ml/binutils/2005-11/msg00208.html


Your fix might be needed for all arches.

Thanks


-- 
Khem Raj <khem at mvista.com>
MontaVista Software, Inc.
www.mvista.com




More information about the uClibc mailing list