This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: libc_hidden_proto breaks things for PowerPC64
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Steve Munroe <sjmunroe at us dot ibm dot com>
- Cc: libc-alpha at sources dot redhat dot com, Peter Bergner <bergner at us dot ibm dot com>
- Date: Wed, 14 Aug 2002 08:30:30 +0930
- Subject: Re: libc_hidden_proto breaks things for PowerPC64
- References: <OFE9658E5E.D85D2E9F-ON86256C14.006258C8@rchland.ibm.com>
On Tue, Aug 13, 2002 at 02:08:31PM -0500, Steve Munroe wrote:
> The use of the libc_hidden_proto macro when combined with the weak_alias
> macro results in unresolved references in libc.so. For example.
>
> /work/usr/src/build-23/libc.so.6: undefined reference to `.__sysconf'
> /work/usr/src/build-23/libc.so.6: undefined reference to `.__iswpunct_l'
> /work/usr/src/build-23/libc.so.6: undefined reference to `.__gmtime_r'
> /work/usr/src/build-23/libc.so.6: undefined reference to `.__iswgraph_l'
> /work/usr/src/build-23/libc.so.6: undefined reference to `.
> ____strtoul_l_internal'
> ...
>
> The problem seems to be the combination of libc_hidden_proto and weak_alias
> macros. For example ./sysdeps/posix/sysconf.c is externally defined by:
>
> libc_hidden_proto(__sysconf)
>
> which generates the following:
>
> extern long int __sysconf (int __name);
> extern __typeof (__sysconf) __GI___sysconf; extern __typeof (__sysconf)
> __sysconf __asm__ ("" "__GI___sysconf") ;
>
> When ./sysdeps/posix/sysconf.c is compiled, this causes the symbol "
> __sysconf" to be replaced for symbol "__GI___sysconf" in the function
> prolog:
>
> .globl __GI___sysconf
> .section ".opd","aw"
> .align 3
> __GI___sysconf:
> .quad .__GI___sysconf,.TOC.@tocbase,0
> .previous
> .size __GI___sysconf,24
> .type .__GI___sysconf,@function
> .globl .__GI___sysconf
> .__GI___sysconf:
>
> But the weak_alias statement at the end of ./sysdeps/posix/sysconf.c
>
> weak_alias(__sysconf, sysconf)
>
> generates:
>
> extern __typeof (__sysconf) sysconf __attribute__ ((weak, alias ("
> __sysconf")));
>
> which generates the following asm:
>
> .weak sysconf
> .weak .sysconf
> .set .sysconf,.__sysconf
> .set sysconf,__sysconf
And what does libc_hidden_def generate for you? You ought to be
getting something like:
.globl __sysconf
.set __sysconf,__GI___sysconf
.globl .__sysconf
.set .__sysconf,.__GI___sysconf
Ah, I see. include/libc-sysmbols.h (__hidden_def1) doesn't have the
HAVE_ASM_GLOBAL_DOT_NAME case supported when HAVE_ASM_SET_DIRECTIVE.
I'll bet you haven't added support here as you did for all the
other macros.
--
Alan Modra
IBM OzLabs - Linux Technology Centre