From patchwork Mon Mar 20 06:33:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 66632 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B6D763858033 for ; Mon, 20 Mar 2023 06:34:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B6D763858033 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679294048; bh=0JlNqu78xgg2V/rdL9PUhsDQEWIzgWh5WTrXV0fYRqI=; h=Date:Subject:To:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Wh1jWqPANk9+DIzA/QWS7NihZbGQgCQQnEAtrOEnx1XJ9n5VcFRsLMugTAxmnrDkI B1q+XBQvfpPjOVzJFUGnnH9Rgjd3ki3TEM3SgC/vnMXCnvUc4ulZbUdwrvnfmE8hZG Pffk9P0O6hVTWu2dlc6nLWbW3uD5gIsAp5U3uxoc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 7CD523858C53 for ; Mon, 20 Mar 2023 06:33:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7CD523858C53 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32K4e8S2014748; Mon, 20 Mar 2023 06:33:25 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pdqca7fxt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Mar 2023 06:33:25 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32K5SEPx038497; Mon, 20 Mar 2023 06:33:24 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pdqca7fx2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Mar 2023 06:33:24 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32K4YQBM022403; Mon, 20 Mar 2023 06:33:22 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3pd4x6asq0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Mar 2023 06:33:22 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32K6XJZ625362800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 20 Mar 2023 06:33:19 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EE7FB20043; Mon, 20 Mar 2023 06:33:18 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8F44120049; Mon, 20 Mar 2023 06:33:15 +0000 (GMT) Received: from [9.177.11.227] (unknown [9.177.11.227]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 20 Mar 2023 06:33:15 +0000 (GMT) Message-ID: <050edd6f-0ad9-fbad-a9e5-03ec7b937971@linux.ibm.com> Date: Mon, 20 Mar 2023 14:33:13 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: en-US Subject: [PATCH] libgcc: Use initarray section type for .init_stack To: GCC Patches Cc: AlanM , Segher Boessenkool , David Edelsohn , Peter Bergner , Uros Bizjak , ian@airs.com, krebbel@linux.ibm.com X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Ha83oUCppCTYdOjIk8xEKYr8xzpODEc_ X-Proofpoint-ORIG-GUID: OLDST7vDqeG7yBQcfbQPQfXdV6mLE2lv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-20_04,2023-03-16_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 spamscore=0 adultscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 clxscore=1011 impostorscore=0 mlxscore=0 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303200057 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Kewen.Lin via Gcc-patches" From: "Kewen.Lin" Reply-To: "Kewen.Lin" Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi, One of my workmates found there is a warning like: libgcc/config/rs6000/morestack.S:402: Warning: ignoring incorrect section type for .init_array.00000 when compiling libgcc/config/rs6000/morestack.S. Since commit r13-6545 touched that file recently, which was suspected to be responsible for this warning, I did some investigation and found this is a warning staying for a long time. For section .init_stack*, it's preferred to use section type SHT_INIT_ARRAY. So this patch is use "@init_array" to replace "@progbits". Although the warning is trivial, Segher suggested me to post this to fix it, in order to avoid any possible misunderstanding/confusion on the warning. As Alan confirmed, this doesn't require a premise check on if the existing binutils supports "@init_array" or not, "because if you want split-stack to work, you must link with gold, any version of binutils that has gold has an assembler that understands @init_array". (Thanks Alan!) Bootstrapped and regtested on x86_64-redhat-linux and powerpc64{,le}-linux-gnu. Is it ok for trunk when next stage 1 comes? BR, Kewen ----- libgcc/ChangeLog: * config/i386/morestack.S: Use @init_array rather than @progbits for section type of section .init_array. * config/rs6000/morestack.S: Likewise. * config/s390/morestack.S: Likewise. --- libgcc/config/i386/morestack.S | 2 +- libgcc/config/rs6000/morestack.S | 2 +- libgcc/config/s390/morestack.S | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -- 2.31.1 diff --git a/libgcc/config/i386/morestack.S b/libgcc/config/i386/morestack.S index 7ae99b50cf5..c822b71e2dd 100644 --- a/libgcc/config/i386/morestack.S +++ b/libgcc/config/i386/morestack.S @@ -850,7 +850,7 @@ __morestack_make_guard: # This is ELF specific. #if HAVE_INITFINI_ARRAY_SUPPORT - .section .init_array.00000,"aw",@progbits + .section .init_array.00000,"aw",@init_array #else .section .ctors.65535,"aw",@progbits #endif diff --git a/libgcc/config/rs6000/morestack.S b/libgcc/config/rs6000/morestack.S index f2fea6abb10..dd1e27cd454 100644 --- a/libgcc/config/rs6000/morestack.S +++ b/libgcc/config/rs6000/morestack.S @@ -399,7 +399,7 @@ ENTRY0(__morestack_make_guard) # Make __stack_split_initialize a high priority constructor. #if HAVE_INITFINI_ARRAY_SUPPORT - .section .init_array.00000,"aw",@progbits + .section .init_array.00000,"aw",@init_array #else .section .ctors.65535,"aw",@progbits #endif diff --git a/libgcc/config/s390/morestack.S b/libgcc/config/s390/morestack.S index 09a49bb8851..f52e7a6510c 100644 --- a/libgcc/config/s390/morestack.S +++ b/libgcc/config/s390/morestack.S @@ -597,7 +597,7 @@ __morestack_make_guard: # Make __stack_split_initialize a high priority constructor. #if HAVE_INITFINI_ARRAY_SUPPORT - .section .init_array.00000,"aw",@progbits + .section .init_array.00000,"aw",@init_array #else .section .ctors.65535,"aw",@progbits #endif