summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--libio/oldiofopen.c2
-rw-r--r--libio/oldtmpfile.c2
-rw-r--r--linuxthreads/ChangeLog5
-rw-r--r--linuxthreads/attr.c9
-rw-r--r--linuxthreads/oldsemaphore.c10
-rw-r--r--linuxthreads/pthread.c2
-rw-r--r--linuxthreads/semaphore.c33
-rw-r--r--linuxthreads/weaks.c15
-rw-r--r--sysdeps/unix/sysv/linux/errlist.c4
10 files changed, 40 insertions, 43 deletions
diff --git a/ChangeLog b/ChangeLog
index 70cb93522d..cd2594e8c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
* libio/oldtmpfile.c: Update for new SHLIB_COMPAT definition.
* libio/oldiofopen.c: Likewise.
* libio/oldiofclose.c: Likewise.
+ * sysdeps/unix/sysv/linux/errlist.c: Likewise.
2000-03-22 Roland McGrath <roland@baalperazim.frob.com>
diff --git a/libio/oldiofopen.c b/libio/oldiofopen.c
index 1461fbc519..a8c9a9e1f4 100644
--- a/libio/oldiofopen.c
+++ b/libio/oldiofopen.c
@@ -24,7 +24,7 @@
General Public License. */
#include <shlib-compat.h>
-#if SHLIB_COMPAT (libc, GLIBC_2_0)
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
#define _IO_USE_OLD_IO_FILE
#include "libioP.h"
diff --git a/libio/oldtmpfile.c b/libio/oldtmpfile.c
index 37b52a44ab..048b538429 100644
--- a/libio/oldtmpfile.c
+++ b/libio/oldtmpfile.c
@@ -17,7 +17,7 @@
Boston, MA 02111-1307, USA. */
#include <shlib-compat.h>
-#if SHLIB_COMPAT (libc, GLIBC_2_0)
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
#define _IO_USE_OLD_IO_FILE
#include <stdio.h>
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 0c10a8ff5d..6d28f909c0 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,5 +1,10 @@
2000-03-21 Ulrich Drepper <drepper@redhat.com>
+ * attr.c: Use new macros from shlib-compat.h to define versions.
+ * oldsemaphore.c: Likewise.
+ * semaphore.c: Likewise.
+ * weaks.c: Likewise.
+
* pthread.c: Update for new SHLIB_COMPAT definition.
* manager.c (__pthread_manager): Unmask debug signal.
diff --git a/linuxthreads/attr.c b/linuxthreads/attr.c
index 2a70ebe674..992234aadf 100644
--- a/linuxthreads/attr.c
+++ b/linuxthreads/attr.c
@@ -20,6 +20,7 @@
#include <sys/param.h>
#include "pthread.h"
#include "internals.h"
+#include <shlib-compat.h>
int __pthread_attr_init_2_1(pthread_attr_t *attr)
{
@@ -36,9 +37,11 @@ int __pthread_attr_init_2_1(pthread_attr_t *attr)
attr->__stacksize = STACK_SIZE - ps;
return 0;
}
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
-default_symbol_version (__pthread_attr_init_2_1, pthread_attr_init, GLIBC_2.1);
+versioned_symbol (libpthread, __pthread_attr_init_2_1, pthread_attr_init,
+ GLIBC_2_1);
+
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
int __pthread_attr_init_2_0(pthread_attr_t *attr)
{
attr->__detachstate = PTHREAD_CREATE_JOINABLE;
@@ -49,8 +52,6 @@ int __pthread_attr_init_2_0(pthread_attr_t *attr)
return 0;
}
symbol_version (__pthread_attr_init_2_0, pthread_attr_init, GLIBC_2.0);
-#else
-strong_alias (__pthread_attr_init_2_1, pthread_attr_init)
#endif
int pthread_attr_destroy(pthread_attr_t *attr)
diff --git a/linuxthreads/oldsemaphore.c b/linuxthreads/oldsemaphore.c
index 62d2812693..c6f44cfce2 100644
--- a/linuxthreads/oldsemaphore.c
+++ b/linuxthreads/oldsemaphore.c
@@ -19,6 +19,8 @@
/* GNU Library General Public License for more details. */
/* Semaphores a la POSIX 1003.1b */
+#include <shlib-compat.h>
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
#include <errno.h>
#include "pthread.h"
@@ -90,7 +92,7 @@ int __old_sem_wait(old_sem_t * sem)
while (1) {
/* Register extrication interface */
- __pthread_set_own_extricate_if(self, &extr);
+ __pthread_set_own_extricate_if(self, &extr);
do {
oldstatus = sem->sem_status;
if ((oldstatus & 1) && (oldstatus != 1))
@@ -103,12 +105,12 @@ int __old_sem_wait(old_sem_t * sem)
while (! sem_compare_and_swap(sem, oldstatus, newstatus));
if (newstatus & 1) {
/* We got the semaphore. */
- __pthread_set_own_extricate_if(self, 0);
+ __pthread_set_own_extricate_if(self, 0);
return 0;
}
/* Wait for sem_post or cancellation */
suspend(self);
- __pthread_set_own_extricate_if(self, 0);
+ __pthread_set_own_extricate_if(self, 0);
/* This is a cancellation point */
if (self->p_canceled && self->p_cancelstate == PTHREAD_CANCEL_ENABLE) {
@@ -224,11 +226,11 @@ static void sem_restart_list(pthread_descr waiting)
}
}
-#if defined PIC && DO_VERSIONING
symbol_version (__old_sem_init, sem_init, GLIBC_2.0);
symbol_version (__old_sem_wait, sem_wait, GLIBC_2.0);
symbol_version (__old_sem_trywait, sem_trywait, GLIBC_2.0);
symbol_version (__old_sem_post, sem_post, GLIBC_2.0);
symbol_version (__old_sem_getvalue, sem_getvalue, GLIBC_2.0);
symbol_version (__old_sem_destroy, sem_destroy, GLIBC_2.0);
+
#endif
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index e5010b9261..6ac7bc9170 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -517,7 +517,7 @@ int __pthread_create_2_1(pthread_t *thread, const pthread_attr_t *attr,
versioned_symbol (libpthread, __pthread_create_2_1, pthread_create, GLIBC_2_1);
-#if SHLIB_COMPAT (libpthread, GLIBC_2_0)
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1)
int __pthread_create_2_0(pthread_t *thread, const pthread_attr_t *attr,
void * (*start_routine)(void *), void *arg)
diff --git a/linuxthreads/semaphore.c b/linuxthreads/semaphore.c
index 0297b3a1e3..c4a4f6e042 100644
--- a/linuxthreads/semaphore.c
+++ b/linuxthreads/semaphore.c
@@ -21,6 +21,7 @@
#include "spinlock.h"
#include "restart.h"
#include "queue.h"
+#include <shlib-compat.h>
int __new_sem_init(sem_t *sem, int pshared, unsigned int value)
{
@@ -71,7 +72,7 @@ int __new_sem_wait(sem_t * sem)
return 0;
}
/* Register extrication interface */
- __pthread_set_own_extricate_if(self, &extr);
+ __pthread_set_own_extricate_if(self, &extr);
/* Enqueue only if not already cancelled. */
if (!(THREAD_GETMEM(self, p_canceled)
&& THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE))
@@ -81,13 +82,13 @@ int __new_sem_wait(sem_t * sem)
__pthread_unlock((struct _pthread_fastlock *) &sem->__sem_lock);
if (already_canceled) {
- __pthread_set_own_extricate_if(self, 0);
+ __pthread_set_own_extricate_if(self, 0);
pthread_exit(PTHREAD_CANCELED);
- }
+ }
/* Wait for sem_post or cancellation, or fall through if already canceled */
suspend(self);
- __pthread_set_own_extricate_if(self, 0);
+ __pthread_set_own_extricate_if(self, 0);
/* Terminate only if the wakeup came from cancellation. */
/* Otherwise ignore cancellation because we got the semaphore. */
@@ -189,21 +190,9 @@ int sem_unlink(const char *name)
return -1;
}
-#if defined PIC && DO_VERSIONING
-default_symbol_version (__new_sem_init, sem_init, GLIBC_2.1);
-default_symbol_version (__new_sem_wait, sem_wait, GLIBC_2.1);
-default_symbol_version (__new_sem_trywait, sem_trywait, GLIBC_2.1);
-default_symbol_version (__new_sem_post, sem_post, GLIBC_2.1);
-default_symbol_version (__new_sem_getvalue, sem_getvalue, GLIBC_2.1);
-default_symbol_version (__new_sem_destroy, sem_destroy, GLIBC_2.1);
-#else
-# ifdef weak_alias
-weak_alias (__new_sem_init, sem_init)
-weak_alias (__new_sem_wait, sem_wait)
-weak_alias (__new_sem_trywait, sem_trywait)
-weak_alias (__new_sem_post, sem_post)
-weak_alias (__new_sem_getvalue, sem_getvalue)
-weak_alias (__new_sem_destroy, sem_destroy)
-# endif
-#endif
-
+versioned_symbol (libpthread, __new_sem_init, sem_init, GLIBC_2_1);
+versioned_symbol (libpthread, __new_sem_wait, sem_wait, GLIBC_2_1);
+versioned_symbol (libpthread, __new_sem_trywait, sem_trywait, GLIBC_2_1);
+versioned_symbol (libpthread, __new_sem_post, sem_post, GLIBC_2_1);
+versioned_symbol (libpthread, __new_sem_getvalue, sem_getvalue, GLIBC_2_1);
+versioned_symbol (libpthread, __new_sem_destroy, sem_destroy, GLIBC_2_1);
diff --git a/linuxthreads/weaks.c b/linuxthreads/weaks.c
index d6d028f2ec..a91f5cfb02 100644
--- a/linuxthreads/weaks.c
+++ b/linuxthreads/weaks.c
@@ -1,5 +1,5 @@
/* The weak pthread functions for Linux.
- Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000 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
@@ -20,20 +20,19 @@
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
+#include <shlib-compat.h>
extern int __pthread_return_0 (void);
extern int __pthread_return_1 (void);
extern void __pthread_return_void (void);
/* Those are pthread functions which return 0 if successful. */
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
-weak_alias (__pthread_return_0, __libc_pthread_attr_init_2_0)
-symbol_version (__libc_pthread_attr_init_2_0, pthread_attr_init, GLIBC_2.0);
weak_alias (__pthread_return_0, __libc_pthread_attr_init_2_1)
-default_symbol_version (__libc_pthread_attr_init_2_1, pthread_attr_init,
- GLIBC_2.1);
-#else
-weak_alias (__pthread_return_0, pthread_attr_init)
+versioned_symbol (libpthread, __libc_pthread_attr_init_2_1, pthread_attr_init,
+ GLIBC_2_1);
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
+weak_alias (__pthread_return_0, __libc_pthread_attr_init_2_0)
+symbol_version (__libc_pthread_attr_init_2_, pthread_attr_init, GLIBC_2.0);
#endif
weak_alias (__pthread_return_0, pthread_attr_destroy)
weak_alias (__pthread_return_0, pthread_attr_setdetachstate)
diff --git a/sysdeps/unix/sysv/linux/errlist.c b/sysdeps/unix/sysv/linux/errlist.c
index 8c7ce92b58..4fbc2cab0b 100644
--- a/sysdeps/unix/sysv/linux/errlist.c
+++ b/sysdeps/unix/sysv/linux/errlist.c
@@ -23,13 +23,13 @@
#define SYS_ERRLIST __new_sys_errlist
#define SYS_NERR __new_sys_nerr
-#if SHLIB_COMPAT (libc, GLIBC_2_0)
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
asm (".data; .globl __old_sys_errlist; __old_sys_errlist:");
#endif
#include <sysdeps/gnu/errlist.c>
-#if SHLIB_COMPAT (libc, GLIBC_2_0)
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
asm (".type __old_sys_errlist,@object;.size __old_sys_errlist,"
OLD_ERRLIST_SIZE_STR "*" PTR_SIZE_STR);