From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32418 invoked by alias); 10 Jan 2011 17:55:18 -0000 Received: (qmail 32410 invoked by uid 22791); 10 Jan 2011 17:55:18 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Jan 2011 17:55:12 +0000 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/47247] Linker plugin specification makes it difficult to handle COMDATs X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 10 Jan 2011 18:20:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-01/txt/msg00939.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47247 --- Comment #6 from Jan Hubicka 2011-01-10 17:54:51 UTC --- The plugin specification says that once the COMDAT is marked PREVAILING, it has to be output. "Any symbol marked PREVAILING_DEF must be defined in one object file added to the link after WPA is done, or an undefined symbol error will result. Any symbol marked PREVAILING_DEF_IRONLY may be left undefined (provided all references to the symbol have been removed), and the linker will not issue an error." GCC will optimize it out only if it is set PREVAILING_IRONLY, but I think we conlcuded earlier that this can not be used for symbols visible to dynamic linking (and GCC would use this info to bring the COMDAT symbol static). So I am convinced that with current API it is impossible and we need something like PREVAILING_IRONLY_EXPORTED or so for the case of symbol that is not used in current DSO but is exported. GCC can then use the knowledge of what COMDATs can be taken away.