From patchwork Tue Sep 27 19:58:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 116658 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]) by ozlabs.org (Postfix) with SMTP id 51BC0B6F75 for ; Wed, 28 Sep 2011 05:58:55 +1000 (EST) Received: (qmail 31618 invoked by alias); 27 Sep 2011 19:58:52 -0000 Received: (qmail 31610 invoked by uid 22791); 27 Sep 2011 19:58:51 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 27 Sep 2011 19:58:37 +0000 Received: by wyh5 with SMTP id 5so8241167wyh.20 for ; Tue, 27 Sep 2011 12:58:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.7.37 with SMTP id b37mr7790205wbb.99.1317153516161; Tue, 27 Sep 2011 12:58:36 -0700 (PDT) Received: by 10.180.88.165 with HTTP; Tue, 27 Sep 2011 12:58:36 -0700 (PDT) Date: Tue, 27 Sep 2011 21:58:36 +0200 Message-ID: Subject: [patch windows]: Support SECTION_EXCLUDE for pe-coff targets From: Kai Tietz To: GCC Patches Cc: Richard Henderson X-IsSubscribed: yes 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 Hi, this patch enables same feature as in thread "[google] Add SECTION_EXCLUDE flag and exclude .gnu.callgraph sections (issue5126041)" for pe-coff x86 and x64 targets. ChangeLog 2011-09-27 Kai Tietz * configure.ac: Add test for new section attribute specifier "e" via define HAVE_GAS_SECTION_EXCLUDE. * config.in: Regenerated. * configure: Regenerated. * config/i386/winnt.c (i386_pe_asm_named_section): Emit new section flag "e" for excluded sections, if supported. Tested for x86_64-w64-mingw32, i686-w64-mingw32, and i686-pc-cygwin. Ok for apply? Index: gcc/gcc/config/i386/winnt.c =================================================================== --- gcc.orig/gcc/config/i386/winnt.c +++ gcc/gcc/config/i386/winnt.c @@ -484,6 +484,11 @@ i386_pe_asm_named_section (const char *n { char flagchars[8], *f = flagchars; +#ifdef HAVE_GAS_SECTION_EXCLUDE + if ((flags & SECTION_EXCLUDE) != 0) + *f++ = 'e'; +#endif + if ((flags & (SECTION_CODE | SECTION_WRITE)) == 0) /* readonly data */ { Index: gcc/gcc/configure.ac =================================================================== --- gcc.orig/gcc/configure.ac +++ gcc/gcc/configure.ac @@ -3553,6 +3553,15 @@ foo: nop ;; esac fi + # Test if the assembler supports the section flag 'e' for specifying + # an excluded section. + gcc_GAS_CHECK_FEATURE([.section with e], gcc_cv_as_section_has_e, + [2,22,51],, +[.section foo1,"e" +.byte 0,0,0,0]) + AC_DEFINE_UNQUOTED(HAVE_GAS_SECTION_EXCLUDE, + [`if test $gcc_cv_as_section_has_e = yes; then echo 1; else echo 0; fi`], + [Define if your assembler supports specifying the section flag e.]) ;; esac