This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

shlib-compat and PIC patches



I've used the shlib-compat macros in a couple of more files (the old
macros are used now only in the <feenv.h> files) and fixed also some
places which used PIC to use the right defines (SHARED or __PIC__).

A patch is appended.

Andreas

For linuxthreads:
2000-04-01  Andreas Jaeger  <aj@suse.de>

	* attr.c: Use shlib-compat macros.
	* oldsemaphore.c: Likewise.
	* pthread.c: Likewise.
	* weaks.c: Likewise.

2000-04-01  Andreas Jaeger  <aj@suse.de>

	* sysdeps/mach/hurd/mips/init-first.c: Use SHARED instead of PIC.

	* sysdeps/unix/mips/sysdep.h: Use __PIC__ instead of PIC.
	* sysdeps/mach/mips/thread_state.h: Likewise.

	* sysdeps/generic/fclrexcpt.c: Use shlib-compat macros.
	* sysdeps/generic/fegetenv.c: Likewise.
	* sysdeps/generic/fesetenv.c: Likewise.
	* sysdeps/generic/feupdateenv.c: Likewise.
	* sysdeps/generic/fraiseexcpt.c: Likewise.
	* sysdeps/generic/fsetexcptflg.c: Likewise.
	* sysdeps/unix/sysv/linux/alpha/glob.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/errlist.c: Likewise.
	* sysdeps/unix/sysv/linux/errlist.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/chown.c: Likewise.

============================================================
Index: sysdeps/mach/hurd/mips/init-first.c
--- sysdeps/mach/hurd/mips/init-first.c	1998/06/29 12:43:07	1.3
+++ sysdeps/mach/hurd/mips/init-first.c	2000/04/03 22:01:24
@@ -1,5 +1,5 @@
 /* Initialization code run first thing by the ELF startup code.  For Mips/Hurd.
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 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
@@ -109,7 +109,7 @@
   /* This is a hack to make the special getopt in GNU libc working.  */
   __getopt_clean_environment (envp);
 
-#ifdef PIC
+#ifdef SHARED
   __libc_global_ctors ();
 #endif
 
@@ -175,7 +175,7 @@
   (void) &__init;
 }
 
-#ifdef PIC
+#ifdef SHARED
 /* This function is called to initialize the shared C library.
    It is called just before the user _start code from mips/elf/start.S,
    with the stack set up as that code gets it.  */
@@ -274,7 +274,7 @@
 }
 #endif
 
-#ifndef PIC
+#ifndef SHARED
 /* An assembler code wrapping c function __init.  */
 #ifdef __mips64
 asm ("\
============================================================
Index: sysdeps/unix/mips/sysdep.h
--- sysdeps/unix/mips/sysdep.h	1999/08/24 20:59:51	1.7
+++ sysdeps/unix/mips/sysdep.h	2000/04/03 22:01:24
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1992,95,97,99,2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Brendan Kehoe (brendan@zen.org).
 
@@ -32,7 +32,7 @@
 /* Note that while it's better structurally, going back to call __syscall_error
    can make things confusing if you're debugging---it looks like it's jumping
    backwards into the previous fn.  */
-#ifdef PIC
+#ifdef __PIC__
  #define PSEUDO(name, syscall_name, args) \
   .align 2;								      \
   99: la t9,__syscall_error;						      \
============================================================
Index: sysdeps/mach/mips/thread_state.h
--- sysdeps/mach/mips/thread_state.h	1998/09/23 16:34:46	1.7
+++ sysdeps/mach/mips/thread_state.h	2000/04/03 22:01:24
@@ -1,5 +1,5 @@
 /* Mach thread state definitions for machine-independent code.  MIPS version.
-   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 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,7 +20,7 @@
 #define MACHINE_THREAD_STATE_FLAVOR	MIPS_THREAD_STATE
 #define MACHINE_THREAD_STATE_COUNT	MIPS_THREAD_STATE_COUNT
 
-#ifdef PIC
+#ifdef __PIC__
 #define MACHINE_THREAD_STATE_SET_PC(ts, pc) \
   ((ts)->PC = (ts)->r25 = (unsigned long int) (pc))
 #endif
============================================================
Index: sysdeps/generic/fclrexcpt.c
--- sysdeps/generic/fclrexcpt.c	2000/02/26 01:09:38	1.3
+++ sysdeps/generic/fclrexcpt.c	2000/04/03 22:01:24
@@ -19,6 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <fenv.h>
+#include <shlib-compat.h>
 
 int
 __feclearexcept (int excepts)
@@ -26,9 +27,11 @@
   /* This always fails.  */
   return 1;
 }
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
 strong_alias (__feclearexcept, __old_feclearexcept)
