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 Sat, Dec 02, 2000 at 10:04:03AM -0800, Ulrich Drepper wrote:
> "H . J . Lu" <hjl@valinux.com> writes:
> 
> > 1. res_init is not used for linking. Or
> > 2. res_init is always available.
> > 
> > I prefer 1.
> 
> Yes, ideally we'd have that.  But I do not how to implement it
> correctly.  Probably ld should check whether a symbol is defined as a
> default version in the library and if it's not use it.
> 

How about this patch?

# objdump --dynamic-sym libc.so.6 | grep res_init
000f01e0  w   DF .text  00000078 (GLIBC_2.0)  res_init
000f01e0 g    DF .text  00000078  GLIBC_2.2   __res_init

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

	* resolv/res_libc.c (res_init): Don't make it default.

Index: resolv/res_libc.c
===================================================================
RCS file: /work/cvs/gnu/glibc/resolv/res_libc.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 res_libc.c
--- resolv/res_libc.c	2000/07/19 22:17:39	1.1.1.2
+++ resolv/res_libc.c	2000/12/02 18:22:12
@@ -84,5 +84,7 @@ res_init(void) {
 
 #if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2)
 # undef res_init
-weak_alias (__res_init, res_init);
+strong_alias (__res_init, __res_init_weak);
+weak_extern (__res_init_weak);
+compat_symbol (libc, __res_init_weak, res_init, GLIBC_2_0);
 #endif

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