Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* include/libc-symbols.h (hidden_weak): Define it for [__ASSEMBLER__].
	* sysdeps/unix/make-syscalls.sh: Generate libc_hidden_def or
	libc_hidden_weak for every system call symbol defined.

	* include/time.h: Use libc_hidden_proto for time, asctime, mktime,
	timelocal, localtime, strftime.
	* time/asctime.c: Add libc_hidden_def.
	* time/mktime.c: Likewise.
	* time/localtime.c: Likewise.
	* time/strftime.c: Likewise.
	* time/strptime.c: Likewise.
	* sysdeps/generic/time.c: Likewise.
	* sysdeps/unix/time.c: Likewise.
	* sysdeps/unix/sysv/i386/time.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/time.S: Likewise.

	* include/arpa/inet.h: Use libc_hidden_proto for inet_ntop, inet_pton.
	inet_makeaddr, inet_netof, inet_addr, __inet_addr.
	* resolv/inet_ntop.c: Likewise.
	* resolv/inet_pton.c: Likewise.
	* inet/inet_mkadr.c: Add libc_hidden_def.
	* inet/inet_netof.c: Likewise.
	* resolv/inet_addr.c: Likewise.

	* include/libc-symbols.h: Remove `defined HAVE_BROKEN_ALIAS_ATTRIBUTE'
	clauses from conditionals for now.  Will have to be fixed later
	for older compilers.
  • Loading branch information
Roland McGrath committed Aug 3, 2002
1 parent bc13934 commit c5598d4
Show file tree
Hide file tree
Showing 19 changed files with 91 additions and 21 deletions.
29 changes: 29 additions & 0 deletions ChangeLog
@@ -1,5 +1,34 @@
2002-08-03 Roland McGrath <roland@redhat.com>

* include/libc-symbols.h (hidden_weak): Define it for [__ASSEMBLER__].

* sysdeps/unix/make-syscalls.sh: Generate libc_hidden_def or
libc_hidden_weak for every system call symbol defined.

* include/time.h: Use libc_hidden_proto for time, asctime, mktime,
timelocal, localtime, strftime.
* time/asctime.c: Add libc_hidden_def.
* time/mktime.c: Likewise.
* time/localtime.c: Likewise.
* time/strftime.c: Likewise.
* time/strptime.c: Likewise.
* sysdeps/generic/time.c: Likewise.
* sysdeps/unix/time.c: Likewise.
* sysdeps/unix/sysv/i386/time.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/time.S: Likewise.

* include/arpa/inet.h: Use libc_hidden_proto for inet_ntop, inet_pton.
inet_makeaddr, inet_netof, inet_addr, __inet_addr.
* resolv/inet_ntop.c: Likewise.
* resolv/inet_pton.c: Likewise.
* inet/inet_mkadr.c: Add libc_hidden_def.
* inet/inet_netof.c: Likewise.
* resolv/inet_addr.c: Likewise.

* include/libc-symbols.h: Remove `defined HAVE_BROKEN_ALIAS_ATTRIBUTE'
clauses from conditionals for now. Will have to be fixed later
for older compilers.

* sysdeps/generic/mempcpy.c (__mempcpy): #undef it before defn.

2002-08-02 Ulrich Drepper <drepper@redhat.com>
Expand Down
7 changes: 7 additions & 0 deletions include/arpa/inet.h
@@ -1,3 +1,10 @@
#include <inet/arpa/inet.h>

extern in_addr_t __inet_aton (__const char *__cp, struct in_addr *__inp);
libc_hidden_proto (__inet_aton)

libc_hidden_proto (inet_aton)
libc_hidden_proto (inet_ntop)
libc_hidden_proto (inet_pton)
libc_hidden_proto (inet_makeaddr)
libc_hidden_proto (inet_netof)
12 changes: 5 additions & 7 deletions include/libc-symbols.h
Expand Up @@ -440,8 +440,7 @@
versioned_symbol (libc, __real_foo, foo, GLIBC_2_1);
libc_hidden_ver (__real_foo, foo) */

#if defined SHARED && defined DO_VERSIONING \
&& defined HAVE_BROKEN_ALIAS_ATTRIBUTE
#if defined SHARED && defined DO_VERSIONING
# ifndef __ASSEMBLER__
# ifdef HAVE_BROKEN_VISIBILITY_ATTRIBUTE
# define __hidden_proto_hiddenattr
Expand Down Expand Up @@ -514,6 +513,7 @@
to use __GI_* name and we need to add alias to the real name.
hidden_proto and hidden_weak don't make sense for assembly. */
# define hidden_def(name) strong_alias (name, __GI_##name)
# define hidden_weak(name) weak_alias (name, __GI_##name)
# define hidden_ver(local, name) strong_alias (local, __GI_##name)
# endif
#else
Expand All @@ -525,7 +525,7 @@
# define hidden_ver(local, name)
#endif

