elfos.h (MAKE_DECL_ONE_ONLY): Redefined to stop DECL_WEAK from being used for symbols with vague linkage when...

* gcc/config/elfos.h (MAKE_DECL_ONE_ONLY): Redefined to stop DECL_WEAK
	from being used for symbols with vague linkage when
	HAVE_GAS_COMDAT_GROUP is true.
	* gcc/java/decl.c (finish_method): Give methods once-only linkage.

From-SVN: r98089
This commit is contained in:
Julian Brown 2005-04-13 15:24:03 +00:00 committed by Julian Brown
parent 2c43a1491e
commit e22a7bcf26
4 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2005-04-13 Julian Brown <julian@codesourcery.com>
* config/elfos.h (MAKE_DECL_ONE_ONLY): Redefined to stop DECL_WEAK from
being used for symbols with vague linkage when HAVE_GAS_COMDAT_GROUP
is true.
2005-04-13 Kazu Hirata <kazu@cs.umass.edu>
* basic-block.h, tree-ssa-uncprop.c, varasm.c,

View File

@ -212,7 +212,15 @@ Boston, MA 02111-1307, USA. */
fprintf ((FILE), "%s\n", ASM_SECTION_START_OP)
#endif
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
/* Don't use weak for entities with vague linkage when HAVE_GAS_COMDAT_GROUP
is true. */
#define MAKE_DECL_ONE_ONLY(DECL) \
do \
{ \
if (!HAVE_GAS_COMDAT_GROUP) \
DECL_WEAK(DECL) = 1; \
} \
while (0)
/* Switch into a generic section. */
#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section

View File

@ -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.

View File

@ -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)