OSDN Git Service

This will hopefully make global constructors and destructors work
authorEric Andersen <andersen@codepoet.org>
Tue, 28 Aug 2001 17:15:53 +0000 (17:15 -0000)
committerEric Andersen <andersen@codepoet.org>
Tue, 28 Aug 2001 17:15:53 +0000 (17:15 -0000)
libc/sysdeps/linux/arm/crt0.S
libc/sysdeps/linux/i386/crt0.S
libc/sysdeps/linux/i386/crt0.c
libc/sysdeps/linux/powerpc/crt0.S
libc/sysdeps/linux/powerpc/crt0.c

index 243977b..01bcb32 100644 (file)
@@ -62,3 +62,15 @@ _start:
        /* Ok, now run uClibc's main() -- shouldn't return */
        bl      __uClibc_main
 
+/* a little bit of stuff to support C++ */
+       .section .ctors,"aw"
+       .align 4
+       .global __CTOR_LIST__
+__CTOR_LIST__:
+       .long -1
+
+       .section .dtors,"aw"
+       .align 4
+       .global __DTOR_LIST__
+__DTOR_LIST__:
+       .long -1
index 79e0a67..0095e6c 100644 (file)
@@ -71,3 +71,17 @@ _start:
 
        /* Ok, now run uClibc's main() -- shouldn't return */
        call __uClibc_main
+
+/* a little bit of stuff to support C++ */
+       .section .ctors,"aw"
+       .align 4
+       .global __CTOR_LIST__
+__CTOR_LIST__:
+       .long -1
+
+       .section .dtors,"aw"
+       .align 4
+       .global __DTOR_LIST__
+__DTOR_LIST__:
+       .long -1
+
index c40224c..0498d06 100644 (file)
 
 extern void __uClibc_main(int argc,void *argv,void *envp);
 
+/* a little bit of stuff to support C++ */
+__asm__(".section .ctors,\"aw\"\n.align 4\n.global __CTOR_LIST__\n"
+       "__CTOR_LIST__:\n.long -1\n");
+
+__asm__(".section .dtors,\"aw\"\n.align 4\n.global __DTOR_LIST__\n"
+       "__DTOR_LIST__:\n.long -1\n");
+
 void _start(unsigned int first_arg)
 {
        unsigned int argc;
index 9eed91e..9866b20 100644 (file)
@@ -55,4 +55,16 @@ _start:
 
        bl      __uClibc_main
        
+/* a little bit of stuff to support C++ */
+       .section .ctors,"aw"
+       .align 4
+       .global __CTOR_LIST__
+__CTOR_LIST__:
+       .long -1
+
+       .section .dtors,"aw"
+       .align 4
+       .global __DTOR_LIST__
+__DTOR_LIST__:
+       .long -1
 
index b7e7f9b..2460e91 100644 (file)
@@ -30,7 +30,23 @@ asm(
        "\tstwu 1,-32(1)\n"
        "\tmtlr 0\n"
        //"\tstw 0,0(1)\n"
-       "\tb _start2\n");
+       "\tb _start2\n
+       
+       ");
+
+/* a little bit of stuff to support C++ */
+asm(
+       "\t.section .ctors,\"aw\"\n"
+       "\t.align 4\n"
+       "\t.global __CTOR_LIST__\n"
+       "__CTOR_LIST__:\n"
+       "\t.long -1\n"
+       "\t.section .dtors,\"aw\"\n"
+       "\t.align 4\n"
+       "\t.global __DTOR_LIST__\n"
+       "__DTOR_LIST__:\n"
+       "\t.long -1\n"
+       );
 
 void __uClibc_main(int argc,void *argv,void *envp);