#if !defined NOT_IN_libc && !defined HAVE_BROKEN_ALIAS_ATTRIBUTE
#if !defined NOT_IN_libc
# define libc_hidden_proto(name) hidden_proto (name)
# define libc_hidden_def(name) hidden_def (name)
# define libc_hidden_weak(name) hidden_weak (name)
Expand All @@ -537,8 +537,7 @@
# define libc_hidden_ver(local, name)
#endif

#if defined NOT_IN_libc && defined IS_IN_rtld \
&& !defined HAVE_BROKEN_ALIAS_ATTRIBUTE
#if defined NOT_IN_libc && defined IS_IN_rtld
# define rtld_hidden_proto(name) hidden_proto (name)
# define rtld_hidden_def(name) hidden_def (name)
# define rtld_hidden_weak(name) hidden_weak (name)
Expand All @@ -550,8 +549,7 @@
# define rtld_hidden_ver(local, name)
#endif

#if defined NOT_IN_libc && defined IS_IN_libm \
&& !defined HAVE_BROKEN_ALIAS_ATTRIBUTE
#if defined NOT_IN_libc && defined IS_IN_libm
# define libm_hidden_proto(name) hidden_proto (name)
# define libm_hidden_def(name) hidden_def (name)
# define libm_hidden_weak(name) hidden_weak (name)
Expand Down
8 changes: 8 additions & 0 deletions include/time.h
Expand Up @@ -4,6 +4,14 @@
#else
# include <time/time.h>

libc_hidden_proto (time)
libc_hidden_proto (asctime)
libc_hidden_proto (mktime)
libc_hidden_proto (timelocal)
libc_hidden_proto (localtime)
libc_hidden_proto (strftime)
libc_hidden_proto (strptime)

/* Now define the internal interfaces. */
struct tm;

Expand Down
1 change: 1 addition & 0 deletions inet/inet_mkadr.c
Expand Up @@ -56,3 +56,4 @@ inet_makeaddr(net, host)
addr = htonl(addr);
return (*(struct in_addr *)&addr);
}
libc_hidden_def (inet_makeaddr)
1 change: 1 addition & 0 deletions inet/inet_netof.c
Expand Up @@ -52,3 +52,4 @@ inet_netof(in)
else
return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
}
libc_hidden_def (inet_netof)
15 changes: 9 additions & 6 deletions resolv/inet_addr.c
@@ -1,7 +1,7 @@
/*
* Copyright (c) 1983, 1990, 1993
* The Regents of the University of California. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
Expand All @@ -13,7 +13,7 @@
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand All @@ -29,14 +29,14 @@

/*
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
*
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies, and that
* the name of Digital Equipment Corporation not be used in advertising or
* publicity pertaining to distribution of the document or software without
* specific, written prior permission.
*
*
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
Expand Down Expand Up @@ -98,15 +98,16 @@ inet_addr(const char *cp) {
return (INADDR_NONE);
}

/*
/*
* Check whether "cp" is a valid ascii representation
* of an Internet address and convert to a binary address.
* Returns 1 if the address is valid, 0 if not.
* This replaces inet_addr, the return value from which
* cannot distinguish between failure and a local broadcast address.
*/
in_addr_t
__inet_aton(const char *cp, struct in_addr *addr) {
__inet_aton(const char *cp, struct in_addr *addr)
{
static const in_addr_t max[4] = { 0xffffffff, 0xffffff, 0xffff, 0xff };
in_addr_t val;
#ifndef _LIBC
Expand Down Expand Up @@ -221,3 +222,5 @@ __inet_aton(const char *cp, struct in_addr *addr) {
return (0);
}
weak_alias (__inet_aton, inet_aton)
libc_hidden_def (__inet_aton)
libc_hidden_weak (inet_aton)
3 changes: 2 additions & 1 deletion resolv/inet_ntop.c
Expand Up @@ -73,6 +73,7 @@ inet_ntop(af, src, dst, size)
}
/* NOTREACHED */
}
libc_hidden_def (inet_ntop)

/* const char *
* inet_ntop4(src, dst, size)
Expand Down Expand Up @@ -184,7 +185,7 @@ inet_ntop6(src, dst, size)
tp += SPRINTF((tp, "%x", words[i]));
}
/* Was it a trailing run of 0x00's? */
if (best.base != -1 && (best.base + best.len) ==
if (best.base != -1 && (best.base + best.len) ==
(NS_IN6ADDRSZ / NS_INT16SZ))
*tp++ = ':';
*tp++ = '\0';
Expand Down
1 change: 1 addition & 0 deletions resolv/inet_pton.c
Expand Up @@ -65,6 +65,7 @@ inet_pton(af, src, dst)
}
/* NOTREACHED */
}
libc_hidden_def (inet_pton)

