From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id F3A413851408 for ; Thu, 19 May 2022 08:30:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F3A413851408 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 24J62OP2007814 for ; Thu, 19 May 2022 08:30:40 GMT Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3g22ucb7p0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 19 May 2022 08:30:39 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 24J8Fmmh019016 for ; Thu, 19 May 2022 08:30:37 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2103.outbound.protection.outlook.com [104.47.70.103]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3g37cr6pkg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 19 May 2022 08:30:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L8Bh01rEeJbIaP2a5fkOh9ZLApXbgbA8iYhVVDPWupHnkgrnkQIjwch4rW7G2akd71tjh0aeT2nNyHh7ySWjqlNxLT6kKWQpFPF/crlFuTd/OJraQtIsFAtjKLkB9UP87XKbcHG3fxo7P3aROENNIodMvCo9YQaxJRHbRQDSgOWYk5x9eA9wfsnxSBOnX8NHcWMLu4NDEz0z3M/zWipxsQxViwcxqbvYf0met7ZG3SwIW78HgkTf4lB/KzuVaiKPqOTU7LE/CYCY3fPArlQBorWV+Q8GLTororaDnNq1S1/SFouhhIueZAtIXxGg+SXyyrweoUN1pC+Lpsn7eN6X5A== 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=9JEwMO/2B0wzM9AY2ksK6nCfTX4gkDqpjoXmjOky19Y=; b=Y5L2r8AQStZymNN4k0OCcQvxO0U69hfgzhEtHdkOcAULhrYZzBGL0PIDht/3CQVIZ8mcp5GqPYzMIirQUlE+grR951jVFstAlyGUO+SG1+3DwBybB6DLAz+g62yvP9VmYS/D4zWrH5JpIQm79YRmaeCUUSP9RbtZ0AVlXx8FpaJi5AM1tTPOcWdfeASBbEYdRfk2Kva5IdDRq6vH2KWpbdbpyChu3DMlOKDDexhgPCyB93URjmzCMCuq6yF62xxfLVO3W8lrWSQquH5/tXH6h0OztY3lXjnkRLt2ynbt3gauBntvVfPcHiXEAhqyq/HXpu2gUsIMg87fGt0F75fBiQ== 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 BN0PR10MB5080.namprd10.prod.outlook.com (2603:10b6:408:114::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Thu, 19 May 2022 08:30:35 +0000 Received: from MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::c1ba:b4c:fe6f:d171]) by MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::c1ba:b4c:fe6f:d171%7]) with mapi id 15.20.5250.018; Thu, 19 May 2022 08:30:35 +0000 From: Indu Bhagat To: binutils@sourceware.org Subject: [PATCH,RFC,V2 0/8] Definition and Implementation of CTF Frame format Date: Thu, 19 May 2022 01:30:16 -0700 Message-Id: <20220519083024.2709920-1-indu.bhagat@oracle.com> X-Mailer: git-send-email 2.31.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: CO2PR04CA0070.namprd04.prod.outlook.com (2603:10b6:102:1::38) To MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2e1e2fac-fcdc-4351-9670-08da3971d89d X-MS-TrafficTypeDiagnostic: BN0PR10MB5080:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cR+x5CJ6Gu+M6nVgVgYt13IjE/J6XqL3XhGteHoHnRg1fzzt6dN5tFtdsdj7FP4njSfrED/XZ4ECq/cRNTtsOCLAq59xHXMiuerQv9KHkP4pzR/N2eGrMnq6R/g0F9dh0KNgZQLHYexv50wWt4Rw84tFFulcXGt3dY6fC5Qo0iYHSt8iWFudC+kHZxy+SuIXLtaGtz6n0q2MLogfoC5J7BMwB+a/F1U66QKfezpqMpS+sR8MhpBd6ZquIA4rWVMax0650SxT/OiLp+yERPa4nAh1dZ977R6qzaw6Pymg7cXz81RqPIGuWzOMwo7bsJSSK69EpIp15HwTq6k1C6nPlO4bekvUzQxMo640LsMBJt/bC7nP06Z5LOz9BER0D3ovEpSzwtOshF/k6dtq0OBIC0u38S1S5SMUva6F2N7uvsiG/UBLDsxXRJAXirNf3q6vD9UvZyNDEghfcxdr6Pk7yH302faYdsBRpBPYjK5enRBbLLnLREEy7oHnlQgwznI8JTNc3f+VleLqfiqcneEqO+wdnpJwoQqIIT/Ui1Ib5Ov0QPPEahtAUokR0xBr6cIUsKdNzU6uytHpVlNoJI0lYIiZQDd307Yhuljf1lC0SyZ3SdcRxVO1gBRlI6OLKcZjnUIUqeHXa1Fdyq456Ndpub6Fd6Nd6RZbyyMbrkX4MsF7COdq4c9RMZTTCMkPOVb45wpWALnnzOGVyn0J7s3gDypmJdMl9unP1zwZrKc6QmMOBTxNFV/zr78jvFLlMqXOKAd0sPXLnn4OJYM/iDd7Lpd8M7iRomhtkdEOqC4RxdI= 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:(13230001)(366004)(44832011)(36756003)(8676002)(6506007)(38350700002)(66556008)(66946007)(66476007)(316002)(6916009)(38100700002)(6486002)(1076003)(966005)(508600001)(6512007)(186003)(5660300002)(8936002)(2906002)(26005)(83380400001)(86362001)(52116002)(2616005)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?DJb/7qHA/B43q95yZB8A4YDscU0pDjbb0RKNOknwr3QlOfAr3O8h4mvtWttF?= =?us-ascii?Q?0ew3Cf6SystIQn6wfxIfF9wcPZOs7N9DCyFHex0ewrj+wsn+lcS+TNDSmaGK?= =?us-ascii?Q?LR/rnM7ImpiKYpntaNtW2Y908RmVaJQvkcajUSBuuXKwKUlQxCJW+OPotzL9?= =?us-ascii?Q?F4CpWb7UFPDFP0LBtCYPM3lq5YWS8U0l351THv+4lxf/yPT8qf6wabzyIEcP?= =?us-ascii?Q?+Mb5Ccm+EiHuuPFZ9LjYseu3wzFt/dnwar2PIelnUvDV6NLJ0+ySdVTT/y+U?= =?us-ascii?Q?r+dfjHBfmMxmF/fORH/7UvoCqulfLLck1kB8u4eJsRdNrd0llJMaavtD5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nAcLM1lPjosCxHnnm/F?= =?us-ascii?Q?I3l+5RiN16JaIs4K+On6zWCelvHdkJcvvGBhK+YH9802XG5Ml5bJlX8mWmB/?= =?us-ascii?Q?Xz9QM40ywIMgLisEtfuK3SfhS0gI27Wel1oaB3miw8sm5JHK/lxQDjHCT0Vr?= =?us-ascii?Q?RB1xhkAoLvjqjSe3RccdUe/wYTIEKOa2Yq3guf66wDO5GOBROO3C8tdbRELd?= =?us-ascii?Q?u5juSZnLhMb3eHdZgCpQcH4K7wZ53YD/NIk2Ue7uVQ5m+tyFkJ2/emUjQfIt?= =?us-ascii?Q?ziGEB4GHD6lInDHN4Tp0tiI/U9SZ1oiTc5c2yRZajXas15en/UbyeqKBFuI5?= =?us-ascii?Q?QuYhQKfHHxHwQLJpoA+xh7S2XGkDQWixZB8TWZ53D7LKWb6nMVpYF2MBZMfg?= =?us-ascii?Q?iXyzlkUhf2MVdoMQ2W+hmmIiwXwWXwSbhc0zi25HQONzZe/gHsc1K4jM8xeR?= =?us-ascii?Q?shsOLY9cHQuvoANScK66JzS485fphlojWP7jb6jznyXMX+Lc9mECqsTjLAtZ?= =?us-ascii?Q?iEzKvMGMTqhr+9qFGqZ26jMcA25hOq8=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e1e2fac-fcdc-4351-9670-08da3971d89d X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2158.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2022 08:30:35.6202 (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: yHm1CsA3SnpeTVfpckmJ6UDpsAR8fKQrmw1ghu/RceSTb7xqqn5Z8okRnFXBRzSbJUT8vO3PdcleKrSlVFm4UA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5080 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486, 18.0.874 definitions=2022-05-19_01:2022-05-19, 2022-05-19 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 mlxscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205190049 X-Proofpoint-GUID: FYHy6UiIEMuOG_AnwrrPvbHwxencYjWm X-Proofpoint-ORIG-GUID: FYHy6UiIEMuOG_AnwrrPvbHwxencYjWm X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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-List-Received-Date: Thu, 19 May 2022 08:30:46 -0000 Hello, Thanks for your comments on the version V1 of the patch series. This is a refresh of the previously sent RFC series https://sourceware.org/pipermail/binutils/2022-May/120731.html. The commit log of each patch in this series specifies the changes from V1 of the respective patch. Briefly, following are the main changes in the current version V2 as compared to V1: 1. GAS now supports a new command line option --gctf-frame. This command line option instructs GAS to generate .ctf_frame section from CFI directives. The user can either specify --gctf-frame or use ".cfi_sections" directive with ".ctf_frame" to generate .ctf_frame sections. 2. Some code cleanup, improvements and bugfixes. 3. libctfbacktrace has required some buildsystem changes. libctfbacktrace is the ".ctf_frame unwinding library", and as such needs CTF Frame unwind information for itself to work. So the buildsystem checks if the available assembler supports --gctf-frame, if so, libctfbacktrace is generated with "-Wa, --gctf-frame". 4. Regression testing for some aarch64 and x86 targets. This is a work in progress. There still remain open issues to be resolved, crude code stubs to be revisited, addition of testsuites, and more regression testing testing. This will be taken care of in subsequent iterations of the series. Important note: libctfframe/configure has NOT been included in the patch series, as it causes the size of some patches to go beyond the allowed limit. Please regenerate the libctfframe/configure after applying the series. Please comment and provide feedback, it will help shape the format. Here are a few of the aspects that particularly need discussion: 1. What is a good place for an unwinder based on CTF Frame format ? Currently to facilitate discussion, it is presented in a library of its own: libctfbacktrace which, in turn, uses the libctfframe library for decoding the .ctf_frame section for unwinding. We brainstormed a bit about the possible candidates being libbacktace, libgcc or libunwind ? Are there any recommendations ? 2. Are there some ideas for smartly dealing with the issue of bloat caused by the CTF Frame unwind information for the PLT entries ? Thanks, Indu Bhagat (6): ctf-frame.h: Add CTF Frame format definition gas: add new command line option --gctf-frame gas: generate .ctf_frame bfd: linker: merge .ctf_frame sections readelf/objdump: support for CTF Frame section gdb: sim: buildsystem changes to accommodate libctfframe Weimin Pan (2): libctfframe: add the CTF Frame library unwinder: generate backtrace using CTF Frame format Makefile.def | 5 + Makefile.in | 1289 ++++++++++++++++++- bfd/Makefile.am | 6 +- bfd/Makefile.in | 7 +- bfd/bfd-in2.h | 1 + bfd/configure | 2 +- bfd/configure.ac | 2 +- bfd/elf-bfd.h | 55 + bfd/elf-ctf-frame.c | 490 ++++++++ bfd/elf.c | 32 + bfd/elf64-x86-64.c | 97 +- bfd/elflink.c | 52 + bfd/elfxx-x86.c | 336 ++++- bfd/elfxx-x86.h | 46 + bfd/section.c | 1 + binutils/Makefile.am | 10 +- binutils/Makefile.in | 10 +- binutils/doc/binutils.texi | 4 + binutils/doc/ctfframe.options.texi | 10 + binutils/objdump.c | 76 ++ binutils/readelf.c | 47 + config/ctf-frame.m4 | 16 + configure | 2 +- configure.ac | 2 +- gas/Makefile.am | 3 + gas/Makefile.in | 22 +- gas/as.c | 10 +- gas/as.h | 13 +- gas/config/tc-aarch64.c | 42 + gas/config/tc-aarch64.h | 29 + gas/config/tc-i386.c | 46 + gas/config/tc-i386.h | 26 + gas/config/tc-xtensa.c | 1 + gas/ctffreopt.c | 158 +++ gas/doc/as.texi | 19 +- gas/dw2gencfi.c | 30 + gas/dw2gencfi.h | 1 + gas/gen-ctf-frame.c | 1212 ++++++++++++++++++ gas/gen-ctf-frame.h | 142 +++ gas/write.c | 13 + gdb/Makefile.in | 8 +- gdb/acinclude.m4 | 4 +- gdb/configure | 35 +- gdb/configure.ac | 11 + include/ctf-backtrace-api.h | 57 + include/ctf-frame-api.h | 213 ++++ include/ctf-frame.h | 257 ++++ include/elf/common.h | 1 + include/elf/internal.h | 1 + ld/Makefile.am | 2 + ld/Makefile.in | 2 + ld/configure | 8 +- ld/configure.ac | 3 + ld/ld.texi | 4 +- ld/scripttempl/elf.sc | 2 + ld/testsuite/ld-bootstrap/bootstrap.exp | 8 +- libctfframe/Makefile.am | 50 + libctfframe/Makefile.in | 982 +++++++++++++++ libctfframe/aclocal.m4 | 1242 ++++++++++++++++++ libctfframe/config.h.in | 144 +++ libctfframe/configure.ac | 82 ++ libctfframe/ctf-backtrace-err.c | 46 + libctfframe/ctf-backtrace.c | 617 +++++++++ libctfframe/ctf-frame-dump.c | 173 +++ libctfframe/ctf-frame-error.c | 49 + libctfframe/ctf-frame-impl.h | 55 + libctfframe/ctf-frame.c | 1525 +++++++++++++++++++++++ libctfframe/ttest.c | 78 ++ sim/common/Make-common.in | 7 +- 69 files changed, 9973 insertions(+), 58 deletions(-) create mode 100644 bfd/elf-ctf-frame.c create mode 100644 binutils/doc/ctfframe.options.texi create mode 100644 config/ctf-frame.m4 create mode 100644 gas/ctffreopt.c create mode 100644 gas/gen-ctf-frame.c create mode 100644 gas/gen-ctf-frame.h create mode 100644 include/ctf-backtrace-api.h create mode 100644 include/ctf-frame-api.h create mode 100644 include/ctf-frame.h create mode 100644 libctfframe/Makefile.am create mode 100644 libctfframe/Makefile.in create mode 100644 libctfframe/aclocal.m4 create mode 100644 libctfframe/config.h.in create mode 100644 libctfframe/configure.ac create mode 100644 libctfframe/ctf-backtrace-err.c create mode 100644 libctfframe/ctf-backtrace.c create mode 100644 libctfframe/ctf-frame-dump.c create mode 100644 libctfframe/ctf-frame-error.c create mode 100644 libctfframe/ctf-frame-impl.h create mode 100644 libctfframe/ctf-frame.c create mode 100644 libctfframe/ttest.c -- 2.31.1