-symbol_version (__old_feclearexcept, feclearexcept, GLIBC_2.1);
-default_symbol_version (__feclearexcept, feclearexcept, GLIBC_2.2);
+compat_symbol (libm, __old_feclearexcept, feclearexcept, GLIBC_2_1);
+#endif
+versioned_symbol (libm, __feclearexcept, feclearexcept, GLIBC_2_2);
 
 stub_warning (feclearexcept)
 #include <stub-tag.h>
============================================================
Index: sysdeps/generic/fegetenv.c
--- sysdeps/generic/fegetenv.c	2000/02/26 01:09:38	1.3
+++ sysdeps/generic/fegetenv.c	2000/04/03 22:01:24
@@ -19,6 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <fenv.h>
+#include <shlib-compat.h>
 
 int
 fegetenv (fenv_t *envp)
@@ -26,9 +27,11 @@
   /* This always fails.  */
   return 1;
 }
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
 strong_alias (__fegetenv, __old_fegetenv)
-symbol_version (__old_fegetenv, fegetenv, GLIBC_2.1);
-default_symbol_version (__fegetenv, fegetenv, GLIBC_2.2);
+compat_symbol (libm, __old_fegetenv, fegetenv, GLIBC_2_1);
+#endif
+versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2);
 
 stub_warning (fegetenv)
 #include <stub-tag.h>
============================================================
Index: sysdeps/generic/fesetenv.c
--- sysdeps/generic/fesetenv.c	2000/02/26 01:09:38	1.3
+++ sysdeps/generic/fesetenv.c	2000/04/03 22:01:24
@@ -19,6 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <fenv.h>
+#include <shlib-compat.h>
 
 int
 __fesetenv (const fenv_t *envp)
@@ -26,9 +27,11 @@
   /* This always fails.  */
   return 1;
 }
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
 strong_alias (__fesetenv, __old_fesetenv)
-symbol_version (__old_fesetenv, fesetenv, GLIBC_2.1);
-default_symbol_version (__fesetenv, fesetenv, GLIBC_2.2);
+compat_symbol (libm, __old_fesetenv, fesetenv, GLIBC_2_1);
+#endif
+versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2);
 
 stub_warning (fesetenv)
 #include <stub-tag.h>
============================================================
Index: sysdeps/generic/feupdateenv.c
--- sysdeps/generic/feupdateenv.c	2000/02/26 01:09:38	1.3
+++ sysdeps/generic/feupdateenv.c	2000/04/03 22:01:24
@@ -19,6 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <fenv.h>
+#include <shlib-compat.h>
 
 int
 __feupdateenv (const fenv_t *envp)
@@ -26,9 +27,11 @@
   /* This always fails.  */
   return 1;
 }
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
 strong_alias (__feupdateenv, __old_feupdateenv)
-symbol_version (__old_feupdateenv, feupdateenv, GLIBC_2.1);
-default_symbol_version (__feupdateenv, feupdateenv, GLIBC_2.2);
+compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
+#endif
+versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
 
 stub_warning (feupdateenv)
 #include <stub-tag.h>
