This is the mail archive of the libc-hacker@sources.redhat.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]
Other format: [Raw text]

Re: dl_dynamic_weak


On Tue, Jan 07, 2003 at 09:30:12AM -0800, Ulrich Drepper wrote:
> Jakub Jelinek wrote:
> 
> > Now that also linuxthreads works with dl_dynamic_weak = 0,
> > I wonder if linuxthreads just should define RTLD_CORRECT_DYNAMIC_WEAK
> > or whether the conditional should be killed, ie. whether
> > there are some thread implementations other 
> 
> Let's kill the conditional initialization.  We obviously need the
> environment variable for people with broken programs.

Ok, here is a patch for that.
Also, it makes sure _dl_sysinfo_int80 doesn't end up in .data or some other
section instead of .text.

2003-01-07  Jakub Jelinek  <jakub@redhat.com>

	* elf/rtld.c (_rtld_global): Remove _dl_dynamic_weak initializer.
	* elf/dl-support.c (_dl_dynamic_weak): Initialize to 0.
nptl/
	* sysdeps/unix/sysv/linux/i386/dl-sysdep.h
	(RTLD_CORRECT_DYNAMIC_WEAK): Remove.
	(DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
	* sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
	(RTLD_CORRECT_DYNAMIC_WEAK): Remove.
	(DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.

--- libc/elf/rtld.c.jj	2002-12-28 12:29:33.000000000 +0100
+++ libc/elf/rtld.c	2003-01-07 20:52:56.000000000 +0100
@@ -1,5 +1,5 @@
 /* Run time dynamic linker.
-   Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1995-2002, 2003 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
@@ -91,13 +91,6 @@ struct rtld_global _rtld_global =
     /* Get architecture specific initializer.  */
 #include <dl-procinfo.c>
     ._dl_debug_fd = STDERR_FILENO,
-#ifndef RTLD_CORRECT_DYNAMIC_WEAK
-    /* XXX I know about at least one case where we depend on the old
-       weak behavior (it has to do with librt).  Until we get DSO
-       groups implemented we have to make this the default.
-       Bummer. --drepper  */
-    ._dl_dynamic_weak = 1,
-#endif
 #ifdef NEED_DL_SYSINFO
     ._dl_sysinfo = DL_SYSINFO_DEFAULT,
 #endif
--- libc/elf/dl-support.c.jj	2002-12-20 13:34:41.000000000 +0100
+++ libc/elf/dl-support.c	2003-01-07 20:56:20.000000000 +0100
@@ -1,5 +1,5 @@
 /* Support for dynamic linking code in static libc.
-   Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1996-2002, 2003 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
@@ -41,14 +41,7 @@ size_t _dl_platformlen;
 
 int _dl_debug_mask;
 int _dl_lazy;
-/* XXX I know about at least one case where we depend on the old weak
-   behavior (it has to do with librt).  Until we get DSO groups implemented
-   we have to make this the default.  Bummer. --drepper  */
-#if 0
 int _dl_dynamic_weak;
-#else
-int _dl_dynamic_weak = 1;
-#endif
 
 /* If nonzero print warnings about problematic situations.  */
 int _dl_verbose;
--- libc/nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h.jj	Sat Dec 28 05:00:47 2002
+++ libc/nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h	Tue Jan  7 13:25:17 2003
@@ -1,5 +1,5 @@
 /* System-specific settings for dynamic linker code.  IA-32 version.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003 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
@@ -34,15 +34,6 @@
 # define RTLD_PRIVATE_ERRNO 0
 #endif
 
-/* This configuration has in libc.so cancellable functions and other
-   functions which have to behave differently if the application uses
-   threads.  It is not necessary that the thread library's definitions
-   are used.  Therefore we can finally enabled the correct handling
-   of weak definitions in ld.so.  See rtld.c.  */
-
-#define RTLD_CORRECT_DYNAMIC_WEAK	1
-
-
 /* Traditionally system calls have been made using int $0x80.  A
    second method was introduced which, if possible, will use the
    sysenter/syscall instructions.  To signal the presence and where to
@@ -58,12 +49,14 @@
 extern void _dl_sysinfo_int80 (void) attribute_hidden;
 # define DL_SYSINFO_DEFAULT (uintptr_t) _dl_sysinfo_int80
 # define DL_SYSINFO_IMPLEMENTATION \
-  asm (".type _dl_sysinfo_int80,@function\n\t"				      \
+  asm (".text\n\t"							      \
+       ".type _dl_sysinfo_int80,@function\n\t"				      \
        ".hidden _dl_sysinfo_int80\n"					      \
        "_dl_sysinfo_int80:\n\t"						      \
        "int $0x80;\n\t"							      \
        "ret;\n\t"							      \
-       ".size _dl_sysinfo_int80,.-_dl_sysinfo_int80");
+       ".size _dl_sysinfo_int80,.-_dl_sysinfo_int80\n\t"		      \
+       ".previous");
 #endif
 
 #endif	/* dl-sysdep.h */
--- libc/nptl/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h.jj	Tue Jan  7 13:22:02 2003
+++ libc/nptl/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h	Tue Jan  7 13:23:57 2003
@@ -1,5 +1,5 @@
 /* System-specific settings for dynamic linker code.  IA-32 version.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003 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
@@ -34,15 +34,6 @@
 # define RTLD_PRIVATE_ERRNO 0
 #endif
 
-/* This configuration has in libc.so cancellable functions and other
-   functions which have to behave differently if the application uses
-   threads.  It is not necessary that the thread library's definitions
-   are used.  Therefore we can finally enabled the correct handling
-   of weak definitions in ld.so.  See rtld.c.  */
-
-#define RTLD_CORRECT_DYNAMIC_WEAK	1
-
-
 /* Traditionally system calls have been made using int $0x80.  A
    second method was introduced which, if possible, will use the
    sysenter/syscall instructions.  To signal the presence and where to
@@ -55,12 +46,14 @@
 extern void _dl_sysinfo_int80 (void) attribute_hidden;
 # define DL_SYSINFO_DEFAULT (uintptr_t) _dl_sysinfo_int80
 # define DL_SYSINFO_IMPLEMENTATION \
-  asm (".type _dl_sysinfo_int80,@function\n\t"				      \
+  asm (".text\n\t"							      \
+       ".type _dl_sysinfo_int80,@function\n\t"				      \
        ".hidden _dl_sysinfo_int80\n"					      \
        "_dl_sysinfo_int80:\n\t"						      \
        "int $0x80;\n\t"							      \
        "ret;\n\t"							      \
-       ".size _dl_sysinfo_int80,.-_dl_sysinfo_int80");
+       ".size _dl_sysinfo_int80,.-_dl_sysinfo_int80\n\t"		      \
+       ".previous");
 #endif
 
 #endif	/* dl-sysdep.h */


	Jakub


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