diff options
author | Julian Brown <julian@codesourcery.com> | 2005-03-08 15:42:57 +0000 |
---|---|---|
committer | Julian Brown <jules@gcc.gnu.org> | 2005-03-08 15:42:57 +0000 |
commit | 9148ab01d166fe2ffb39292ba630074ad45cd3ce (patch) | |
tree | 56d088477d0aecc0e2f7dd76a85d0112fee3744e /gcc | |
parent | 77fb4cc1a1cfcf13f529a696eb370ef44a898201 (diff) | |
download | gcc-9148ab01d166fe2ffb39292ba630074ad45cd3ce.zip gcc-9148ab01d166fe2ffb39292ba630074ad45cd3ce.tar.gz gcc-9148ab01d166fe2ffb39292ba630074ad45cd3ce.tar.bz2 |
* decl.c (finish_method): Give methods once-only linkage.
From-SVN: r96106
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/java/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/java/decl.c | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 298bd72..78fab7f 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +2005-03-08 Julian Brown <julian@codesourcery.com> + + * decl.c (finish_method): Give methods once-only linkage. + 2005-03-07 Bryce McKinlay <mckinlay@redhat.com> * verify-glue.c (vfy_is_assignable_from): Perform static check using diff --git a/gcc/java/decl.c b/gcc/java/decl.c index b7aa616..ea7a9b4 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -2036,6 +2036,13 @@ finish_method (tree fndecl) build2 (TRY_FINALLY_EXPR, void_type_node, *tp, exit)); } + /* Ensure non-abstract non-static non-private members are defined only once + when linking. This is an issue when using CNI to interface with C++ object + files. */ + if (! METHOD_STATIC (fndecl) && ! METHOD_PRIVATE (fndecl) + && ! METHOD_ABSTRACT (fndecl)) + make_decl_one_only (fndecl); + /* Prepend class initialization for static methods reachable from other classes. */ if (METHOD_STATIC (fndecl) && ! METHOD_PRIVATE (fndecl) |