diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | elf/dl-open.c | 3 | ||||
-rw-r--r-- | include/libc-symbols.h | 17 | ||||
-rw-r--r-- | linuxthreads/sysdeps/pthread/bits/libc-lock.h | 83 |
4 files changed, 61 insertions, 52 deletions
diff --git a/ChangeLog b/ChangeLog index ee1b542a4f..5daa90b44e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2000-06-27 Greg McGary <greg@mcgary.org> + + * elf/dl-open.c (_dl_sysdep_start): Wrap weak_extern decl in BP_SYM (). + * include/libc-symbols.h (weak_extern): Add extra level of expansion. + (symbol_version, default_symbol_version): Factor redundant + definitions out of conditional. + * linuxthreads/sysdeps/pthread/bits/libc-lock.h: + Wrap BP_SYM () around weak extern declarations of pthread + functions that have pointers in their return+arg signatures. + 2000-06-27 Jakub Jelinek <jakub@redhat.com> * libio/obprintf.c (_IO_obstack_vprintf): Call obstack_make_room, diff --git a/elf/dl-open.c b/elf/dl-open.c index 17af8842d6..e5628b6f06 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -28,6 +28,7 @@ #include <sys/param.h> #include <bits/libc-lock.h> #include <ldsodefs.h> +#include <bp-sym.h> #include <dl-dst.h> @@ -36,7 +37,7 @@ extern ElfW(Addr) _dl_sysdep_start (void **start_argptr, void (*dl_main) (const ElfW(Phdr) *phdr, ElfW(Word) phnum, ElfW(Addr) *user_entry)); -weak_extern (_dl_sysdep_start) +weak_extern (BP_SYM (_dl_sysdep_start)) /* This function is used to unload the cache file if necessary. */ extern void _dl_unload_cache (void); diff --git a/include/libc-symbols.h b/include/libc-symbols.h index d30ac674f0..7e41774179 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -97,10 +97,11 @@ extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))); /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */ +# define weak_extern(symbol) _weak_extern (symbol) # ifdef HAVE_ASM_WEAKEXT_DIRECTIVE -# define weak_extern(symbol) asm (".weakext " __SYMBOL_PREFIX #symbol); +# define _weak_extern(symbol) asm (".weakext " __SYMBOL_PREFIX #symbol); # else -# define weak_extern(symbol) asm (".weak " __SYMBOL_PREFIX #symbol); +# define _weak_extern(symbol) asm (".weak " __SYMBOL_PREFIX #symbol); # endif # else @@ -267,22 +268,18 @@ #endif /* Have GNU ld. */ #if DO_VERSIONING -# ifdef __ASSEMBLER__ -# define symbol_version(real, name, version) \ +# define symbol_version(real, name, version) \ _symbol_version(real, name, version) +# define default_symbol_version(real, name, version) \ + _default_symbol_version(real, name, version) +# ifdef __ASSEMBLER__ # define _symbol_version(real, name, version) \ .symver real, name##@##version -# define default_symbol_version(real, name, version) \ - _default_symbol_version(real, name, version) # define _default_symbol_version(real, name, version) \ .symver real, name##@##@##version # else -# define symbol_version(real, name, version) \ - _symbol_version(real, name, version) # define _symbol_version(real, name, version) \ __asm__ (".symver " #real "," #name "@" #version) -# define default_symbol_version(real, name, version) \ - _default_symbol_version(real, name, version) # define _default_symbol_version(real, name, version) \ __asm__ (".symver " #real "," #name "@@" #version) # endif diff --git a/linuxthreads/sysdeps/pthread/bits/libc-lock.h b/linuxthreads/sysdeps/pthread/bits/libc-lock.h index 29584ed4d8..5761411268 100644 --- a/linuxthreads/sysdeps/pthread/bits/libc-lock.h +++ b/linuxthreads/sysdeps/pthread/bits/libc-lock.h @@ -246,53 +246,54 @@ extern int __pthread_atfork (void (*__prepare) (void), /* Make the pthread functions weak so that we can elide them from single-threaded processes. */ #ifndef __NO_WEAK_PTHREAD_ALIASES +# include <bp-sym.h> # ifdef weak_extern -weak_extern (__pthread_mutex_init) -weak_extern (__pthread_mutex_destroy) -weak_extern (__pthread_mutex_lock) -weak_extern (__pthread_mutex_trylock) -weak_extern (__pthread_mutex_unlock) -weak_extern (__pthread_mutexattr_init) -weak_extern (__pthread_mutexattr_destroy) -weak_extern (__pthread_mutexattr_settype) -weak_extern (__pthread_rwlock_init) -weak_extern (__pthread_rwlock_destroy) -weak_extern (__pthread_rwlock_rdlock) -weak_extern (__pthread_rwlock_tryrdlock) -weak_extern (__pthread_rwlock_wrlock) -weak_extern (__pthread_rwlock_trywrlock) -weak_extern (__pthread_rwlock_unlock) -weak_extern (__pthread_key_create) -weak_extern (__pthread_setspecific) -weak_extern (__pthread_getspecific) -weak_extern (__pthread_once) +weak_extern (BP_SYM (__pthread_mutex_init)) +weak_extern (BP_SYM (__pthread_mutex_destroy)) +weak_extern (BP_SYM (__pthread_mutex_lock)) +weak_extern (BP_SYM (__pthread_mutex_trylock)) +weak_extern (BP_SYM (__pthread_mutex_unlock)) +weak_extern (BP_SYM (__pthread_mutexattr_init)) +weak_extern (BP_SYM (__pthread_mutexattr_destroy)) +weak_extern (BP_SYM (__pthread_mutexattr_settype)) +weak_extern (BP_SYM (__pthread_rwlock_init)) +weak_extern (BP_SYM (__pthread_rwlock_destroy)) +weak_extern (BP_SYM (__pthread_rwlock_rdlock)) +weak_extern (BP_SYM (__pthread_rwlock_tryrdlock)) +weak_extern (BP_SYM (__pthread_rwlock_wrlock)) +weak_extern (BP_SYM (__pthread_rwlock_trywrlock)) +weak_extern (BP_SYM (__pthread_rwlock_unlock)) +weak_extern (BP_SYM (__pthread_key_create)) +weak_extern (BP_SYM (__pthread_setspecific)) +weak_extern (BP_SYM (__pthread_getspecific)) +weak_extern (BP_SYM (__pthread_once)) weak_extern (__pthread_initialize) weak_extern (__pthread_atfork) -weak_extern (_pthread_cleanup_push_defer) -weak_extern (_pthread_cleanup_pop_restore) +weak_extern (BP_SYM (_pthread_cleanup_push_defer)) +weak_extern (BP_SYM (_pthread_cleanup_pop_restore)) # else -# pragma weak __pthread_mutex_init -# pragma weak __pthread_mutex_destroy -# pragma weak __pthread_mutex_lock -# pragma weak __pthread_mutex_trylock -# pragma weak __pthread_mutex_unlock -# pragma weak __pthread_mutexattr_init -# pragma weak __pthread_mutexattr_destroy -# pragma weak __pthread_mutexattr_settype -# pragma weak __pthread_rwlock_destroy -# pragma weak __pthread_rwlock_rdlock -# pragma weak __pthread_rwlock_tryrdlock -# pragma weak __pthread_rwlock_wrlock -# pragma weak __pthread_rwlock_trywrlock -# pragma weak __pthread_rwlock_unlock -# pragma weak __pthread_key_create -# pragma weak __pthread_setspecific -# pragma weak __pthread_getspecific -# pragma weak __pthread_once +# pragma weak BP_SYM (__pthread_mutex_init) +# pragma weak BP_SYM (__pthread_mutex_destroy) +# pragma weak BP_SYM (__pthread_mutex_lock) +# pragma weak BP_SYM (__pthread_mutex_trylock) +# pragma weak BP_SYM (__pthread_mutex_unlock) +# pragma weak BP_SYM (__pthread_mutexattr_init) +# pragma weak BP_SYM (__pthread_mutexattr_destroy) +# pragma weak BP_SYM (__pthread_mutexattr_settype) +# pragma weak BP_SYM (__pthread_rwlock_destroy) +# pragma weak BP_SYM (__pthread_rwlock_rdlock) +# pragma weak BP_SYM (__pthread_rwlock_tryrdlock) +# pragma weak BP_SYM (__pthread_rwlock_wrlock) +# pragma weak BP_SYM (__pthread_rwlock_trywrlock) +# pragma weak BP_SYM (__pthread_rwlock_unlock) +# pragma weak BP_SYM (__pthread_key_create) +# pragma weak BP_SYM (__pthread_setspecific) +# pragma weak BP_SYM (__pthread_getspecific) +# pragma weak BP_SYM (__pthread_once) # pragma weak __pthread_initialize # pragma weak __pthread_atfork -# pragma weak _pthread_cleanup_push_defer -# pragma weak _pthread_cleanup_pop_restore +# pragma weak BP_SYM (_pthread_cleanup_push_defer) +# pragma weak BP_SYM (_pthread_cleanup_pop_restore) # endif #endif |