From patchwork Sun Oct 30 07:44:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Indu Bhagat X-Patchwork-Id: 12952 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1685887wru; Sun, 30 Oct 2022 00:47:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6pz/CP+dDEU2vLONIcv6G7fMyNYaMl8PRkgfXuDAVCbaSQqpGo1rIzMO4bxoNKKjRsPna1 X-Received: by 2002:a05:6402:5ca:b0:43b:6e01:482c with SMTP id n10-20020a05640205ca00b0043b6e01482cmr7841257edx.189.1667116047397; Sun, 30 Oct 2022 00:47:27 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ne13-20020a1709077b8d00b0078d45e9d485si4349743ejc.709.2022.10.30.00.47.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Oct 2022 00:47:27 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=OOH2lupG; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2733C3857B8B for ; Sun, 30 Oct 2022 07:46:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2733C3857B8B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667115998; bh=tfDt+CPpRW+Je9AkshLdEixSllOrbXWiLyWzWz/Z97Q=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=OOH2lupG0UWatALp3G532qRLSptOhwqRIg1E34u6pkl4ysDq9vsW1h57V1YDW7L+z O/3sBsp/9aidizlBEAdA34bBzjHm0TTwZcCYXiEb9sb9Vn/wZQkZhsvTG7WI2WWR2Q 4WY4Q+ECjIvnCnOLnLgMlyO8uy4QS2gqJiGORaig= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 72C2F3858027 for ; Sun, 30 Oct 2022 07:45:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 72C2F3858027 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29U3bJ8J023053 for ; Sun, 30 Oct 2022 07:45:15 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kgtkd1da6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 30 Oct 2022 07:45:14 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 29U6j2Xc035963 for ; Sun, 30 Oct 2022 07:45:14 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2174.outbound.protection.outlook.com [104.47.59.174]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kgtm8hgbv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 30 Oct 2022 07:45:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JoTYG1SI1tjGjzCYNpruDWJQ1t4uKaeInPYxYFT9mS9DaZOV3iyMSwKJLx8JWkZ6PCzNe75bt8mevJvvAV+s/gnTIM0GiHyfw2W0wuFsoOkEhjLyJ5cwr0gV9m8b9wz0UgC4kI7d60pgw1s8Bt1hCPcSUJC+HQpf3feTdIPecxNMBUbGT+6Mmg1nThiJ+FVE/Yk20rtyxvWRTf0WZrJRV27qQiGKSZXIbwY92RBOEU7iGwEChbajH1dPU7J1+EN9HijruZMEfBwEQMnhJzo9fYBe0BxF9Go33HYq1v81sb4tusmpHibzIUPaxJRAPTzAIbKKaHKn9dlk7kE+AY3W0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tfDt+CPpRW+Je9AkshLdEixSllOrbXWiLyWzWz/Z97Q=; b=aXL5fy1phnUBACbeammO8+wFgO0kELCH3x/80B7OIhrEYER/coa8pYCh1SIW9iCfT5pzbzUvAOGcn+depL8xoju4IvESnxhWYP8sMRG0EHAK8/C225O1KtPtD/JTbeAB9XfrP5TBedP582LwzlJFeywEsf4skFv0KAnFjKp/uWWckgt2V9cLIJFV2YVSoTLhTTcl2gwHljmyDGypbqVCXpSqb1aYEdugcK6wPY//bRa14+CRw0Mqtv9e6JkuJvCYiNWrN8Q1q9G48OIfvjornqaxPxXGJm92UI0ZrRJYuUWHkk+ZGIRr14fInPKczCQuQnsUxHfQRo9fFGhhl5ByzA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) by BY5PR10MB4289.namprd10.prod.outlook.com (2603:10b6:a03:20c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.19; Sun, 30 Oct 2022 07:45:07 +0000 Received: from MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::a505:15c2:a248:efa2]) by MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::a505:15c2:a248:efa2%7]) with mapi id 15.20.5723.033; Sun, 30 Oct 2022 07:45:07 +0000 To: binutils@sourceware.org Subject: [PATCH,V3 02/15] gas: add new command line option --gsframe Date: Sun, 30 Oct 2022 00:44:37 -0700 Message-Id: <20221030074450.1956074-3-indu.bhagat@oracle.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221030074450.1956074-1-indu.bhagat@oracle.com> References: <20221030074450.1956074-1-indu.bhagat@oracle.com> X-ClientProxiedBy: MW4PR04CA0095.namprd04.prod.outlook.com (2603:10b6:303:83::10) To MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2158:EE_|BY5PR10MB4289:EE_ X-MS-Office365-Filtering-Correlation-Id: b3410654-f9a8-428b-9223-08daba4aaa2a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7/4UKAp7INhJlhxfMeCsKYe7W0nQKpg4YjXc211OhI3FXSoES1PKpF1Bqs8qYpEHXNgqvg5gsUs+uHN7NBNm9j/HrNxCrLQYjqJlyOfUP9L8Fj/f11yREMf/A5AaozWZ+J17+IHZuTSGwLLaJfAb8YA/2xergyVhqyDmuCMxb5Njyk1xDcP+u8ZxOw43QW+s/4un0oF8ullf3Jm/dxz2LU2vIR+jrtQ+xeB0qVyP+OKfTlKl5LGrYjgFY49oXyaiyYvhMAE2dLB/QLkfPjE+DYavaWUykQBIM/auE5SM8XcNnirVG+ya35bCBugwDZF+Cm37OcP4o/GEnQhzb1R8MAlzJ8FetHswZOLyS1hLIIjwLebsQJbdku0kKQisLU0hi6cXdXLCFw/Hvbee23WCRI6h6DhKbtH1jqcngZfUyj2I0NweJJaJGRDUuZpOQIJQoBgDsIXfYV+wecirnsn6Hb1Bk7e47cLQHqd4D7MiKsIOtR3BArtn3KeVu1iWyfewL9V+8ZHGC0yn/KBcGtnar3dHxuFanNQJ+xxJl81cEhixjFMlksiH2E7SoiSFE+I4RAvKImRCFBya5xd9P7el92UbqU+u8f/z5aacOqTNPaE4LteCg71cPqI7eT981Pghag8p6MHTAmjAi3fNhT9iPKE4rXgRb+YlHCDgAgzu0QkqGGGs2Ir8ftLggjlFuZuaq1pU8pIxya45d2BSrgLjAw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1001MB2158.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(39850400004)(376002)(346002)(136003)(451199015)(316002)(66556008)(4326008)(66476007)(36756003)(6916009)(66946007)(6486002)(38100700002)(6666004)(8936002)(41300700001)(86362001)(107886003)(478600001)(5660300002)(1076003)(186003)(83380400001)(8676002)(2616005)(44832011)(2906002)(6512007)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Eblyggj0TwMjk0f9JOCLtcElquSbWXJyjccSL1Sja+veXRqec+2LUhulVJ5ran09LUScXqKphSH28YguBjoF04NJHcMJrnAhcweN3W455pcXpriWz7UFcCRanL2vCMQ5EGDcrkOXR1Kl9K/vteCeZGVLOaRyxNGCrAokePsYOodFjF/bvW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xQ+aSKw7rUacQ86bFs07VNqFZrhk0NWN2tNPS+uCnzt0S8psVVbRLHuD0rnQ18oWZjLU3UrB0xCvrLa1NQBBhd1Ic8B9mEgcJxRaLyM/x6BzWZdP+KabcsfGl53oOt72OChjzIkYq8iiJTLFZI1SQT8HAD0Aj2z6XLChfnlJSGYuKMwioHU/vkbZkMBj/mBSOx8ETowWPAMPSrbXkU79LOpW1ORK3kH0OwdTs1ACCRjRobyUXqCLZ98juv9qs+heveHgn85+2iPLtP+0uKiUs481ecep+MEDbFVW6nQen6dTCjtm61Pf1tirO9jt9NG6RWsyGqTEZWG+YwYfhBrtO/R1cvRbPDnGVepMNYbzpG1SR4WHjqBtlKQeEuLSOKMHPwo= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3410654-f9a8-428b-9223-08daba4aaa2a X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2158.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2022 07:45:07.3015 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JSxnkCqL/ETYrFAiPcjQ25Z3K4l0jYrjyEiLTHxvuaAXfaLrinCnvfnZCkNBw2+sTy0xzH2fDgKvoLMgX3RTiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4289 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-30_02,2022-10-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 suspectscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2210300049 X-Proofpoint-ORIG-GUID: KeOIakbA2FpMkWisnrPB_bBNEYxEUiBj X-Proofpoint-GUID: KeOIakbA2FpMkWisnrPB_bBNEYxEUiBj X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Indu Bhagat via Binutils From: Indu Bhagat Reply-To: Indu Bhagat Cc: Indu Bhagat Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748097876563740297?= X-GMAIL-MSGID: =?utf-8?q?1748097876563740297?= [No changes in V3, V2] When --gsframe is specified, the assembler will generate a .sframe section from the CFI directives in the assembly. ChangeLog: * gas/as.c (parse_args): Parse args and set flag_gen_sframe. * gas/as.h: Introduce skeleton for --gsframe. * gas/doc/as.texi: document --gsframe. --- gas/as.c | 10 +++++++++- gas/as.h | 3 +++ gas/doc/as.texi | 6 ++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/gas/as.c b/gas/as.c index d42dd5394b5..80a2cb9a418 100644 --- a/gas/as.c +++ b/gas/as.c @@ -315,6 +315,8 @@ Options:\n\ #endif fprintf (stream, _("\ generate GNU Build notes if none are present in the input\n")); + fprintf (stream, _("\ + --gsframe generate SFrame unwind info\n")); #endif /* OBJ_ELF */ fprintf (stream, _("\ @@ -499,7 +501,8 @@ parse_args (int * pargc, char *** pargv) OPTION_COMPRESS_DEBUG, OPTION_NOCOMPRESS_DEBUG, OPTION_NO_PAD_SECTIONS, - OPTION_MULTIBYTE_HANDLING /* = STD_BASE + 40 */ + OPTION_MULTIBYTE_HANDLING, /* = STD_BASE + 40 */ + OPTION_SFRAME /* When you add options here, check that they do not collide with OPTION_MD_BASE. See as.h. */ }; @@ -530,6 +533,7 @@ parse_args (int * pargc, char *** pargv) ,{"elf-stt-common", required_argument, NULL, OPTION_ELF_STT_COMMON} ,{"sectname-subst", no_argument, NULL, OPTION_SECTNAME_SUBST} ,{"generate-missing-build-notes", required_argument, NULL, OPTION_ELF_BUILD_NOTES} + ,{"gsframe", no_argument, NULL, OPTION_SFRAME} #endif ,{"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL} ,{"gdwarf-2", no_argument, NULL, OPTION_GDWARF_2} @@ -993,6 +997,10 @@ This program has absolutely no warranty.\n")); optarg); break; + case OPTION_SFRAME: + flag_gen_sframe = 1; + break; + #endif /* OBJ_ELF */ case 'Z': diff --git a/gas/as.h b/gas/as.h index 730e134dce6..1b924071938 100644 --- a/gas/as.h +++ b/gas/as.h @@ -337,6 +337,9 @@ COMMON int flag_execstack; /* TRUE if .note.GNU-stack section with SEC_CODE should be created */ COMMON int flag_noexecstack; +/* TRUE if .sframe section should be created. */ +COMMON int flag_gen_sframe; + /* name of emitted object file */ COMMON const char *out_file_name; diff --git a/gas/doc/as.texi b/gas/doc/as.texi index a0384cf1f77..83f49c518d7 100644 --- a/gas/doc/as.texi +++ b/gas/doc/as.texi @@ -240,6 +240,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. [@b{--gdwarf-}] [@b{--gdwarf-sections}] [@b{--gdwarf-cie-version}=@var{VERSION}] [@b{--generate-missing-build-notes=[no|yes]}] + [@b{--gsframe}] [@b{--hash-size}=@var{N}] [@b{--help}] [@b{--target-help}] [@b{-I} @var{dir}] @@ -847,6 +848,11 @@ These options control whether the ELF assembler should generate GNU Build attribute notes if none are present in the input sources. The default can be controlled by the @option{--enable-generate-build-notes} configure option. + +@item --gsframe +@itemx --gsframe +Create @var{.sframe} section from CFI directives. + @end ifset @item --hash-size @var{N}