This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


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

Re: A patch to add --with-oldest-abi=ABI. [Re: A patch to add --disable-old-version.]


On Fri, Dec 01, 2000 at 08:30:26AM -0800, Ulrich Drepper wrote:
> "H . J . Lu" <hjl@valinux.com> writes:
> 
> > Based on Roland suggestion, I withdraw the --disable-old-version patch.
> > Here is the patch to add --with-oldest-abi=ABI.
> 
> This cannot be done this way.  You are once again creating an
> incompatible library.  The version information for functions gets
> completely dropped.  Take chown().  There used to be a GLIBC_2.0 and a
> GLIBC_2.1 version.  I.e., newly linked applications reference
> chown@GLIBC_2.1.  Now there is no version information at all.  A newly
> created application references chown (no version information) which on
> a system with the full libc call chown@GLIBC_2.0.
> 

My patch does expose some bugs in verioned symbol handling. Here is
a patch. I hope I caught all of them.


> 
> Also, there are lots of symbols not caught at all (getrlimit to name
> only one).
> 

getrlimit is a system call generated on the fly during the glibc build.
It doesn't include shlib-compat.h. I looked at it. I guess I had to
change quite a few places to get it to work. If you want such a patch,
I can submit one. Just ask.


H.J.
----
2000-12-01  H.J. Lu  <hjl@gnu.org>

	* nss/getXXbyYY_r.c: Fix verioned symbol handling.
	* nss/getXXent_r.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/chown.c: Likewise.

Index: ./nss/getXXbyYY_r.c
===================================================================
RCS file: /work/cvs/gnu/glibc/nss/getXXbyYY_r.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 getXXbyYY_r.c
--- ./nss/getXXbyYY_r.c	2000/08/31 16:48:40	1.1.1.2
+++ ./nss/getXXbyYY_r.c	2000/12/01 17:35:03
@@ -239,12 +239,9 @@ OLD (REENTRANT_NAME) (ADD_PARAMS, LOOKUP
 #define do_symbol_version(real, name, version) \
   compat_symbol (libc, real, name, version)
 do_symbol_version (OLD (REENTRANT_NAME), REENTRANT_NAME, GLIBC_2_0);
+#endif
 
 #define do_default_symbol_version(real, name, version) \
   versioned_symbol (libc, real, name, version)
 do_default_symbol_version (INTERNAL (REENTRANT_NAME),
 			   REENTRANT_NAME, GLIBC_2_1_2);
-#else
-#define do_weak_alias(n1, n2) weak_alias (n1, n2)
-do_weak_alias (INTERNAL (REENTRANT_NAME), REENTRANT_NAME)
-#endif
Index: ./nss/getXXent_r.c
===================================================================
RCS file: /work/cvs/gnu/glibc/nss/getXXent_r.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 getXXent_r.c
--- ./nss/getXXent_r.c	2000/07/18 00:28:46	1.1.1.2
+++ ./nss/getXXent_r.c	2000/12/01 17:35:21
@@ -317,12 +317,9 @@ OLD (REENTRANT_GETNAME) (LOOKUP_TYPE *re
 #define do_symbol_version(real, name, version) \
   compat_symbol (libc, real, name, version)
 do_symbol_version (OLD (REENTRANT_GETNAME), REENTRANT_GETNAME, GLIBC_2_0);
+#endif
 
 #define do_default_symbol_version(real, name, version) \
   versioned_symbol (libc, real, name, version)
 do_default_symbol_version (INTERNAL (REENTRANT_GETNAME),
 			   REENTRANT_GETNAME, GLIBC_2_1_2);
-#else
-#define do_weak_alias(n1, n2) weak_alias (n1, n2)
-do_weak_alias (INTERNAL (REENTRANT_GETNAME), REENTRANT_GETNAME)
-#endif
Index: ./sysdeps/unix/sysv/linux/i386/chown.c
===================================================================
RCS file: /work/cvs/gnu/glibc/sysdeps/unix/sysv/linux/i386/chown.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 chown.c
--- ./sysdeps/unix/sysv/linux/i386/chown.c	2000/07/12 18:52:10	1.1.1.2
+++ ./sysdeps/unix/sysv/linux/i386/chown.c	2000/12/01 17:39:45
@@ -145,23 +145,15 @@ __chown_is_lchown (const char *file, uid
 strong_alias (__chown_is_lchown, _chown_is_lchown)
 compat_symbol (libc, __chown_is_lchown, __chown, GLIBC_2_0);
 compat_symbol (libc, _chown_is_lchown, chown, GLIBC_2_0);
+#endif
 
-# ifdef __NR_lchown
+#ifdef __NR_lchown
 strong_alias (__real_chown, _real_chown)
 versioned_symbol (libc, __real_chown, __chown, GLIBC_2_1);
 versioned_symbol (libc, _real_chown, chown, GLIBC_2_1);
-# else
+#else
 strong_alias (__chown_is_lchown, __chown_is_lchown21)
 strong_alias (__chown_is_lchown, _chown_is_lchown21)
 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
-strong_alias (__real_chown, __chown)
-weak_alias (__real_chown, chown)
-# else
-strong_alias (__chown_is_lchown, __chown)
-weak_alias (__chown_is_lchown, chown)
-# endif
 #endif

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