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

Peter S. Mazinger ps.m at gmx.net
Tue Jan 17 09:15:00 UTC 2006


On Mon, 16 Jan 2006, Khem Raj wrote:

> 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) ;					\
> >  
> >
> 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.

The link above could solve an issue I had, when I wanted to remove 
global data relocations, but some of them failed with
`x' ... can't be equated to common symbol `__GI_x'

Peter

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2




More information about the uClibc mailing list