============================================================
Index: sysdeps/generic/fgetexcptflg.c
--- sysdeps/generic/fgetexcptflg.c	2000/02/26 01:09:38	1.3
+++ sysdeps/generic/fgetexcptflg.c	2000/04/03 22:01:24
@@ -19,6 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <fenv.h>
+#include <shlib-compat.h>
 
 int
 __fegetexceptflag (fexcept_t *flagp, int excepts)
@@ -26,9 +27,11 @@
   /* This always fails.  */
   return 1;
 }
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
 strong_alias (__fegetexceptflag, __old_fegetexceptflag)
-symbol_version (__old_fegetexceptflag, fegetexceptflag, GLIBC_2.1);
-default_symbol_version (__fegetexceptflag, fegetexceptflag, GLIBC_2.2);
+compat_symbol (libm, __old_fegetexceptflag, fegetexceptflag, GLIBC_2_1);
+#endif
+versioned_symbol (libm, __fegetexceptflag, fegetexceptflag, GLIBC_2_2);
 
 stub_warning (fegetexceptflag)
 #include <stub-tag.h>
============================================================
Index: sysdeps/generic/fraiseexcpt.c
--- sysdeps/generic/fraiseexcpt.c	2000/02/26 01:09:38	1.3
+++ sysdeps/generic/fraiseexcpt.c	2000/04/03 22:01:24
@@ -19,6 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <fenv.h>
+#include <shlib-compat.h>
 
 int
 __feraiseexcept (int excepts)
@@ -26,9 +27,11 @@
   /* This always fails.  */
   return 1;
 }
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
 strong_alias (__feraiseexcept, __old_feraiseexcept)
-symbol_version (__old_feraiseexcept, feraiseexcept, GLIBC_2.1);
-default_symbol_version (__feraiseexcept, feraiseexcept, GLIBC_2.2);
+compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1);
+#endif
+versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2);
 
 stub_warning (feraiseexcept)
 #include <stub-tag.h>
============================================================
Index: sysdeps/generic/fsetexcptflg.c
--- sysdeps/generic/fsetexcptflg.c	2000/02/26 01:09:38	1.3
+++ sysdeps/generic/fsetexcptflg.c	2000/04/03 22:01:24
@@ -19,6 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <fenv.h>
+#include <shlib-compat.h>
 
 int
 __fesetexceptflag (const fexcept_t *flagp, int excepts)
@@ -26,9 +27,11 @@
   /* This always fails.  */
   return 1;
 }
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
 strong_alias (__fesetexceptflag, __old_fesetexceptflag)
-symbol_version (__old_fesetexceptflag, fesetexceptflag, GLIBC_2.1);
-default_symbol_version (__fesetexceptflag, fesetexceptflag, GLIBC_2.2);
+compat_symbol (libm, __old_fesetexceptflag, fesetexceptflag, GLIBC_2_1);
+#endif
+versioned_symbol (libm, __fesetexceptflag, fesetexceptflag, GLIBC_2_2);
 
 stub_warning (fesetexceptflag)
 #include <stub-tag.h>
============================================================
Index: sysdeps/unix/sysv/linux/alpha/glob.c
--- sysdeps/unix/sysv/linux/alpha/glob.c	1998/08/12 17:06:03	1.7
+++ sysdeps/unix/sysv/linux/alpha/glob.c	2000/04/03 22:01:24
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -20,6 +20,7 @@
 
 #include <sys/types.h>
 #include <glob.h>
+#include <shlib-compat.h>
 
 /* For Linux/Alpha we have to make the glob symbols versioned.  */
 #define glob(pattern, flags, errfunc, pglob) \
@@ -40,8 +41,8 @@
 #undef glob64
 #undef globfree64
 
-default_symbol_version(__new_glob, glob, GLIBC_2.1);
-default_symbol_version(__new_globfree, globfree, GLIBC_2.1);
+versioned_symbol (libc, __new_glob, glob, GLIBC_2_1);
+versioned_symbol (libc, __new_globfree, globfree, GLIBC_2_1);
 
 weak_alias (__new_glob, glob64)
 weak_alias (__new_globfree, globfree64)
