class.c (compile_resource_file): Set TREE_PUBLIC on the constructor only if the targe...
authorRichard Henderson <rth@redhat.com>
Fri, 21 Dec 2001 19:44:06 +0000 (11:44 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 21 Dec 2001 19:44:06 +0000 (11:44 -0800)
        * class.c (compile_resource_file): Set TREE_PUBLIC on the constructor
        only if the target requires collect2.

From-SVN: r48252

gcc/java/ChangeLog
gcc/java/class.c

index 7f3e20be9c56bfb94e27ba0e405fff4fe2c3f5ba..6c0a6d706f0433d75c796378e32976c3c3664c17 100644 (file)
@@ -1,5 +1,8 @@
 2001-12-21  Richard Henderson  <rth@redhat.com>
 
+       * class.c (compile_resource_file): Set TREE_PUBLIC on the constructor
+       only if the target requires collect2.
+
        * class.c (build_class_ref): Mark _Jv_fooClass DECL_EXTERNAL.
 
 2001-12-20  Tom Tromey  <tromey@redhat.com>
index e64e1936a72d52a5a7b52d2f083d7aab8f1e82f9..68e25b9ca43fd6706861a714294bb835d20b91b1 100644 (file)
@@ -923,8 +923,11 @@ compile_resource_file (name, filename)
     current_function_decl = init_decl;
     DECL_RESULT (init_decl) = build_decl (RESULT_DECL, 
                                          NULL_TREE, void_type_node);
-    /*  DECL_EXTERNAL (init_decl) = 1;*/
-    TREE_PUBLIC (init_decl) = 1;
+
+    /* It can be a static function as long as collect2 does not have
+       to scan the object file to find its ctor/dtor routine.  */
+    TREE_PUBLIC (init_decl) = ! targetm.have_ctors_dtors;
+
     pushlevel (0);
     make_decl_rtl (init_decl, NULL);
     init_function_start (init_decl, input_filename, 0);