Error linking gdb statically

Peter S. Mazinger ps.m at gmx.net
Thu May 25 21:35:33 UTC 2006


On Thu, 25 May 2006, Qunying Pan wrote:

> 
> 
> Hello,
> 
> >I would like to report something similar to what was reported for 
> >binutils here:
> >http://www.uclibc.org/lists/uclibc/2005-December/013558.html
> 
> 
> Making strncmp a weak hidden could fix the issue as the patch attached.
> Verified on arm, and mips. Is it acceptable? Please advice. Thanks!

Patch is incorrect, s/libc_hidden_def/libc_hidden_weak/

Don't move them around, you have to keep them after the function 
(libc_hidden_proto is always before the function, libc_hidden_def or 
_weak after). Some gcc versions won't allow that.

Peter
> 
> 
> Best Regards,
> 
> Qunying Pan <qpan at mvista.com>
> 
> 
> diff -urNp uClibc-20060518/libc.orig/string/arm/strncmp.S
> uClibc-20060518/libc/string/arm/strncmp.S
> --- uClibc-20060518/libc.orig/string/arm/strncmp.S	2006-04-11
> 17:05:18.000000000 -0700
> +++ uClibc-20060518/libc/string/arm/strncmp.S	2006-05-25
> 11:33:08.000000000 -0700
> @@ -65,4 +65,4 @@ strncmp:
>  
>  .size strncmp,.-strncmp
>  
> -libc_hidden_def(strncmp)
> +libc_hidden_weak(strncmp)
> diff -urNp uClibc-20060518/libc.orig/string/generic/strncmp.c
> uClibc-20060518/libc/string/generic/strncmp.c
> --- uClibc-20060518/libc.orig/string/generic/strncmp.c	2006-04-11
> 17:05:18.000000000 -0700
> +++ uClibc-20060518/libc/string/generic/strncmp.c	2006-05-25
> 11:35:57.000000000 -0700
> @@ -20,6 +20,7 @@
>  #include "memcopy.h"
>  
>  libc_hidden_proto(strncmp)
> +libc_hidden_weak(strncmp)
>  /* Compare no more than N characters of S1 and S2,
>     returning less than, equal to or greater than zero
>     if S1 is lexicographically less than, equal to or
> @@ -65,4 +66,3 @@ int strncmp (const char *s1, const char 
>  
>    return c1 - c2;
>  }
> -libc_hidden_def(strncmp)
> diff -urNp uClibc-20060518/libc.orig/string/i386/strncmp.c
> uClibc-20060518/libc/string/i386/strncmp.c
> --- uClibc-20060518/libc.orig/string/i386/strncmp.c	2006-04-11
> 17:05:18.000000000 -0700
> +++ uClibc-20060518/libc/string/i386/strncmp.c	2006-05-25
> 10:52:02.000000000 -0700
> @@ -33,6 +33,7 @@
>  #include <string.h>
>  
>  libc_hidden_proto(strncmp)
> +libc_hidden_weak(strncmp)
>  int strncmp(const char *cs, const char *ct, size_t count)
>  {
>      register int __res;
> @@ -55,4 +56,3 @@ int strncmp(const char *cs, const char *
>  	    :"1" (cs),"2" (ct),"3" (count));
>      return __res;
>  }
> -libc_hidden_def(strncmp)
> diff -urNp uClibc-20060518/libc.orig/string/ia64/strncmp.S
> uClibc-20060518/libc/string/ia64/strncmp.S
> --- uClibc-20060518/libc.orig/string/ia64/strncmp.S	2006-04-11
> 17:05:17.000000000 -0700
> +++ uClibc-20060518/libc/string/ia64/strncmp.S	2006-05-25
> 11:31:31.000000000 -0700
> @@ -59,4 +59,4 @@ ENTRY(strncmp)
>  .restore_and_exit:
>  	br.ret.sptk.many b0
>  END(strncmp)	
> -libc_hidden_def (strncmp)
> +libc_hidden_weak(strncmp)
> diff -urNp uClibc-20060518/libc.orig/string/strncmp.c
> uClibc-20060518/libc/string/strncmp.c
> --- uClibc-20060518/libc.orig/string/strncmp.c	2006-04-11
> 17:05:19.000000000 -0700
> +++ uClibc-20060518/libc/string/strncmp.c	2006-05-25
> 11:33:50.000000000 -0700
> @@ -11,6 +11,7 @@
>  # define Wstrncmp wcsncmp
>  #else
>  libc_hidden_proto(strncmp)
> +libc_hidden_weak(strncmp)
>  # define Wstrncmp strncmp
>  #endif
>  
> @@ -37,6 +38,3 @@ int Wstrncmp(register const Wchar *s1, r
>  	return r;
>  #endif
>  }
> -#ifndef WANT_WIDE
> -libc_hidden_def(strncmp)
> -#endif
> 
> 

-- 
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