From patchwork Sat Feb 9 22:01:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1039298 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-495639-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="FWBnaeUT"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43xmH62WqVz9s4Z for ; Sun, 10 Feb 2019 09:01:48 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=ci8B8XRFv2dRi9G8H17kG2RwISmIkNIfLV/TnxFymt1JELVdeq665 29QT09lWXnFM0h0G2jRDEUfqvXD5Mj/CfNOk61wXgvOzXzU/ElTmicKR7sUg2NwD TT6Bcvb8sTegCAEn/izsCNJTr1/N3u/jyyzcICi7mEIDSzpdGyj3Vc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=JZHKFOFIkrC5agpGIsF++d78W78=; b=FWBnaeUTHlZjCg9o8du6 u32xxEK8+O9F3/FE7wtqMVbTY8cDRTTQDOC0NiKbfIEYoJwqZsERDHz4g5I6FxXv gihabFgK9+ddczbZJ+7O1fGatIPBaQbiNxa5unsKdkP2qv6eTMeLXyfQcwU9gskn IS13dQgiCwAZuo1U172fEF4= Received: (qmail 4978 invoked by alias); 9 Feb 2019 22:01:41 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 4969 invoked by uid 89); 9 Feb 2019 22:01:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=localization X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 09 Feb 2019 22:01:39 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 44463281EEA; Sat, 9 Feb 2019 23:01:36 +0100 (CET) Date: Sat, 9 Feb 2019 23:01:36 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix localization of comdats Message-ID: <20190209220136.372lqazt3qo36uix@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Hi, this patch fixes undefined symbols when COMDAT group contains some symbols with LDPR_PREVAILING_DEF_IRONLY_EXP and others with LDPR_PREVIALING_DEF. In this case we can not optimized out the symbol defined LDPR_PREVAILING_DEF because it will be used by linker for second stage linking. We can still break-up the comdat and privatize LDPR_PREVAILING_DEF_IRONLY_EXP symbols knowing that address is not taken and duplication of these symbols within shared libraries is safe. Bootstrapped/regtested x86_64-linux. Comitted. Honza * ipa-visibility.c (localize_node): Also do not localize LDPR_PREVAILING_DEF_IRONLY_EXP. Index: ipa-visibility.c =================================================================== --- ipa-visibility.c (revision 268722) +++ ipa-visibility.c (working copy) @@ -539,7 +539,8 @@ localize_node (bool whole_program, symta symbols. In this case we can privatize all hidden symbol but we need to keep non-hidden exported. */ if (node->same_comdat_group - && node->resolution == LDPR_PREVAILING_DEF_IRONLY) + && (node->resolution == LDPR_PREVAILING_DEF_IRONLY + || node->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP)) { symtab_node *next; for (next = node->same_comdat_group;