public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* dl_dynamic_weak
@ 2003-01-07 16:27 Jakub Jelinek
  2003-01-07 17:30 ` dl_dynamic_weak Ulrich Drepper
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2003-01-07 16:27 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

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 than ntpl and linuxthreads
which depend on dl_dynamic_weak = 1 (Hurd cthreads?).

	Jakub

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: dl_dynamic_weak
  2003-01-07 16:27 dl_dynamic_weak Jakub Jelinek
@ 2003-01-07 17:30 ` Ulrich Drepper
  2003-01-07 18:36   ` dl_dynamic_weak Jakub Jelinek
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Drepper @ 2003-01-07 17:30 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers

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.

-- 
--------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: dl_dynamic_weak
  2003-01-07 17:30 ` dl_dynamic_weak Ulrich Drepper
@ 2003-01-07 18:36   ` Jakub Jelinek
  2003-01-07 18:54     ` dl_dynamic_weak Ulrich Drepper
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2003-01-07 18:36 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: dl_dynamic_weak
  2003-01-07 18:36   ` dl_dynamic_weak Jakub Jelinek
@ 2003-01-07 18:54     ` Ulrich Drepper
  0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Drepper @ 2003-01-07 18:54 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers

Jakub Jelinek wrote:

> 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.

Thanks, I've applied the patch.

-- 
--------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-01-07 18:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-07 16:27 dl_dynamic_weak Jakub Jelinek
2003-01-07 17:30 ` dl_dynamic_weak Ulrich Drepper
2003-01-07 18:36   ` dl_dynamic_weak Jakub Jelinek
2003-01-07 18:54     ` dl_dynamic_weak Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).