crtstuff.c (init_dummy): Use CRT_END_INIT_DUMMY if defined.
authorJakub Jelinek <jakub@redhat.com>
Mon, 19 Mar 2001 18:07:32 +0000 (19:07 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 19 Mar 2001 18:07:32 +0000 (19:07 +0100)
* 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.

From-SVN: r40627

gcc/ChangeLog
gcc/config/i386/linux.h
gcc/crtstuff.c

index 9f9f6288cac69c4bc4dabec6a29a92116e5d2a21..b076480dc6398177a24d3ce8b6b18d8c39804c67 100644 (file)
@@ -1,3 +1,9 @@
+2001-03-19  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.
+
 Mon Mar 19 18:53:54 CET 2001  Jan Hubicka  <jh@suse.cz>
 
        * i386.md (absdf2 expander): Fix 64bit case.
index 34e416cc49b7376b76781b561267824614e30fe4..a5c725a334a8c3460696668e6740aa5c631a01e3 100644 (file)
@@ -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
index c349c716da01045d90d40a68a43dba6fe76768f9..fc747a90091efbe3625f8c203aa1f81634eff280 100644 (file)
@@ -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
 }