/* int
* inet_pton4(src, dst)
Expand Down
3 changes: 2 additions & 1 deletion sysdeps/generic/time.c
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc.
/* Copyright (C) 1991,96,97,2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -30,6 +30,7 @@ time (timer)
*timer = (time_t) -1;
return (time_t) -1;
}
libc_hidden_def (time)

stub_warning (time)
#include <stub-tag.h>
7 changes: 6 additions & 1 deletion sysdeps/unix/make-syscalls.sh
Expand Up @@ -130,7 +130,8 @@ shared-only-routines += $file
(echo '#include <sysdep.h>'; \\
echo 'PSEUDO ($strong, $syscall, $nargs)'; \\
echo ' ret'; \\
echo 'PSEUDO_END($strong)'; \\"
echo 'PSEUDO_END($strong)'; \\
echo 'libc_hidden_def ($strong)'; \\"
# Append any weak aliases or versions defined for this syscall function.
Expand Down Expand Up @@ -168,6 +169,7 @@ shared-only-routines += $file
;;
*)
echo " echo 'weak_alias ($strong, $name)'; \\"
echo " echo 'libc_hidden_weak ($name)'; \\"
;;
esac
done
Expand Down Expand Up @@ -275,9 +277,12 @@ shared-only-routines += $file
echo " echo '} \\'; \\"
echo " echo 'libc_hidden_def (BP_SYM ($strong)) \\'; \\"
# generate thunk aliases
for name in $nv_weak; do
echo " echo 'weak_alias (BP_SYM ($strong), BP_SYM ($name)) \\'; \\"
echo " echo 'libc_hidden_weak (BP_SYM ($name)) \\'; \\"
done
# wrap up
Expand Down
3 changes: 2 additions & 1 deletion sysdeps/unix/sysv/i386/time.S
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc.
/* Copyright (C) 1991,92,96,97,2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -27,3 +27,4 @@ SYSCALL (time, 1)
L(null):
ret
PSEUDO_END (time)
libc_hidden_def (time)
3 changes: 2 additions & 1 deletion sysdeps/unix/sysv/linux/x86_64/time.S
@@ -1,4 +1,4 @@
/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
/* Copyright (C) 2001,02 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -40,3 +40,4 @@ L(pseudo_end):
add $0x8, %rsp
ret
PSEUDO_END(time)
libc_hidden_def (time)
3 changes: 2 additions & 1 deletion sysdeps/unix/time.c
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1997, 2001 Free Software Foundation, Inc.
/* Copyright (C) 1991,92,97,2001,02 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -39,3 +39,4 @@ time (t)
*t = result;
return result;
}
libc_hidden_def (time)
2 changes: 1 addition & 1 deletion time/asctime.c
Expand Up @@ -36,7 +36,7 @@ asctime (const struct tm *tp)
{
return __asctime_r (tp, result);
}

libc_hidden_def (asctime)

char *
__asctime_r (const struct tm *tp, char *buf)
Expand Down
3 changes: 2 additions & 1 deletion time/localtime.c
@@ -1,5 +1,5 @@
/* Convert `time_t' to `struct tm' in local time zone.
Copyright (C) 1991, 92, 93, 95, 96, 97, 98 Free Software Foundation, Inc.
Copyright (C) 1991,92,93,95,96,97,98,2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -42,3 +42,4 @@ localtime (t)
{
return __tz_convert (t, 1, &_tmbuf);
}
libc_hidden_def (localtime)
5 changes: 5 additions & 0 deletions time/mktime.c
Expand Up @@ -405,6 +405,11 @@ mktime (tp)
#ifdef weak_alias
weak_alias (mktime, timelocal)
#endif

#ifdef _LIBC
libc_hidden_def (mktime)
libc_hidden_weak (timelocal)
#endif

#if DEBUG

Expand Down
3 changes: 3 additions & 0 deletions time/strftime.c
Expand Up @@ -1361,6 +1361,9 @@ my_strftime (s, maxsize, format, tp ut_argument)
*p = L_('\0');
return i;
}
#ifdef _LIBC
libc_hidden_def (strftime)
#endif


#ifdef emacs
Expand Down
3 changes: 3 additions & 0 deletions time/strptime.c
Expand Up @@ -1037,3 +1037,6 @@ strptime (buf, format, tm)
#endif
return strptime_internal (buf, format, tm, &decided, -1);
}
#ifdef _LIBC
libc_hidden_def (strptime)
#endif

0 comments on commit c5598d4

Please sign in to comment.