Jakub Jelinek - [PATCH] Remove dead cruft from crtstuff.c (take 2) (original) (raw)
This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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] |
- To: "H . J . Lu"
- Subject: [PATCH] Remove dead cruft from crtstuff.c (take 2)
- From: Jakub Jelinek
- Date: Fri, 16 Mar 2001 18:08:16 +0100
- Cc: rth at redhat dot com, gcc-patches at gcc dot gnu dot org
- References: <20010316120131.F574@sunsite.ms.mff.cuni.cz> <20010316075107.B31912@lucon.org>
- Reply-To: Jakub Jelinek
On Fri, Mar 16, 2001 at 07:51:07AM -0800, H . J . Lu wrote:
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.
In that case, isn't it better to move it out of crtstuff.c into target headers?
2001-03-16 Jakub Jelinek jakub@redhat.com
* crtstuff.c (init_dummy): Use CRT_END_INIT_DUMMY if defined.
Remove ia32 linux PIC kludge and move it...
* config/i386/linux.h (CRT_END_INIT_DUMMY): ...here.
--- gcc/config/i386/linux.h.jj Mon Mar 12 11:45:15 2001
+++ gcc/config/i386/linux.h Fri Mar 16 18:52:31 2001
@@ -170,3 +170,21 @@ Boston, MA 02111-1307, USA. /
}
} while (0)
#endif
+
+#if defined(PIC) && defined (USE_GNULIBC_1)
+/ 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. */
+
+#define CRT_END_INIT_DUMMY
+ do
+ {
+ extern void *___brk_addr;
+ extern char **__environ;
+
+ ___brk_addr = __environ;
+ atexit (0);
+ }
+ while (0)
+#endif
--- gcc/crtstuff.c.jj Thu Mar 15 10:55:50 2001
+++ gcc/crtstuff.c Thu Mar 15 11:04:03 2001
@@ -414,20 +414,8 @@ init_dummy (void)
FORCE_INIT_SECTION_ALIGN;
#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. */
-#if defined(linux) && defined(PIC) && defined(i386) - { - extern void *___brk_addr; - extern char **__environ;
- ___brk_addr = __environ;
- atexit (0);
- } +#ifdef CRT_END_INIT_DUMMY
- CRT_END_INIT_DUMMY;
#endif }
Jakub
- Follow-Ups:
- Re: [PATCH] Remove dead cruft from crtstuff.c (take 2)
* From: H . J . Lu - Re: [PATCH] Remove dead cruft from crtstuff.c (take 2)
* From: Richard Henderson
- Re: [PATCH] Remove dead cruft from crtstuff.c (take 2)
- References:
- [PATCH] Remove dead cruft from crtstuff.c
* From: Jakub Jelinek - Re: [PATCH] Remove dead cruft from crtstuff.c
* From: H . J . Lu
- [PATCH] Remove dead cruft from crtstuff.c
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |