diff options
Diffstat (limited to 'gcc/java')
-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 1044784186b..a0d1037dd2f 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +2005-04-13 Julian Brown <julian@codesourcery.com> + + * decl.c (finish_method): Give methods once-only linkage. + 2005-04-11 Richard Sandiford <rsandifo@redhat.com> * lang.opt: Refer to the GCC internals documentation instead of c.opt. diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 197c391e27c..168d30dba2a 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -2057,6 +2057,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) && ! METHOD_FINAL (fndecl)) + make_decl_one_only (fndecl); + /* Prepend class initialization for static methods reachable from other classes. */ if (METHOD_STATIC (fndecl) |