]>
Commit | Line | Data |
---|---|---|
1 | diff -urN gcc-2.95.3.org/gcc/config/i386/linux.h gcc-2.95.3/gcc/config/i386/linux.h | |
2 | --- gcc-2.95.3.org/gcc/config/i386/linux.h Mon Mar 19 19:35:22 2001 | |
3 | +++ gcc-2.95.3/gcc/config/i386/linux.h Mon Mar 19 19:36:46 2001 | |
4 | @@ -234,3 +234,21 @@ | |
5 | } \ | |
6 | } while (0) | |
7 | #endif | |
8 | + | |
9 | +#if defined(__PIC__) && defined (USE_GNULIBC_1) | |
10 | +/* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr, | |
11 | + __environ and atexit (). We have to make sure they are in the .dynsym | |
12 | + section. We accomplish it by making a dummy call here. This | |
13 | + code is never reached. */ | |
14 | + | |
15 | +#define CRT_END_INIT_DUMMY \ | |
16 | + do \ | |
17 | + { \ | |
18 | + extern void *___brk_addr; \ | |
19 | + extern char **__environ; \ | |
20 | + \ | |
21 | + ___brk_addr = __environ; \ | |
22 | + atexit (0); \ | |
23 | + } \ | |
24 | + while (0) | |
25 | +#endif | |
26 | diff -urN gcc-2.95.3.org/gcc/crtstuff.c gcc-2.95.3/gcc/crtstuff.c | |
27 | --- gcc-2.95.3.org/gcc/crtstuff.c Mon Mar 19 19:35:22 2001 | |
28 | +++ gcc-2.95.3/gcc/crtstuff.c Mon Mar 19 19:37:56 2001 | |
29 | @@ -379,20 +379,8 @@ | |
30 | FORCE_INIT_SECTION_ALIGN; | |
31 | #endif | |
32 | asm (TEXT_SECTION_ASM_OP); | |
33 | - | |
34 | -/* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr, | |
35 | - __environ and atexit (). We have to make sure they are in the .dynsym | |
36 | - section. We accomplish it by making a dummy call here. This | |
37 | - code is never reached. */ | |
38 | - | |
39 | -#if defined(__linux__) && defined(__PIC__) && defined(__i386__) | |
40 | - { | |
41 | - extern void *___brk_addr; | |
42 | - extern char **__environ; | |
43 | - | |
44 | - ___brk_addr = __environ; | |
45 | - atexit (); | |
46 | - } | |
47 | +#ifdef CRT_END_INIT_DUMMY | |
48 | + CRT_END_INIT_DUMMY; | |
49 | #endif | |
50 | } | |
51 |