From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 5D8223858C00 for ; Sun, 6 Nov 2022 05:30:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5D8223858C00 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2A63DMS5005448; Sun, 6 Nov 2022 05:30:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=KqQkJPXEPXuiy1tdW8NGdvFvkYfjSYbwR6+xcMgsqxE=; b=HJ6bZiqcbkMSQuvOCgDgzcEe6WZeUTlA0t0pgwXThF2C0KlVYql4Iu98+KuXLguNqA25 UG750mQT/LYsth2qY8M/CsWLRhlnDywAkjTU6fK6+Ry3niYFo76CNMuzCf7m3xYyvnPh q0lHhUzQK7G4wqpAihdoz1rU15KZrK8RpPBrU0d1A8UyX2F+y3zXDiQwgkPGHcrEBBbL N2Tk5eWaH8qAH4lk5P6HPvT6muYM5AZiPwvnqnVKGBA6UqgHRObSuq9fwAWk5tS/HJIR leB0jseWU0Uqzjuru5CVifwNy/QWtiSdfFdYNrssVKlqa6h+BPy+shOj3Td3h4YY7WJF eA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kngk697k7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 06 Nov 2022 05:30:19 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2A64Y6VS023590; Sun, 6 Nov 2022 05:30:18 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kngccdf2j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 06 Nov 2022 05:30:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dMd9U0Q7xW3Bm1oTy2cUykNYPJBNLSf2MEBAc0n2h22rEtrQMlkA/FpSTDK9F1+Y8pFPRH5gdJu5htQrl2zfhfkE82mEhOBdFsxKXvgXW9pvhGq/oMKbFHsdC/2F4BVJl3s//gCNi5MHxfRxGzh6J0wbonRec+PISo1q31QYFlwfH1tLFQClHP0nT6Vor4uMziRLekWLgud9qCGuyXFiL/9tEDQDvRWFyIHiye19zmBITlgwPk1X/R1R6uM/56KnmrDVDvDv9QM8136ZZji82PhaMRM9o+FD2gvaUc608qMLmtLWQ2hzVgXZ6qMAd1ddF2ib+Qx4XIsrq1LSnK59nQ== 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=KqQkJPXEPXuiy1tdW8NGdvFvkYfjSYbwR6+xcMgsqxE=; b=kFTGa4YLYnx7pyNxQ5HZirD52bUnrSaXAKjLhtf4CtK3y4uX+qK2e1FhHh8wukeSPkwIs5L69Yc2HnL8UqpHSejLragk3tWrBUIxcNx9wHtsh4iV3kHoYT4CO8MK3E82QaQJX9Yc+OE54CUt8QoXz22AxMOWCvmorEmT1EzZxTjTJomnzKKhy6Eu0DH9qdLHH0IdDYOwsR/dnaXt33f6L4CVMXvRS7UhxjG9tkGw0WAZJQZdeoT7wzdu+BtVob1OmiMI3x/srIK53BOLnrh6+SnboqIwQP0zJE1ZBJnMslH2gbNdOTblXiar37jUAvBkKSk0nlkWR7BThScEndsL7g== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KqQkJPXEPXuiy1tdW8NGdvFvkYfjSYbwR6+xcMgsqxE=; b=Q7+Kq+u8et5uoSUxFLFsS+s3Z1F6GE0yvF4O/FkRUsuyrkXu1uazOL5Q4qEOI41D2i8LMruPu37cnpI/cJeMfzu1xDzUX8bBQe9HNJYESnQltBiw649w+o4lRp3cGhKdpk0VwNjCTUxX4C93B5wnqA7gG4kSKl9QaEP6OxQu5FY= Received: from MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) by DM4PR10MB5968.namprd10.prod.outlook.com (2603:10b6:8:af::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22; Sun, 6 Nov 2022 05:30:14 +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, 6 Nov 2022 05:30:14 +0000 Message-ID: Date: Sat, 5 Nov 2022 22:30:12 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH,V3 03/15] gas: generate .sframe from CFI directives Content-Language: en-US To: binutils@sourceware.org, Mike Frysinger References: <20221030074450.1956074-1-indu.bhagat@oracle.com> <20221030074450.1956074-4-indu.bhagat@oracle.com> From: Indu Bhagat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW4PR04CA0175.namprd04.prod.outlook.com (2603:10b6:303:85::30) To MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2158:EE_|DM4PR10MB5968:EE_ X-MS-Office365-Filtering-Correlation-Id: 40010071-0ca8-40ce-0cf0-08dabfb7fb49 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5OntDLkrCcTJYIsWlV2gm8BLhuXAeWMUsZG4KVZP1FdbXSpmdJTXmN8UzabtsxUyf18GF18Rb+6vHpV29LCWilHs1SZ9lsYnB/Bh6ycqhnBtsjnRm6Qgsnh/utiL2uf2LPJXpG5STP1pQNnz+i1H7CVTYyxEvkV48jsqIP+JCv47i3aqZjwIG2+GGcSBSyQAfRvxR2bzgZm0JR1xJvA5yJMdiIJ9WZI+TeJU9XgskVMJ5Vo9Id6dGVKX0TQn3iVtPPKgJPw8knpwj25kJRuC2y2T9Kr9RenWL2rJLKFWeBXndQkEFI0llhIH27Jnu4aaW7GQLO6ccvZy0WRWzUwdGllp8OteFmwSgH5LqAXN/9LA+/WgOb27VH1dgy8v359vFE7ASOlhwKUSpMaaNqgsQwzTJ3GaQ9wbhD7ftekvDV3TMrjO7Y+OYeXkL1W7u3NeoJRSiBmI6z6ifE8zAitKG4bHeE0ydghrfHo9V0Pex4vuH/LRUnuEK6A7U7Gljmab37CMoIqW12M+sFwL+WKYDex1KQO+ll4nE69n4q4J49MsSBzC2KXtMcnH2qWzuTdqky1f2wQmlnpdLbi56b9TgIJ7BIbz8HykFTmZA+obWk+7dD1WYxfaquCWe4I/x/5X8L+6DAyu9THZUQ2bJ71IRihENFw4leeUbOP8pnY5Q3vLBV/59Ggm0MOTkXMZ5vR70IihB8bZeVn0h2NEZSnRzTJszJKXT2HiMzntSDfqO2UDphvWX/DIh0E+DmwVpArMGHfTGB46ES0/Dzl3A9H+cu4NNqeSbflArZuY+Rts0xPfoFzItLjy+3MCkV8T0mO4/sIf/movb7/GKbBHy1DU1w== 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)(376002)(396003)(39860400002)(366004)(136003)(346002)(451199015)(31686004)(186003)(44832011)(478600001)(38100700002)(6486002)(2906002)(83380400001)(6506007)(86362001)(45080400002)(8936002)(5660300002)(6916009)(36756003)(2616005)(31696002)(316002)(66946007)(8676002)(66556008)(66476007)(53546011)(6512007)(41300700001)(142923001)(2004002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WVgzZkFUYzFObWpTaFJ3VW1lM1BiN1U4Tjl3K1RGY1hVMmpOSmRRcVhBRjFE?= =?utf-8?B?L29QcGtjWjA4VjF5MmYrZHJMa2F6U0ZTZlJwRkkxR2xiVU1DQllNd242NXZv?= =?utf-8?B?R1Y0aTB3SnRiVWpKck9ycnNWYzFxMGpnaG5qSkI1VHN3VmZBRUk4bWY1TWRh?= =?utf-8?B?U3dSRTljNEdEWWVxMDlzK1Q3S1VmNng0eUlXK25idkJ6ZitaQndKTlBDZ0dJ?= =?utf-8?B?UE13YVl0cnhja09zUHQraUFucE1POFdtc2I2YkNGYTJSeFE0bVpkO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YMlZGR2MrZldRakdKZis2ZmtuSTFQdUlTSmd2MWtkeUhYdjZmOTY5TXJ0?= =?utf-8?B?MjN4VnJvTEM1YVM0WGlLK0JzUmhKWnZyWmxHL0xkdWhsM1dZQ2ZWZHloRnZE?= =?utf-8?Q?fOmMMa1j/NpXSvWgJP9bsc0=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40010071-0ca8-40ce-0cf0-08dabfb7fb49 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2158.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2022 05:30:14.4322 (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: LRQyih5OCPYWJd7OjWJhLHxSwx0quX3JNYL0dwGbV8DhA+UeyEk9HiG5u+xp5WGKGQUQ5D7ZBOtT31H6NjWi4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB5968 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-06_02,2022-11-03_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 suspectscore=0 phishscore=0 bulkscore=0 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211060051 X-Proofpoint-ORIG-GUID: ygdYpPsAZg7yXmoQZ2-6VT4u14EMkYQ5 X-Proofpoint-GUID: ygdYpPsAZg7yXmoQZ2-6VT4u14EMkYQ5 X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 List-Id: Hi Mike, On 10/30/22 01:03, Mike Frysinger wrote: > On 30 Oct 2022 00:44, Indu Bhagat via Binutils wrote: >> --- a/gas/Makefile.am >> +++ b/gas/Makefile.am >> @@ -70,6 +70,8 @@ GAS_CFILES = \ >> atof-generic.c \ >> compress-debug.c \ >> cond.c \ >> + sframe-opt.c \ >> + gen-sframe.c \ >> depend.c \ >> dwarf2dbg.c \ >> dw2gencfi.c \ >> @@ -105,6 +107,7 @@ HFILES = \ >> bit_fix.h \ >> cgen.h \ >> compress-debug.h \ >> + gen-sframe.h \ >> dwarf2dbg.h \ >> dw2gencfi.h \ >> ecoff.h \ > > i think both these variables are sorted, so you should keep that > OK. >> --- a/gas/as.h >> +++ b/gas/as.h >> @@ -261,7 +261,10 @@ enum _relax_state >> rs_cfa, >> >> /* Cross-fragment dwarf2 line number optimization. */ >> - rs_dwarf2dbg >> + rs_dwarf2dbg, >> + >> + /* SFrame FRE type selection optimization. */ >> + rs_sframe > > add a dangling comma ? > I tried to keep the same style as the file originally had. >> --- a/gas/config/tc-i386.c >> +++ b/gas/config/tc-i386.c >> >> +offsetT >> +x86_sframe_cfa_ra_offset (void) >> +{ >> + gas_assert (x86_elf_abi == X86_64_ABI); >> + return (offsetT)-8; > > spaces around the - > Fixed. >> --- a/gas/dw2gencfi.c >> +++ b/gas/dw2gencfi.c >> >> + // FIXME - remove this commented line once the compiler can specify > > can you link to an open bug in GCC bugzilla ? or some other tracker ? > This was an obsolete comment. The two ways to generate SFrame sections will remain: - pass --gsframe command line option to GNU as - compiler generates the .cfi_sections .sframe directive Thanks for pointing out. I fixed the comment. >> + // .sframe for .cfi_sections directive > > period at the end of sentences. > >> + // if ((all_cfi_sections & CFI_EMIT_sframe) != 0) > > i didn't think we used // C++ comments in C code, but stuck to /*...*/ > >> + if (flag_gen_sframe || (all_cfi_sections & CFI_EMIT_sframe) != 0) >> + { >> +#ifdef support_sframe_p >> + if (support_sframe_p ()) >> + { >> + segT sframe_seg; >> + int alignment = ffs (DWARF2_ADDR_SIZE (stdoutput)) - 1; >> + >> + if (!SUPPORT_FRAME_LINKONCE) >> + sframe_seg = get_cfi_seg (NULL, ".sframe", >> + (SEC_ALLOC | SEC_LOAD | SEC_DATA >> + | DWARF2_EH_FRAME_READ_ONLY), >> + alignment); >> + output_sframe (sframe_seg); >> + } >> + else >> + as_bad (_(".sframe not supported for target")); >> + >> +#else >> + as_bad (_(".sframe not supported for target")); >> +#endif > > rather than interleaving cpp checks in the middle of code (which are hard > to keep track of), put something at the top of the file (or a header) like: > #ifndef support_sframe_p > # define support_sframe_p() false > #endif > OK. >> --- a/gas/dw2gencfi.h >> +++ b/gas/dw2gencfi.h >> @@ -200,5 +200,6 @@ extern struct fde_entry *all_fde_data; >> #define CFI_EMIT_debug_frame (1 << 1) >> #define CFI_EMIT_target (1 << 2) >> #define CFI_EMIT_eh_frame_compact (1 << 3) >> +#define CFI_EMIT_sframe (1 << 4) > > keep the defines aligned > Fixed. >> --- /dev/null >> +++ b/gas/gen-sframe.c >> >> +/* gen-sframe.c - Support for generating SFrame section. >> + Copyright (C) 2021 Free Software Foundation, Inc. > > isn't this code new to 2022 ? > >> +unsigned char >> +sframe_get_abi_arch_callback (const char *target_arch, >> + int big_endian_p) >> +{ >> + unsigned char sframe_abi_arch = 0; >> + >> + if (strcmp (target_arch, "aarch64") == 0) >> + { >> + sframe_abi_arch = big_endian_p >> + ? SFRAME_ABI_AARCH64_ENDIAN_BIG >> + : SFRAME_ABI_AARCH64_ENDIAN_LITTLE; >> + } >> + else if (strcmp (target_arch, "x86-64") == 0) >> + { >> + gas_assert (!big_endian_p); >> + sframe_abi_arch = SFRAME_ABI_AMD64_ENDIAN_LITTLE; > > shouldn't this be in config/tc-* headers ? > Hmm..on taking a second look, yes, may be I can fold it into the config/tc-* headers. I initially started with a mindset to get the minimal information from the backends and then translate/use that to create SFrame specific constants. Either approach works. What you suggest looks easier to read, so I have switched to that. >> + /* Other abi/arch are not supported. Should be unreachable. */ >> + printf (_("SFrame Unsupported abi or arch\n")); >> + abort (); > > as_fatal would be better than calling abort. comes up multiple times. > >> +static void >> +sframe_xlate_ctx_cleanup (struct sframe_xlate_ctx *xlate_ctx) >> +{ >> + struct sframe_row_entry *fre, *fre_next; >> + >> + if (xlate_ctx->num_xlate_fres) >> + { >> + fre = xlate_ctx->first_fre; >> + while (fre) >> + { > > bad GNU style -- braces indent one more level > Fixed. >> +static int >> +sframe_xlate_do_def_cfa_offset (struct sframe_xlate_ctx *xlate_ctx, >> + struct cfi_insn_data *cfi_insn) >> +{ >> + /* The scratchpad FRE currently being updated with each cfi_insn >> + being interpreted. This FRE eventually gets linked in into the >> + list of FREs for the specific function. */ >> + struct sframe_row_entry *cur_fre = xlate_ctx->cur_fre; >> + >> + gas_assert (cur_fre); >> + /* Define the current CFA rule to use the provided offset (but to keep >> + the old register). However, if the old register is not FP/SP, >> + skip creating SFrame unwind info for the function. */ >> + if ((cur_fre->cfa_base_reg == SFRAME_CFA_FP_REG) >> + || (cur_fre->cfa_base_reg == SFRAME_CFA_SP_REG)) >> + { >> + sframe_fre_set_cfa_offset (cur_fre, cfi_insn->u.i); >> + cur_fre->merge_candidate = false; >> + } >> + else >> + return -1; >> + >> + return 0; >> +} > > is this returning a boolean ? use an actual bool type w/true+false instead > of 0/1/-1 integer values. this comes up multiple times in this file. > -mike The return type is intended to return an error code. I have now defined a set of error codes. They are limited at this time, but can be used to convey information from the callee to caller later. Thanks for your review.