This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: [PATCH] Remove dead cruft from crtstuff.c


On Fri, Mar 16, 2001 at 12:01:31PM +0100, Jakub Jelinek wrote:
> Hi!
> 
> As result of recent atexit changes in glibc using atexit in i386-linux
> crtendS.o is bad (since if the shared library does not use atexit, it won't
> be taken from libc_nonshared and shared library will thus end up with
> non-versioned atexit reference).
> According to H.J., this kludge was needed only for very very old Linux C
> libraries and can be safely killed.
> Ok to commit?
> 

How about this patch? The old libc still needs it.


H.J.
----
2001-03-16  H.J. Lu  (hjl@gnu.org)

	* crtstuff.c (init_dummy): Keep the i386 linux crtendS.o kludge
	only for the old libc.

--- gcc/crtstuff.c.libc5	Sat Jan 27 17:50:05 2001
+++ gcc/crtstuff.c	Fri Mar 16 07:47:38 2001
@@ -414,12 +414,13 @@ init_dummy (void)
 #endif
   asm (TEXT_SECTION_ASM_OP);
 
-/* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr,
-   __environ and atexit (). We have to make sure they are in the .dynsym
-   section. We accomplish it by making a dummy call here. This
-   code is never reached.  */
+/* This is a kludge. The old i386 GNU/Linux dynamic linker needs
+   ___brk_addr, __environ and atexit (). We have to make sure they
+   are in the .dynsym section. We accomplish it by making a dummy
+   call here. This code is never reached. We don't do it for glibc
+   2.  */
  
-#if defined(__linux__) && defined(__PIC__) && defined(__i386__)
+#if defined(__linux__) && defined(__PIC__) && defined(__i386__) && defined(USE_GNULIBC_1)
   {
     extern void *___brk_addr;
     extern char **__environ;


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