diff options
author | Richard Henderson <rth@redhat.com> | 2001-12-21 11:44:06 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2001-12-21 11:44:06 -0800 |
commit | ef969525677f86bc8e7e188328939c5941f95b96 (patch) | |
tree | 9ffde0a5aac329e770856b6c7bd776b438a74a60 /gcc/java/class.c | |
parent | f44fefca1a1a6dae19898e885f71c3e8818588ae (diff) | |
download | gcc-ef969525677f86bc8e7e188328939c5941f95b96.zip gcc-ef969525677f86bc8e7e188328939c5941f95b96.tar.gz gcc-ef969525677f86bc8e7e188328939c5941f95b96.tar.bz2 |
class.c (compile_resource_file): Set TREE_PUBLIC on the constructor only if the target requires collect2.
* class.c (compile_resource_file): Set TREE_PUBLIC on the constructor
only if the target requires collect2.
From-SVN: r48252
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r-- | gcc/java/class.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c index e64e193..68e25b9 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); |