summaryrefslogtreecommitdiff
path: root/gcc/config/i386/linux.h
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-19 18:07:32 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-19 18:07:32 +0000
commite9bc07ed0fef5704c27301f0d4eac5014e270525 (patch)
treed7688eb89b48d390b3fb7030092ec484c08dc441 /gcc/config/i386/linux.h
parent11230a2efa16922e7dd1f1832119802c245ff4e6 (diff)
downloadgcc-e9bc07ed0fef5704c27301f0d4eac5014e270525.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40627 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386/linux.h')
-rw-r--r--gcc/config/i386/linux.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index 34e416cc49b..a5c725a334a 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -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