]> oss.titaniummirror.com Git - msp430-gcc.git/blobdiff - gcc/config/m32r/initfini.c
Imported gcc-4.4.3
[msp430-gcc.git] / gcc / config / m32r / initfini.c
index 066a67574488730089319553f5b37c93e08c56e5..6e7d58614c7fdcb46712acec95a420e7d2d989f1 100644 (file)
@@ -1,33 +1,28 @@
 /* .init/.fini section handling + C++ global constructor/destructor handling.
    This file is based on crtstuff.c, sol2-crti.asm, sol2-crtn.asm.
 
-Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-In addition to the permissions in the GNU General Public License, the
-Free Software Foundation gives you unlimited permission to link the
-compiled version of this file into combinations with other programs,
-and to distribute those combinations without any restriction coming
-from the use of this file.  (The General Public License restrictions
-do apply in other respects; for example, they cover modification of
-the file, and distribution when not linked into a combine
-executable.)
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+   Copyright (C) 1996, 1997, 1998, 2006, 2009 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
 
 /*  Declare a pointer to void function type.  */
 typedef void (*func_ptr) (void);
@@ -47,11 +42,11 @@ typedef void (*func_ptr) (void);
    symbol in crtinit.o, where they are defined.  */
 
 static func_ptr __CTOR_LIST__[1]
-  __attribute__ ((section (".ctors")))
+  __attribute__ ((used, section (".ctors")))
      = { (func_ptr) (-1) };
 
 static func_ptr __DTOR_LIST__[1]
-  __attribute__ ((section (".dtors")))
+  __attribute__ ((used, section (".dtors")))
      = { (func_ptr) (-1) };
 
 /* Run all the global destructors on exit from the program.  */
@@ -68,11 +63,11 @@ static func_ptr __DTOR_LIST__[1]
    refers to one particular associated `__DTOR_LIST__' which belongs to the
    same particular root executable or shared library file.  */
 
-static void __do_global_dtors ()
-asm ("__do_global_dtors") __attribute__ ((section (".text")));
+static void __do_global_dtors (void)
+asm ("__do_global_dtors") __attribute__ ((used, section (".text")));
 
 static void
-__do_global_dtors ()
+__do_global_dtors (void)
 {
   func_ptr *p;
 
@@ -123,21 +118,21 @@ __fini:\n\
    contained in these two sections.  */
 
 static func_ptr __CTOR_END__[1]
-  __attribute__ ((section (".ctors")))
+  __attribute__ ((used, section (".ctors")))
      = { (func_ptr) 0 };
 
 static func_ptr __DTOR_END__[1]
-  __attribute__ ((section (".dtors")))
+  __attribute__ ((used, section (".dtors")))
      = { (func_ptr) 0 };
 
 /* Run all global constructors for the program.
    Note that they are run in reverse order.  */
 
-static void __do_global_ctors ()
-asm ("__do_global_ctors") __attribute__ ((section (".text")));
+static void __do_global_ctors (void)
+asm ("__do_global_ctors") __attribute__ ((used, section (".text")));
 
 static void
-__do_global_ctors ()
+__do_global_ctors (void)
 {
   func_ptr *p;