From b932b8b1bb530cefca9dc7ff5ad2afbe5a881231 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Sat, 27 Mar 2010 15:43:19 +0000 Subject: re PR middle-end/41674 (/usr/ccs/bin/ld: Unsatisfied symbols: _GLOBAL__I_65535_0_main) PR middle-end/41674 * cgraphunit.c (cgraph_build_static_cdtor): If target doesn't have cdtors, set DECL_PRESERVE_P. * ipa.c (cgraph_externally_visible_p): Return true if declaration should be preseved. From-SVN: r157779 --- gcc/ipa.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/ipa.c') diff --git a/gcc/ipa.c b/gcc/ipa.c index c789a29..225f268 100644 --- a/gcc/ipa.c +++ b/gcc/ipa.c @@ -317,6 +317,8 @@ cgraph_externally_visible_p (struct cgraph_node *node, bool whole_program) return false; if (!whole_program) return true; + if (DECL_PRESERVE_P (node->decl)) + return true; /* COMDAT functions must be shared only if they have address taken, otherwise we can produce our own private implementation with -fwhole-program. */ -- cgit v1.1