64 lines
1.5 KiB
Text
64 lines
1.5 KiB
Text
|
$NetBSD: patch-au,v 1.1 2001/02/28 23:28:09 hubertf Exp $
|
||
|
|
||
|
--- ../gcc-2.95.2/gcc/crtstuff.c.orig Tue Feb 27 14:34:52 2001
|
||
|
+++ ../gcc-2.95.2/gcc/crtstuff.c
|
||
|
@@ -181,16 +181,16 @@
|
||
|
|
||
|
/* Stick a call to __do_global_dtors_aux into the .fini section. */
|
||
|
|
||
|
-static void __attribute__ ((__unused__))
|
||
|
-fini_dummy (void)
|
||
|
+asm (FINI_SECTION_ASM_OP);
|
||
|
+void __attribute__ ((__unused__))
|
||
|
+_fini (void)
|
||
|
{
|
||
|
- asm (FINI_SECTION_ASM_OP);
|
||
|
__do_global_dtors_aux ();
|
||
|
#ifdef FORCE_FINI_SECTION_ALIGN
|
||
|
FORCE_FINI_SECTION_ALIGN;
|
||
|
#endif
|
||
|
- asm (TEXT_SECTION_ASM_OP);
|
||
|
}
|
||
|
+asm (TEXT_SECTION_ASM_OP);
|
||
|
|
||
|
#ifdef EH_FRAME_SECTION_ASM_OP
|
||
|
/* Stick a call to __register_frame_info into the .init section. For some
|
||
|
@@ -205,6 +205,21 @@
|
||
|
__register_frame_info (__EH_FRAME_BEGIN__, &object);
|
||
|
}
|
||
|
|
||
|
+static void
|
||
|
+__nop (void)
|
||
|
+{
|
||
|
+ //asm("unimp 0x42"); // We must not call this function ever. If we happen to
|
||
|
+ // do it accidently, use the emergency exit.
|
||
|
+}
|
||
|
+
|
||
|
+asm (INIT_SECTION_ASM_OP);
|
||
|
+void __attribute__ ((__unused__))
|
||
|
+_init (void)
|
||
|
+{
|
||
|
+ asm (TEXT_SECTION_ASM_OP);
|
||
|
+ __nop();
|
||
|
+}
|
||
|
+
|
||
|
static void __attribute__ ((__unused__))
|
||
|
init_dummy (void)
|
||
|
{
|
||
|
@@ -378,7 +393,6 @@
|
||
|
#ifdef FORCE_INIT_SECTION_ALIGN
|
||
|
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
|
||
|
@@ -395,6 +409,7 @@
|
||
|
}
|
||
|
#endif
|
||
|
}
|
||
|
+asm (TEXT_SECTION_ASM_OP);
|
||
|
|
||
|
#else /* OBJECT_FORMAT_ELF */
|
||
|
|