From patchwork Thu Apr 18 21:41:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Karpov X-Patchwork-Id: 88690 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 DE28B3858288 for ; Thu, 18 Apr 2024 21:41:55 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2093.outbound.protection.outlook.com [40.107.22.93]) by sourceware.org (Postfix) with ESMTPS id A81BA3858D33 for ; Thu, 18 Apr 2024 21:41:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A81BA3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=microsoft.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=microsoft.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A81BA3858D33 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.22.93 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713476492; cv=pass; b=G87kP9wcdzqEP7aRHAWAWoddsaxEoQJwaYGMhEvMYRKh7+fBlWIaj0B4oIloMWv7JsxLtFdrN0dBMVZbu8KbG0WKuAJVqo0s42iLQibd+Vkcf1jPy/sup3HtpOwcwkRLz68cW+wtCo04NlGJzMCfkZfSX447/5o789C8+iYEQA4= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713476492; c=relaxed/simple; bh=s72Lw+ZYUWX4wiSYyTM1blCUXhN9HMVOaCa7yNZDPu0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=o5VtFh0A4IRiRaa5G943f9Yyz8m+Yc6Bot7CJhhSh2xxYNPQH2ZU9f95vlwD3q4vcp5idXT6LN8MiyixADTMEKiaiLTIVUKBlzewDMiOC86wdtorY2RZhdXhKufCUUDoXuUfaHuLhbxbZg0EahZL/i426z/IY4B+ipX9YDJY5VI= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VhRWMNyIEx8XVJUJWrR+9cu+42yI/05YQ5+gLIzrH+peUojso86P0c9pt4Uw/KEkZbMu8HFJhMbJn+uvdqkm8M2kut2nh/nDZNlk/J/JhKEWTr25kY54p2cy9LzAUqIDpbB6BYKRzBpVTyZwI0yWClHoEwj53ZfjNSFFtli8dDu+ZNcOr+aQSHw9Tg/5tZBF3VwjOdfgJWKUEEkSnDDaudlIZb8g9reOhYadT9XaXItfH+DcYZqbDpU8/yGEAkswl6bEt0NErP+pOUlxgSDGugGXKQvAhEUpSzLfWrHS5bzpOwHd9r/MxVM6MPI+gH0isY8CCw8Ag+LuKjqV2l5f7Q== 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=glaReWSTg4JDg2M7aM1lfLVW5Gl5unVatCYm8TYv9K0=; b=A5chOkn51oiJ6ukKwF8LZq1tPCnQt+Mb51yr7GykdIfCZtf/fRBU+clIDFWuTq3XaNJx59eK3bTKMHyW1GB54juay4Bt14kZ4ilo9o7kzEqluH3c6YdPPTVWmtkw3WzFEmHiqUCXU2TQQIuOc3rks84pyvbBSfk2BaXTwtFvKEdul+V/foC2KIz4AKlif396cYW8wMI1LDC9k4pwFXwRMpn2YfZbRdFI6nQPJ/9DXKa/v6AZ8jo5eiwAibf3JAXG96sc8JhxImlAch/tGIryD6lbFFN/gXnuzcYF/huzeOmfIHoYtPGwtWH9aMOxkfJesKGoQcEPbkFiZgnuEgUiSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=glaReWSTg4JDg2M7aM1lfLVW5Gl5unVatCYm8TYv9K0=; b=IVHy+lPIemae0GXjaXHMxZzkWAHjOEX1uaXFCanncuzSwdH8GshfIpNeFqoIx3+I7WS8elfuie3xVElycNejcad6du/ndzjhLL9mmTfSzv33Rh0c0gFiUuUJrWn/FlVsIKn53gWw684Mx33eQK/HGhWviN9XA46AG22aruge9zo= Received: from PR3PR83MB0425.EURPRD83.prod.outlook.com (2603:10a6:102:5f::21) by DBBPR83MB0563.EURPRD83.prod.outlook.com (2603:10a6:10:533::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.12; Thu, 18 Apr 2024 21:41:28 +0000 Received: from PR3PR83MB0425.EURPRD83.prod.outlook.com ([fe80::2303:5667:fa24:79c2]) by PR3PR83MB0425.EURPRD83.prod.outlook.com ([fe80::2303:5667:fa24:79c2%7]) with mapi id 15.20.7519.014; Thu, 18 Apr 2024 21:41:27 +0000 From: Evgeny Karpov To: Evgeny Karpov , "gcc-patches@gcc.gnu.org" CC: "richard.sandiford@arm.com" , "Richard Earnshaw (lists)" , Maxim Kuvyrkov , Radek Barton Subject: [PATCH v1 1/6] Move mingw_* declarations to the mingw folder Thread-Topic: [PATCH v1 1/6] Move mingw_* declarations to the mingw folder Thread-Index: AQHakdkqL+XajJOv10mQMEB9fUzsFg== Date: Thu, 18 Apr 2024 21:41:27 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=7edbbdf7-0382-4215-8fdf-996305ff5b5e; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2024-04-18T21:26:39Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PR3PR83MB0425:EE_|DBBPR83MB0563:EE_ x-ms-office365-filtering-correlation-id: fd3b9460-f2ce-450c-86d2-08dc5ff04d71 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|1800799015|376005|366007|38070700009; x-microsoft-antispam-message-info: mqqKFp/Gl9V9qExMhv+nH2UsemanyWqw1M4vpKv9xfikr0jGrIN19qVMqJ9v7k7deYJT21kETjxgOnzwrgkiSLYKxCTOuQy8BHOjq/nN3wsVfNKmgoSYBUArT9ePdO+OFOWhCMl4mHLM8V+lhPk9Axb9NCtjFJ8bRBWLkqlaYZcVt7bc48J+fNwO4AG/vXr9j2UBakkmQcNC+bh62hleiFDr3hvZ6AoeW8inRJoV81SE8XZ3s2CAUrYqp8443YMZasUqriVDn3h0mymUiWwipTbdj2o4KQ8QuwPTdr7IPj5G6IJAFe/iMLi1zEi7U3WHIKjhrZZjMRNHecHXRpQHPRG1cmUtq/PFqkUfCNpniO9SjjleQ/70PCGNjZ+buRf+lHzY1XQdeurfB8PIfh4qMSwTptcIFbSVUEeWwbTR0+szycXBYW9TnpKDcjQcH82bb43LDpqjqafGRLFEm2Z4altpe8toEsDRWVdy3YMsOFEAXMjG9w51joCpB986FCiZTdEWP1H637ur7q/zEYdXOBn6tyQ60u3Kn7TXOW9vCkNr1eTjae8eJY5bQxnEqHmNV060a8TlCkAmflRApjLAI5aV1bU2miyDgqgiKsDskrsFxflRO5VYjPp5TR04vpBMypw7VCjldmUqghRED7KxRrrrhgbqWH61TP7a2CDv0MHh8oINU0PXC81qc3xvwdDDVGuq/effRO0dYa/fF6AlLp190yG+bFXMGPhsjTfa12776NP5CsMtXX0Oa8bQKu0UpoL59dVqEtD8swjhkVTRQE/WT6kBUnuIcM6XCArABDJX8ko2YMn5J8e0cdIY89AqJ0k4T7kKRCy2IdVc9EBpw7+SghdtF8R5ygDlOHI6G7zH8+A7tr7YCqAU2V/zw2HT3LmtInWHGdKnbdu8e3oEeN5gXiX+kG13jFJ6s+TZmhN4oERtnH3m/qGQs6SOrc7YfPYJIsrJOZqP8/vlzq9a2WAbB2Q780QJkqe/I0bDVUKrRVy0FR6QcLwqVx6Br9X+OuMWZZ7phsJTCYLvLP4VgL9xMi+IfH8bq4XMmZqkf3HYagGLrhkXCB04OJOi3wQe71tDFTxYgWtOA6LDhUXRCFPOnN0ugt3gRrYHXxxyDwaY6uFYZMuyP+UEJJEcz23GSxH/gVWijtuxnzEU4AeviE48AcWJWLNBsshf8cqdpz7kiaS5sGhjgsvroHh6sdeuyorkXu7aD3RBJQVN/my33pWdUEMe/UIcQ8h+iaA6wsppl4D3xNhIDSRdNH2XGpp1wvOy0AqR0TFVvzN/fGYF5A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PR3PR83MB0425.EURPRD83.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(376005)(366007)(38070700009); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: 3N4LpspaWZGzq3VO6BVSYO8hehstRLE9M4K95XzGHmnjLSzM8wA7eyDRFdCLI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Mq3urDBpUr5ytLFcv30zhILliqlApw2QZ7GmflUdmjmpw5BrtPM6fYciRgzPpcr/QmY4on3yb5m8o8ElO1A/gfdrMY2lKLBGNC6worjZjQJH3hKjBPP7ErVRL1DDWgcdKCpXaHUVhtHWh1Wx268WQj+9uQzey3ib8gQkc6SStolKbbkYpm9lKUOmNV+6jMqiBaf6Ai0/ECK90hOzTVAl3+VlJb8i99B4t/JvV/EObusiBpBcp04SJRk2QW+DQr2iacLLZWYuk65CD5rDDMW0qTuE8UGalJAuTCi9dZABNwQ6vw4eEzksyO/ruJheYaWxhTX2Tww+8WnHJb/GF97/ZEa4ygoH0R6S2QLKWRT7WFFEGgw4MWyp0fQmKdhfwBsfxgUzhotiuzLw1AENImOMV1aV5/PuF1Ua5U/gpp/4ve6j6zO7iCwcgdXSoL/2PAI MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PR3PR83MB0425.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd3b9460-f2ce-450c-86d2-08dc5ff04d71 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2024 21:41:27.5321 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: M9KzWqM4+3fa5eL87gbqyZeWjpkTlpMVXXJS/mt3AkCvBDv/PMzXdpVrIMjzuC5OqbWckINhu49dYUyFJmq9zw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR83MB0563 X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_SHORT, KAM_STOCKGEN, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org This patch refactors recent changes to move mingw-related functionality to the mingw folder. More renamings to the mingw_ prefix will be done in follow-up commits. This is the first commit in the second patch series to add DLL import/export implementation to AArch64. Coauthors: Zac Walker , Mark Harmstone and Ron Riddle Refactored, prepared, and validated by Radek Barton and Evgeny Karpov gcc/ChangeLog: * config/aarch64/aarch64-protos.h (mingw_pe_maybe_record_exported_symbol): Move mingw_* declarations to mingw. (mingw_pe_section_type_flags): Likewise. (mingw_pe_unique_section): Likewise. (mingw_pe_encode_section_info): Likewise. * config/aarch64/cygming.h (mingw_pe_asm_named_section): Likewise. (mingw_pe_declare_function_type): Likewise. * config/i386/i386-protos.h (mingw_pe_unique_section): Likewise. (mingw_pe_declare_function_type): Likewise. (mingw_pe_maybe_record_exported_symbol): Likewise. (mingw_pe_encode_section_info): Likewise. (mingw_pe_section_type_flags): Likewise. (mingw_pe_asm_named_section): Likewise. * config/mingw/winnt.h: New file. --- gcc/config/aarch64/aarch64-protos.h | 6 +----- gcc/config/aarch64/cygming.h | 4 ---- gcc/config/i386/i386-protos.h | 8 ++------ gcc/config/mingw/winnt.h | 29 +++++++++++++++++++++++++++++ 4 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 gcc/config/mingw/winnt.h diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index 1d3f94c813e..95972556c56 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -24,6 +24,7 @@ #include "input.h" #include "config/arm/aarch-common.h" +#include "config/mingw/winnt.h" /* SYMBOL_SMALL_ABSOLUTE: Generate symbol accesses through high and lo relocs that calculate the base address using a PC @@ -1110,11 +1111,6 @@ extern void aarch64_output_patchable_area (unsigned int, bool); extern void aarch64_adjust_reg_alloc_order (); -extern void mingw_pe_maybe_record_exported_symbol (tree, const char *, int); -extern unsigned int mingw_pe_section_type_flags (tree, const char *, int); -extern void mingw_pe_unique_section (tree, int); -extern void mingw_pe_encode_section_info (tree, rtx, int); - bool aarch64_optimize_mode_switching (aarch64_mode_entity); void aarch64_restore_za (rtx); diff --git a/gcc/config/aarch64/cygming.h b/gcc/config/aarch64/cygming.h index 2e7b01feb76..0d048879311 100644 --- a/gcc/config/aarch64/cygming.h +++ b/gcc/config/aarch64/cygming.h @@ -51,10 +51,6 @@ still needed for compilation. */ #include #endif -extern void mingw_pe_asm_named_section (const char *, unsigned int, tree); -extern void mingw_pe_declare_function_type (FILE *file, const char *name, - int pub); - #define TARGET_ASM_NAMED_SECTION mingw_pe_asm_named_section /* Select attributes for named sections. */ diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index dbc861fb1ea..96368521380 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -17,6 +17,8 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ +#include "config/mingw/winnt.h" + /* In i386-common.cc. */ extern bool ix86_handle_option (struct gcc_options *opts, struct gcc_options *opts_set ATTRIBUTE_UNUSED, @@ -295,16 +297,10 @@ extern void ix86_target_macros (void); extern void ix86_register_pragmas (void); /* In winnt.cc */ -extern void mingw_pe_unique_section (tree, int); -extern void mingw_pe_declare_function_type (FILE *, const char *, int); extern void i386_pe_record_external_function (tree, const char *); -extern void mingw_pe_maybe_record_exported_symbol (tree, const char *, int); -extern void mingw_pe_encode_section_info (tree, rtx, int); extern bool i386_pe_binds_local_p (const_tree); extern const char *i386_pe_strip_name_encoding_full (const char *); extern bool i386_pe_valid_dllimport_attribute_p (const_tree); -extern unsigned int mingw_pe_section_type_flags (tree, const char *, int); -extern void mingw_pe_asm_named_section (const char *, unsigned int, tree); extern void i386_pe_asm_output_aligned_decl_common (FILE *, tree, const char *, HOST_WIDE_INT, diff --git a/gcc/config/mingw/winnt.h b/gcc/config/mingw/winnt.h new file mode 100644 index 00000000000..da8445904ce --- /dev/null +++ b/gcc/config/mingw/winnt.h @@ -0,0 +1,29 @@ +/* Subroutines for targets on Windows. +Copyright (C) 2024 Free Software Foundation, Inc. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +http://www.gnu.org/licenses/. */ + +#ifndef GCC_MINGW_WINNT_H +#define GCC_MINGW_WINNT_H + +extern void mingw_pe_asm_named_section (const char *, unsigned int, tree); +extern void mingw_pe_declare_function_type (FILE *file, const char *name, + int pub); +extern void mingw_pe_encode_section_info (tree, rtx, int); +extern void mingw_pe_maybe_record_exported_symbol (tree, const char *, int); +extern unsigned int mingw_pe_section_type_flags (tree, const char *, int); +extern void mingw_pe_unique_section (tree, int); + +#endif