Aliases ...

Andreas Jaeger aj@suse.de
Mon Jan 10 06:11:00 GMT 2005


Richard Henderson <rth@redhat.com> writes:

> On Sun, Jan 09, 2005 at 10:00:25PM +0100, Andreas Jaeger wrote:
>> One testcase is: 
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
>> int errno; 
>> extern  int __libc_errno __attribute__ ((alias ("errno"))); 
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ...
>> So, what shall we do with glibc?
>
> For this case, either initialize the variable, or use -fno-common.
>
>> Btw. I get this warning also for:
>> wcsftime_l.c:26: warning: ‘wcsftime_l’ aliased to undefined symbol ‘__wcsftime_l’
>> ../nss/getXXent_r.c:203: warning: ‘getgrent_r’ aliased to undefined symbol ‘__new_getgrent_r’
>> ../sysdeps/posix/pathconf.c:237: warning: ‘pathconf’ aliased to undefined symbol‘__pathconf’
>> ../sysdeps/posix/fpathconf.c:241: warning: ‘fpathconf’ aliased to undefined symbol ‘__fpathconf’
>> 
>
> But these are functions, not variables, so this must be a different
> problem.  You can re-open the same bug with these different test cases,
> or create a new one, as you choose.

I guess this warning is valid, I get:
t.c:17: warning: ‘passwd2des’ aliased to undefined symbol ‘passwd2des_internal’

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void passwd2des_internal (char *pw, char *key);

extern __typeof (passwd2des_internal) __GI_passwd2des_internal;
extern __typeof (passwd2des_internal) passwd2des_internal __asm__ ("" "__GI_passwd2des_internal") __attribute__ ((visibility ("hidden")));

void
passwd2des_internal (char *pw, char *key)
{
  int i;

  for (i = 0; *pw && i < 8; ++i)
    key[i] ^= *pw++ << 1;

}

__asm__ (".globl passwd2des_internal ; .set passwd2des_internal, __GI_passwd2des_internal");
extern __typeof (passwd2des_internal) passwd2des __attribute__ ((alias ("passwd2des_internal")));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Changing the last line to:
extern __typeof (passwd2des_internal) passwd2des __attribute__ ((alias ("__GI_passwd2des_internal")));

removes the warning, so I guess we need to fix this in glibc :-(

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-hacker/attachments/20050110/8ac03df6/attachment.sig>


More information about the Libc-hacker mailing list