@@ -47,10 +47,6 @@
#undef STACK_PROTECTOR_LEVEL
#endif
-/* Define if the regparm attribute shall be used for local functions
- (gcc on ix86 only). */
-#undef USE_REGPARMS
-
/* Defined on SPARC if GCC emits GOTDATA relocations. */
#undef HAVE_GCC_GOTDATA
@@ -101,9 +97,10 @@
/* Defined to some form of __attribute__ ((...)) if the compiler supports
- a different, more efficient calling convention. */
-#if defined USE_REGPARMS && !defined PROF
-# define internal_function __attribute__ ((regparm (3), stdcall))
+ a different, more efficient calling convention (gcc on ix86 only). */
+#ifndef PROF
+# undef internal_function
+# undef private_function
#endif
/* Linux specific: minimum supported kernel version. */
@@ -38,7 +38,7 @@ __fortify_fail_abort (_Bool need_backtrace, const char *msg)
}
void
-__attribute__ ((noreturn)) internal_function
+__attribute__ ((noreturn)) private_function
__fortify_fail (const char *msg)
{
__fortify_fail_abort (true, msg);
@@ -121,7 +121,7 @@ determine_info (const ElfW(Addr) addr, struct link_map *match, Dl_info *info,
int
-internal_function
+private_function
_dl_addr (const void *address, Dl_info *info,
struct link_map **mapp, const ElfW(Sym) **symbolp)
{
@@ -77,7 +77,7 @@ static receiver_fct receiver;
#endif /* DL_ERROR_BOOTSTRAP */
void
-internal_function
+private_function
_dl_signal_error (int errcode, const char *objname, const char *occation,
const char *errstring)
{
@@ -169,7 +169,7 @@ _dl_signal_cerror (int errcode, const char *objname, const char *occation,
int
-internal_function
+private_function
_dl_catch_error (const char **objname, const char **errstring,
bool *mallocedp, void (*operate) (void *), void *args)
{
@@ -23,7 +23,7 @@
so as to mprotect it. */
int
-internal_function
+private_function
_dl_make_stack_executable (void **stack_endp)
{
return ENOSYS;
@@ -2241,7 +2241,7 @@ add_path (struct add_path_state *p, const struct r_search_path_struct *sps,
}
void
-internal_function
+private_function
_dl_rtld_di_serinfo (struct link_map *loader, Dl_serinfo *si, bool counting)
{
if (counting)
@@ -162,7 +162,7 @@ add_to_global (struct link_map *new)
address ADDR. Returns the pointer to the link map of the matching DSO, or
NULL if a match is not found. */
struct link_map *
-internal_function
+private_function
_dl_find_dso_for_object (const ElfW(Addr) addr)
{
struct link_map *l;
@@ -181,7 +181,7 @@ ElfW(Word) _dl_stack_flags = DEFAULT_STACK_PERMS;
/* If loading a shared object requires that we make the stack executable
when it was not, we do it by calling this function.
It returns an errno code or zero on success. */
-int (*_dl_make_stack_executable_hook) (void **) internal_function
+int (*_dl_make_stack_executable_hook) (void **) private_function
= _dl_make_stack_executable;
@@ -250,7 +250,7 @@ RTLD_NEXT used in code not dynamically loaded"));
void *
-internal_function
+private_function
_dl_vsym (void *handle, const char *name, const char *version, void *who)
{
struct r_found_version vers;
@@ -267,7 +267,7 @@ _dl_vsym (void *handle, const char *name, const char *version, void *who)
void *
-internal_function
+private_function
_dl_sym (void *handle, const char *name, void *who)
{
return do_sym (handle, name, who, NULL, DL_LOOKUP_RETURN_NEWEST);
@@ -308,7 +308,7 @@ allocate_dtv (void *result)
/* Get size and alignment requirements of the static TLS block. */
void
-internal_function
+private_function
_dl_get_tls_static_info (size_t *sizep, size_t *alignp)
{
*sizep = GL(dl_tls_static_size);
@@ -439,7 +439,7 @@ _dl_resize_dtv (dtv_t *dtv)
void *
-internal_function
+private_function
_dl_allocate_tls_init (void *result)
{
if (result == NULL)
@@ -532,7 +532,7 @@ _dl_allocate_tls_init (void *result)
rtld_hidden_def (_dl_allocate_tls_init)
void *
-internal_function
+private_function
_dl_allocate_tls (void *mem)
{
return _dl_allocate_tls_init (mem == NULL
@@ -543,7 +543,7 @@ rtld_hidden_def (_dl_allocate_tls)
void
-internal_function
+private_function
_dl_deallocate_tls (void *tcb, bool dealloc_tcb)
{
dtv_t *dtv = GET_DTV (tcb);
@@ -36,7 +36,7 @@
})
int
-internal_function
+private_function
__copy_grp (const struct group srcgrp, const size_t buflen,
struct group *destgrp, char *destbuf, char **endptr)
{
@@ -117,7 +117,7 @@ libc_hidden_def (__copy_grp)
/* Check that the name, GID and passwd fields match, then
copy in the gr_mem array. */
int
-internal_function
+private_function
__merge_grp (struct group *savedgrp, char *savedbuf, char *savedend,
size_t buflen, struct group *mergegrp, char *mergebuf)
{
@@ -26,12 +26,12 @@
int
__copy_grp (const struct group srcgrp, const size_t buflen,
struct group *destgrp, char *destbuf, char **endptr)
- internal_function;
+ private_function;
/* Merge the member lists of two grp structs together. */
int
__merge_grp (struct group *savedgrp, char *savedbuf, char *savedend,
size_t buflen, struct group *mergegrp, char *mergebuf)
- internal_function;
+ private_function;
#endif /* _GRP_MERGE_H */
@@ -44,7 +44,7 @@ libc_hidden_proto (__libc_dlclose)
#ifdef ElfW
extern int _dl_addr (const void *address, Dl_info *info,
struct link_map **mapp, const ElfW(Sym) **symbolp)
- internal_function;
+ private_function;
libc_hidden_proto (_dl_addr)
#endif
@@ -61,7 +61,7 @@ extern void _dl_close_worker (struct link_map *map, bool force)
RTLD_NEXT). WHO is the calling function, for RTLD_NEXT. Returns
the symbol value, which may be NULL. */
extern void *_dl_sym (void *handle, const char *name, void *who)
- internal_function;
+ private_function;
/* Look up version VERSION of symbol NAME in shared object HANDLE
(which may be RTLD_DEFAULT or RTLD_NEXT). WHO is the calling
@@ -69,7 +69,7 @@ extern void *_dl_sym (void *handle, const char *name, void *who)
NULL. */
extern void *_dl_vsym (void *handle, const char *name, const char *version,
void *who)
- internal_function;
+ private_function;
/* Helper function for <dlfcn.h> functions. Runs the OPERATE function via
_dl_catch_error. Returns zero for success, nonzero for failure; and
@@ -196,12 +196,17 @@
#endif /* __ASSEMBLER__ */
/* On some platforms we can make internal function calls (i.e., calls of
- functions not exported) a bit faster by using a different calling
- convention. */
+ functions within the same shared object) or private function calls
+ (i.e., calls of functions between different shared objects of glibc)
+ a bit faster by using a different calling convention. */
#ifndef internal_function
# define internal_function /* empty */
#endif
+#ifndef private_function
+# define private_function /* empty */
+#endif
+
/* Determine the return address. */
#define RETURN_ADDRESS(nr) \
__builtin_extract_return_addr (__builtin_return_address (nr))
@@ -13,7 +13,7 @@ extern int __get_socket (struct sockaddr_in *saddr)
extern u_short __libc_rpc_getport (struct sockaddr_in *address, u_long program,
u_long version, u_int protocol,
time_t timeout_sec, time_t tottimeout_sec)
- internal_function;
+ private_function;
libc_hidden_proto (__libc_rpc_getport)
libc_hidden_proto (clnt_broadcast)
@@ -99,7 +99,7 @@ extern void __libc_fatal (const char *__message)
extern void __libc_message (enum __libc_message_action action,
const char *__fnt, ...);
extern void __fortify_fail (const char *msg)
- __attribute__ ((__noreturn__)) internal_function;
+ __attribute__ ((__noreturn__)) private_function;
extern void __fortify_fail_abort (_Bool, const char *msg)
__attribute__ ((__noreturn__)) internal_function;
libc_hidden_proto (__fortify_fail)
@@ -201,16 +201,18 @@ libc_hidden_proto (strtoll)
libc_hidden_proto (strtoul)
libc_hidden_proto (strtoull)
-extern float __strtof_nan (const char *, char **, char) internal_function;
-extern double __strtod_nan (const char *, char **, char) internal_function;
+extern float __strtof_nan (const char *, char **, char)
+ private_function;
+extern double __strtod_nan (const char *, char **, char)
+ private_function;
extern long double __strtold_nan (const char *, char **, char)
- internal_function;
+ private_function;
extern float __wcstof_nan (const wchar_t *, wchar_t **, wchar_t)
- internal_function;
+ private_function;
extern double __wcstod_nan (const wchar_t *, wchar_t **, wchar_t)
- internal_function;
+ private_function;
extern long double __wcstold_nan (const wchar_t *, wchar_t **, wchar_t)
- internal_function;
+ private_function;
libc_hidden_proto (__strtof_nan)
libc_hidden_proto (__strtod_nan)
@@ -229,9 +231,9 @@ libc_hidden_proto (__strtof128_l)
libc_hidden_proto (strtof128)
extern _Float128 __strtof128_nan (const char *, char **, char)
- internal_function;
+ private_function;
extern _Float128 __wcstof128_nan (const wchar_t *, wchar_t **, wchar_t)
- internal_function;
+ private_function;
libc_hidden_proto (__strtof128_nan)
libc_hidden_proto (__wcstof128_nan)
@@ -28,7 +28,7 @@
/* Parse SOURCE as a scope ID for ADDRESS. Return 0 on success and -1
on error. */
-internal_function int
+private_function int
__inet6_scopeid_pton (const struct in6_addr *address, const char *scope,
uint32_t *result)
{
@@ -26,7 +26,7 @@
int __inet6_scopeid_pton (const struct in6_addr *address,
const char *scope, uint32_t *result)
- internal_function attribute_hidden;
+ private_function attribute_hidden;
libc_hidden_proto (__inet6_scopeid_pton)
@@ -784,7 +784,7 @@ __deallocate_stack (struct pthread *pd)
int
-internal_function
+private_function
__make_stacks_executable (void **stack_endp)
{
/* First the main thread's stack. */
@@ -38,7 +38,7 @@ extern int __libc_multiple_threads attribute_hidden;
int *
#endif
-internal_function
+private_function
__libc_pthread_init (unsigned long int *ptr, void (*reclaim) (void),
const struct pthread_functions *functions)
{
@@ -357,7 +357,7 @@ extern void __reclaim_stacks (void) attribute_hidden;
/* Make all threads's stacks executable. */
extern int __make_stacks_executable (void **stack_endp)
- internal_function attribute_hidden;
+ private_function attribute_hidden;
/* longjmp handling. */
extern void __pthread_cleanup_upto (__jmp_buf target, char *targetframe);
@@ -388,12 +388,12 @@ hidden_proto (__nptl_death_event)
extern void __libc_pthread_init (unsigned long int *ptr,
void (*reclaim) (void),
const struct pthread_functions *functions)
- internal_function;
+ private_function;
#else
extern int *__libc_pthread_init (unsigned long int *ptr,
void (*reclaim) (void),
const struct pthread_functions *functions)
- internal_function;
+ private_function;
/* Variable set to a nonzero value either if more than one thread runs or ran,
or if a single-threaded process is trying to cancel itself. See
@@ -57,11 +57,11 @@ service_user *DATABASE_NAME_SYMBOL attribute_hidden;
extern int DB_LOOKUP_FCT (service_user **ni, const char *fct_name,
const char *fct2_name, void **fctp)
- internal_function;
+ private_function;
libc_hidden_proto (DB_LOOKUP_FCT)
int
-internal_function
+private_function
DB_LOOKUP_FCT (service_user **ni, const char *fct_name, const char *fct2_name,
void **fctp)
{
@@ -79,7 +79,7 @@ libc_hidden_def (DB_LOOKUP_FCT)
#ifndef NO_COMPAT
int
-internal_function attribute_compat_text_section
+private_function attribute_compat_text_section
DB_COMPAT_FCT (service_user **ni, const char *fct_name, void **fctp)
{
return DB_LOOKUP_FCT (ni, fct_name, NULL, fctp);
@@ -181,7 +181,7 @@ typedef enum nss_status (*lookup_function) (ADD_PARAMS, LOOKUP_TYPE *, char *,
/* The lookup function for the first entry of this service. */
extern int DB_LOOKUP_FCT (service_user **nip, const char *name,
const char *name2, void **fctp)
- internal_function;
+ private_function;
libc_hidden_proto (DB_LOOKUP_FCT)
@@ -114,7 +114,7 @@ __libc_lock_define_initialized (static, lock)
/* The lookup function for the first entry of this service. */
extern int DB_LOOKUP_FCT (service_user **nip, const char *name,
const char *name2, void **fctp)
- internal_function;
+ private_function;
libc_hidden_proto (DB_LOOKUP_FCT)
void
@@ -169,7 +169,7 @@ extern void __nss_disable_nscd (void (*) (size_t, struct traced_file *));
typedef int (*db_lookup_function) (service_user **, const char *, const char *,
void **)
- internal_function;
+ private_function;
typedef enum nss_status (*setent_function) (int);
typedef enum nss_status (*endent_function) (void);
typedef enum nss_status (*getent_function) (void *, char *, size_t,
@@ -96,6 +96,6 @@ extern int __gai_notify_only (struct sigevent *sigev, pid_t caller_pid)
/* Send the signal. */
extern int __gai_sigqueue (int sig, const union sigval val, pid_t caller_pid)
- internal_function;
+ private_function;
#endif /* gai_misc.h */
@@ -22,7 +22,7 @@
#include <gai_misc.h>
int
-internal_function
+private_function
__gai_sigqueue (int sig, const union sigval val, pid_t caller_pid)
{
__set_errno (ENOSYS);
@@ -29,7 +29,7 @@
return a default NAN. If ENDPTR is not NULL, set *ENDPTR to point
to the character after the initial n-char-sequence. */
-internal_function
+private_function
FLOAT
STRTOD_NAN (const STRING_TYPE *str, STRING_TYPE **endptr, STRING_TYPE endc)
{
@@ -82,7 +82,7 @@ __get_socket (struct sockaddr_in *saddr)
* Returns 0 if no map exists.
*/
u_short
-internal_function
+private_function
__libc_rpc_getport (struct sockaddr_in *address, u_long program,
u_long version, u_int protocol, time_t timeout_sec,
time_t tottimeout_sec)
@@ -377,7 +377,7 @@ struct rtld_global
/* If loading a shared object requires that we make the stack executable
when it was not, we do it by calling this function.
It returns an errno code or zero on success. */
- EXTERN int (*_dl_make_stack_executable_hook) (void **) internal_function;
+ EXTERN int (*_dl_make_stack_executable_hook) (void **) private_function;
/* Prevailing state of the stack, PF_X indicating it's executable. */
EXTERN ElfW(Word) _dl_stack_flags;
@@ -632,7 +632,7 @@ extern size_t _dl_phnum;
/* This is the initial value of GL(dl_make_stack_executable_hook).
A threads library can change it. */
-extern int _dl_make_stack_executable (void **stack_endp) internal_function;
+extern int _dl_make_stack_executable (void **stack_endp) private_function;
rtld_hidden_proto (_dl_make_stack_executable)
/* Variable pointing to the end of the stack (or close to it). This value
@@ -739,7 +739,7 @@ _dl_dprintf (int fd, const char *fmt, ...)
problem. */
extern void _dl_signal_error (int errcode, const char *object,
const char *occurred, const char *errstring)
- internal_function __attribute__ ((__noreturn__));
+ private_function __attribute__ ((__noreturn__));
libc_hidden_proto (_dl_signal_error)
/* Like _dl_signal_error, but may return when called in the context of
@@ -779,7 +779,7 @@ extern void _dl_receive_error (receiver_fct fct, void (*operate) (void *),
extern int _dl_catch_error (const char **objname, const char **errstring,
bool *mallocedp, void (*operate) (void *),
void *args)
- internal_function;
+ private_function;
libc_hidden_proto (_dl_catch_error)
/* Open the shared object NAME and map in its segments.
@@ -813,7 +813,7 @@ extern void _dl_setup_hash (struct link_map *map)
bytes to be used in filling in the result. */
extern void _dl_rtld_di_serinfo (struct link_map *loader,
Dl_serinfo *si, bool counting)
- internal_function;
+ private_function;
/* Search loaded objects' symbol tables for a definition of the symbol
@@ -1012,12 +1012,12 @@ void __pthread_initialize_minimal (void) weak_function;
#endif
/* Allocate memory for static TLS block (unless MEM is nonzero) and dtv. */
-extern void *_dl_allocate_tls (void *mem) internal_function;
+extern void *_dl_allocate_tls (void *mem) private_function;
rtld_hidden_proto (_dl_allocate_tls)
/* Get size and alignment requirements of the static TLS block. */
extern void _dl_get_tls_static_info (size_t *sizep, size_t *alignp)
- internal_function;
+ private_function;
extern void _dl_allocate_static_tls (struct link_map *map)
internal_function attribute_hidden;
@@ -1026,11 +1026,11 @@ extern void _dl_allocate_static_tls (struct link_map *map)
only used within rtld.c itself at startup time. */
extern void *_dl_allocate_tls_storage (void)
internal_function attribute_hidden;
-extern void *_dl_allocate_tls_init (void *) internal_function;
+extern void *_dl_allocate_tls_init (void *) private_function;
rtld_hidden_proto (_dl_allocate_tls_init)
/* Deallocate memory allocated with _dl_allocate_tls. */
-extern void _dl_deallocate_tls (void *tcb, bool dealloc_tcb) internal_function;
+extern void _dl_deallocate_tls (void *tcb, bool dealloc_tcb) private_function;
rtld_hidden_proto (_dl_deallocate_tls)
extern void _dl_nothread_init_static_tls (struct link_map *) attribute_hidden;
@@ -1081,7 +1081,7 @@ extern void _dl_show_scope (struct link_map *new, int from)
attribute_hidden;
extern struct link_map *_dl_find_dso_for_object (const ElfW(Addr) addr)
- internal_function;
+ private_function;
rtld_hidden_proto (_dl_find_dso_for_object)
/* Initialization which is normally done by the dynamic linker. */
@@ -26,7 +26,7 @@ libc_compiler_builtin_inlined=no
cat > conftest.c <<EOF
int _start (void) { int a, b, c; __sync_val_compare_and_swap (&a, b, c); return 0; }
EOF
-if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
-O0 -nostdlib -nostartfiles
-S conftest.c -o - | fgrep "__sync_val_compare_and_swap"
1>&5'
@@ -77,7 +77,13 @@ if test $libc_cv_asm_mpx = yes; then
fi
-$as_echo "#define USE_REGPARMS 1" >>confdefs.h
+# On i386, we can make internal function calls (i.e., calls of functions
+# within the same shared object) or private function calls (i.e., calls
+# of functions between different shared objects of glibc) a bit faster
+# by passing function parameters in registers.
+$as_echo "#define internal_function __attribute__ ((regparm (3), stdcall))" >>confdefs.h
+
+$as_echo "#define private_function __attribute__ ((regparm (3), stdcall))" >>confdefs.h
$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
@@ -45,7 +45,12 @@ if test $libc_cv_asm_mpx = yes; then
AC_DEFINE(HAVE_MPX_SUPPORT)
fi
-AC_DEFINE(USE_REGPARMS)
+# On i386, we can make internal function calls (i.e., calls of functions
+# within the same shared object) or private function calls (i.e., calls
+# of functions between different shared objects of glibc) a bit faster
+# by passing function parameters in registers.
+AC_DEFINE(internal_function, __attribute__ ((regparm (3), stdcall)))
+AC_DEFINE(private_function, __attribute__ ((regparm (3), stdcall)))
dnl It is always possible to access static and hidden symbols in an
dnl position independent way.
@@ -30,7 +30,7 @@ extern int __stack_prot attribute_relro attribute_hidden;
int
-internal_function
+private_function
_dl_make_stack_executable (void **stack_endp)
{
/* This gives us the highest/lowest page that needs to be changed. */
@@ -30,7 +30,7 @@
/* Return any pending signal or wait for one for the given time. */
int
-internal_function
+private_function
__gai_sigqueue (int sig, const union sigval val, pid_t caller_pid)
{
siginfo_t info;
@@ -39,7 +39,7 @@ get_address_family (int fd)
}
void
-internal_function
+private_function
__netlink_assert_response (int fd, ssize_t result)
{
if (result < 0)
@@ -52,7 +52,7 @@ extern int __netlink_request (struct netlink_handle *h, int type);
/* Terminate the process if RESULT is an invalid recvmsg result for
the netlink socket FD. */
void __netlink_assert_response (int fd, ssize_t result)
- internal_function;
+ private_function;
libc_hidden_proto (__netlink_assert_response)
#endif /* netlinkaccess.h */