summaryrefslogtreecommitdiffstats
path: root/gcc/java
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-21 19:44:06 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-21 19:44:06 +0000
commit1b8b687a7242ec713f60d341604c6070a52b449d (patch)
tree9ffde0a5aac329e770856b6c7bd776b438a74a60 /gcc/java
parent27a043a84e44e591ceaa4c547c510ec3bd938d7e (diff)
downloadppe42-gcc-1b8b687a7242ec713f60d341604c6070a52b449d.tar.gz
ppe42-gcc-1b8b687a7242ec713f60d341604c6070a52b449d.zip
* class.c (compile_resource_file): Set TREE_PUBLIC on the constructor
only if the target requires collect2. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48252 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog3
-rw-r--r--gcc/java/class.c7
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 7f3e20be9c5..6c0a6d706f0 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -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>
diff --git a/gcc/java/class.c b/gcc/java/class.c
index e64e1936a72..68e25b9ca43 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -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);
OpenPOWER on IntegriCloud