============================================================
Index: sysdeps/unix/sysv/linux/arm/errlist.c
--- sysdeps/unix/sysv/linux/arm/errlist.c	2000/03/31 05:39:18	1.2
+++ sysdeps/unix/sysv/linux/arm/errlist.c	2000/04/03 22:01:24
@@ -39,11 +39,11 @@
 
 strong_alias (__old_sys_nerr, _old_sys_nerr);
 weak_alias (__old_sys_nerr, _old_sys_nerr)
-symbol_version (__old_sys_nerr, _sys_nerr, GLIBC_2.0);
-symbol_version (_old_sys_nerr, sys_nerr, GLIBC_2.0);
+compat_symbol (libc, __old_sys_nerr, _sys_nerr, GLIBC_2_0);
+compat_symbol (libc, _old_sys_nerr, sys_nerr, GLIBC_2_0);
 weak_alias (__old_sys_errlist, _old_sys_errlist);
-symbol_version (__old_sys_errlist, _sys_errlist, GLIBC_2.0);
-symbol_version (_old_sys_errlist, sys_errlist, GLIBC_2.0);
+compat_symbol (libc, __old_sys_errlist, _sys_errlist, GLIBC_2_0);
+compat_symbol (libc, _old_sys_errlist, sys_errlist, GLIBC_2_0);
 #endif
 
 strong_alias (__new_sys_nerr, _new_sys_nerr)
============================================================
Index: sysdeps/unix/sysv/linux/errlist.c
--- sysdeps/unix/sysv/linux/errlist.c	2000/03/22 07:59:25	1.5
+++ sysdeps/unix/sysv/linux/errlist.c	2000/04/03 22:01:24
@@ -39,11 +39,11 @@
 
 strong_alias (__old_sys_nerr, _old_sys_nerr);
 weak_alias (__old_sys_nerr, _old_sys_nerr)
-symbol_version (__old_sys_nerr, _sys_nerr, GLIBC_2.0);
-symbol_version (_old_sys_nerr, sys_nerr, GLIBC_2.0);
+compat_symbol (libc, __old_sys_nerr, _sys_nerr, GLIBC_2_0);
+compat_symbol (libc, _old_sys_nerr, sys_nerr, GLIBC_2_0);
 weak_alias (__old_sys_errlist, _old_sys_errlist);
-symbol_version (__old_sys_errlist, _sys_errlist, GLIBC_2.0);
-symbol_version (_old_sys_errlist, sys_errlist, GLIBC_2.0);
+compat_symbol (libc, __old_sys_errlist, _sys_errlist, GLIBC_2_0);
+compat_symbol (libc, _old_sys_errlist, sys_errlist, GLIBC_2_0);
 #endif
 
 strong_alias (__new_sys_nerr, _new_sys_nerr)
============================================================
Index: sysdeps/unix/sysv/linux/i386/chown.c
--- sysdeps/unix/sysv/linux/i386/chown.c	2000/03/31 05:44:27	1.10
+++ sysdeps/unix/sysv/linux/i386/chown.c	2000/04/03 22:01:24
@@ -24,9 +24,9 @@
 
 #include <kernel-features.h>
 #include <linux/posix_types.h>
+#include <shlib-compat.h>
 
 
-
 /*
   In Linux 2.1.x the chown functions have been changed.  A new function lchown
   was introduced.  The new chown now follows symlinks - the old chown and the
@@ -132,7 +132,7 @@
 {
   return INLINE_SYSCALL (chown, 3, file, owner, group);
 }
-#elif defined HAVE_ELF && defined SHARED && defined DO_VERSIONING
+#elif SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
 /* Compiling for compatibiity.  */
 int
 __chown_is_lchown (const char *file, uid_t owner, gid_t group)
@@ -141,20 +141,20 @@
 }
 #endif
 
