From patchwork Tue Jan 29 12:42:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 216514 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 9A2532C0079 for ; Tue, 29 Jan 2013 23:42:32 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1360068152; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Cc:Subject:Date:Message-ID:User-Agent: MIME-Version:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=ekM6DmzrfeSxdlyU9S6QMcxMcn4=; b=OLsMV/v1ZkVtBMz f5oI4iB1GjjRBZMz2EuqtV3FcOKC/1J2XErHsxLgiX1Wk6OstuzXZp2zJiynKh7w FWAi0IUeh7TOL/9FsbpOelUK9Y3ytdz8cVCFKNWN1WAupBATKBJAsA3pOty+VrzH qpZDzEoBoZHCSPZiHvHrhwB1CkOg= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:From:To:Cc:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=izgrnKoBFG4gPtvoZSxfMKMTIai9BmHMFPXBRVTu5Woe0c+NlwlJVLSuhRAmCX QMIQy60V21d5n+kDt4llNk8jfFDp9vFmA2BSNCCk+WyTF1VpclUDCpkbxYe968Gf Vp4sImeIaTyvZs/N0+4kjK0boY5lnsh78nwICOBWb//7Q=; Received: (qmail 5338 invoked by alias); 29 Jan 2013 12:42:26 -0000 Received: (qmail 5329 invoked by uid 22791); 29 Jan 2013 12:42:25 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, KHOP_SPAMHAUS_DROP, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 29 Jan 2013 12:42:20 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 96FC490F; Tue, 29 Jan 2013 13:42:18 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id H6JIa+UI7jm5; Tue, 29 Jan 2013 13:42:16 +0100 (CET) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 520EE90E; Tue, 29 Jan 2013 13:42:16 +0100 (CET) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id r0TCgFEs012931; Tue, 29 Jan 2013 13:42:15 +0100 (MET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Paolo Bonzini , Eric Botcazou Subject: [build] Properly set progbits/nobits for Solaris/SPARC as Date: Tue, 29 Jan 2013 13:42:15 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.92 (usg-unix-v) MIME-Version: 1.0 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 As originally reported as binutils PR ld/15057, several gfortran tests are failing on Solaris/SPARC with Sun as and GNU ld like this: FAIL: gfortran.dg/coarray/alloc_comp_1.f90 -fcoarray=lib -O2 -lcaf_single (test for excess errors) Excess errors: /vol/gcc/bin/gld-2.23.1: warning: section `.bss' type changed to PROGBITS As analyzed in the PR, this happens because .bss.* sections are not marked as SHT_NOBITS when Sun as is in use. The following patch fixes this; it should be low-risk since the result of the configure test (necessary since only Solaris 10/SPARC as added #nobits/#progbits support) is only used in a Solaris-specific function. Bootstrapped without regressions on sparc-sun-solaris2.11 (as/gld, gas/gld in progress), ok for mainline? Rainer 2013-01-25 Rainer Orth * configure.ac (HAVE_AS_SPARC_NOBITS): New test. * configure: Regenerate. * config.in: Regenerate. * config/sparc/sparc.c (sparc_solaris_elf_asm_named_section): Emit #nobits/#progbits if supported. # HG changeset patch # Parent 85fc0b8b3ae505640c01266617905fe671551692 Properly set progbits/nobits for Solaris/SPARC as diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -9512,7 +9512,14 @@ sparc_solaris_elf_asm_named_section (con if (flags & SECTION_CODE) fputs (",#execinstr", asm_out_file); - /* ??? Handle SECTION_BSS. */ + /* Sun as only supports #nobits/#progbits since Solaris 10. */ + if (HAVE_AS_SPARC_NOBITS) + { + if (flags & SECTION_BSS) + fputs (",#nobits", asm_out_file); + else + fputs (",#progbits", asm_out_file); + } fputc ('\n', asm_out_file); } diff --git a/gcc/configure.ac b/gcc/configure.ac --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3461,6 +3461,13 @@ case "$target" in [AC_DEFINE(HAVE_AS_REGISTER_PSEUDO_OP, 1, [Define if your assembler supports .register.])]) + gcc_GAS_CHECK_FEATURE([@%:@nobits], gcc_cv_as_sparc_nobits,,, + [.section "nobits",#alloc,#write,#nobits + .section "progbits",#alloc,#write,#progbits]) + AC_DEFINE_UNQUOTED(HAVE_AS_SPARC_NOBITS, + [`if test $gcc_cv_as_sparc_nobits = yes; then echo 1; else echo 0; fi`], + [Define to 1 if your assembler supports #nobits, 0 otherwise.]) + gcc_GAS_CHECK_FEATURE([-relax option], gcc_cv_as_sparc_relax,, [-relax], [.text],, [AC_DEFINE(HAVE_AS_RELAX_OPTION, 1,