From patchwork Wed Sep 11 08:33:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 274197 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 647BD2C00C9 for ; Wed, 11 Sep 2013 18:33:19 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=hhAcpzBbP/sDnneE/LsREJMj3houPsHRk5AX70qP7m44R6 I3PJlCEqAoBk4cGacby9P4MEc9iYy329eA5hl3dmpmIhrNhNOvfO9H6FX0TcqreR TaYjS8v0nVYFH2MmtoNiqC+Kfz5uEloN/HT8oGBcZ+X28DL4jos8haKh/zYKs= 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 :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=w/AZxQlLJRulps2l2g7SA385PyE=; b=xk12asZK+3TZiw+1dB0b mXPDbeT2Ihz9eAK/cq5LCBCj8dO15BQif+xj6cQ1gCCi+pTvlGNjSxS/u/DSLb6k xcZk8SscynugRJyvceIBmGl9E2x2sn87Sdu8XzcO81I4XlK8XufP8SuFKkaMCZn2 R5izY/oPd8YYBrYtToAEoXo= Received: (qmail 3374 invoked by alias); 11 Sep 2013 08:33:12 -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 3365 invoked by uid 89); 11 Sep 2013 08:33:12 -0000 Received: from mail-ie0-f171.google.com (HELO mail-ie0-f171.google.com) (209.85.223.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 11 Sep 2013 08:33:12 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, NO_RELAYS autolearn=no version=3.3.2 X-HELO: mail-ie0-f171.google.com Received: by mail-ie0-f171.google.com with SMTP id 16so7578046iea.30 for ; Wed, 11 Sep 2013 01:33:09 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.51.16.3 with SMTP id fs3mr11591638igd.53.1378888389874; Wed, 11 Sep 2013 01:33:09 -0700 (PDT) Received: by 10.64.133.138 with HTTP; Wed, 11 Sep 2013 01:33:09 -0700 (PDT) Date: Wed, 11 Sep 2013 10:33:09 +0200 Message-ID: Subject: [patch windows i386]: Make sure that really-external functions aren't dllexported From: Kai Tietz To: GCC Patches X-IsSubscribed: yes Hi, this patch takes care that for C/C++ inlines aren't dll-exported. ChangeLog 2013-09-11 Kai Tietz * config/i386/winnt-cxx.c (i386_pe_type_dllexport_p): Don't dll-export inline-functions. * config/i386/winnt.c (i386_pe_determine_dllexport_p): Likewise. Tested for x86_64-w64-mingw32 and i686-w64-mingw32. I will apply this in a couple of hours, if there are no objections. Regards, Kai Index: winnt-cxx.c =================================================================== --- winnt-cxx.c (Revision 202491) +++ winnt-cxx.c (Arbeitskopie) @@ -65,6 +65,13 @@ i386_pe_type_dllexport_p (tree decl) if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE && DECL_ARTIFICIAL (decl) && !DECL_THUNK_P (decl)) return false; + if (TREE_CODE (decl) == FUNCTION_DECL + && DECL_DECLARED_INLINE_P (decl)) + { + if (DECL_REALLY_EXTERN (decl) + || !flag_keep_inline_dllexport) + return false; + } return true; } Index: winnt.c =================================================================== --- winnt.c (Revision 202491) +++ winnt.c (Arbeitskopie) @@ -110,6 +110,11 @@ i386_pe_determine_dllexport_p (tree decl) if (!TREE_PUBLIC (decl)) return false; + if (TREE_CODE (decl) == FUNCTION_DECL + && DECL_DECLARED_INLINE_P (decl) + && !flag_keep_inline_dllexport) + return false; + if (lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl))) return true;