-#if defined HAVE_ELF && defined SHARED && defined DO_VERSIONING
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
 strong_alias (__chown_is_lchown, _chown_is_lchown)
-symbol_version (__chown_is_lchown, __chown, GLIBC_2.0);
-symbol_version (_chown_is_lchown, chown, GLIBC_2.0);
+compat_symbol (libc, __chown_is_lchown, __chown, GLIBC_2_0);
+compat_symbol (libc, _chown_is_lchown, chown, GLIBC_2_0);
 
 # ifdef __NR_lchown
 strong_alias (__real_chown, _real_chown)
-default_symbol_version (__real_chown, __chown, GLIBC_2.1);
-default_symbol_version (_real_chown, chown, GLIBC_2.1);
+versioned_symbol (libc, __real_chown, __chown, GLIBC_2_1);
+versioned_symbol (libc, _real_chown, chown, GLIBC_2_1);
 # else
 strong_alias (__chown_is_lchown, __chown_is_lchown21)
 strong_alias (__chown_is_lchown, _chown_is_lchown21)
-default_symbol_version (__chown_is_lchown21, __chown, GLIBC_2.1);
-default_symbol_version (_chown_is_lchown21, chown, GLIBC_2.1);
+versioned_symbol (libc, __chown_is_lchown21, __chown, GLIBC_2_1);
+versioned_symbol (libc, _chown_is_lchown21, chown, GLIBC_2_1);
 # endif
 #else
 # ifdef __NR_lchown
============================================================
Index: linuxthreads/attr.c
--- linuxthreads/attr.c	2000/03/22 07:35:44	1.10
+++ linuxthreads/attr.c	2000/04/03 22:01:24
@@ -51,7 +51,8 @@
   attr->__scope = PTHREAD_SCOPE_SYSTEM;
   return 0;
 }
-symbol_version (__pthread_attr_init_2_0, pthread_attr_init, GLIBC_2.0);
+compat_symbol (libpthread, __pthread_attr_init_2_0, pthread_attr_init,
+	       GLIBC_2_0);
 #endif
 
 int pthread_attr_destroy(pthread_attr_t *attr)
============================================================
Index: linuxthreads/oldsemaphore.c
--- linuxthreads/oldsemaphore.c	2000/03/22 07:35:44	1.5
+++ linuxthreads/oldsemaphore.c	2000/04/03 22:01:24
@@ -226,11 +226,11 @@
   }
 }
 
-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);
+compat_symbol (libpthread, __old_sem_init, sem_init, GLIBC_2_0);
+compat_symbol (libpthread, __old_sem_wait, sem_wait, GLIBC_2_0);
+compat_symbol (libpthread, __old_sem_trywait, sem_trywait, GLIBC_2_0);
+compat_symbol (libpthread, __old_sem_post, sem_post, GLIBC_2_0);
+compat_symbol (libpthread, __old_sem_getvalue, sem_getvalue, GLIBC_2_0);
+compat_symbol (libpthread, __old_sem_destroy, sem_destroy, GLIBC_2_0);
 
 #endif
============================================================
Index: linuxthreads/pthread.c
--- linuxthreads/pthread.c	2000/03/31 05:44:26	1.39
+++ linuxthreads/pthread.c	2000/04/03 22:01:24
@@ -541,7 +541,7 @@
     }
   return __pthread_create_2_1 (thread, attr, start_routine, arg);
 }
-symbol_version (__pthread_create_2_0, pthread_create, GLIBC_2.0);
+compat_symbol (libpthread, __pthread_create_2_0, pthread_create, GLIBC_2_0);
 #endif
 
 /* Simple operations on thread identifiers */
============================================================
Index: linuxthreads/weaks.c
--- linuxthreads/weaks.c	2000/03/22 07:35:44	1.7
+++ linuxthreads/weaks.c	2000/04/03 22:01:25
@@ -32,7 +32,8 @@
 		  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);
+compat_symbol (libpthread, __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)


-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]