Written by Ron Guilmette (rfg@netcom.com) with help from Richard Stallman.
-Copyright (C) 1991 Free Software Foundation, Inc.
+Copyright (C) 1991, 1994 Free Software Foundation, Inc.
This file is part of GNU CC.
FORCE_INIT_SECTION_ALIGN;
#endif
asm (TEXT_SECTION_ASM_OP);
+
+/* This is a kludge. The 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__)
+ {
+ extern void *___brk_addr;
+ extern char **__environ;
+
+ ___brk_addr = __environ;
+ atexit ();
+ }
+#endif
}
#else /* OBJECT_FORMAT_ELF */