summaryrefslogtreecommitdiff
path: root/lang/gcc/patches/patch-au
blob: a7fd62b3c626f2e501094af82b82d2f1fdaecce9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
$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 */