From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2100.outbound.protection.outlook.com [40.107.15.100]) by sourceware.org (Postfix) with ESMTPS id DAC47384AB42 for ; Thu, 18 Apr 2024 21:49:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DAC47384AB42 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 DAC47384AB42 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.15.100 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713476947; cv=pass; b=D9PTEA2BAvILboS4uADHDEMJpfn19rjmiaMqselfr7Dk3OTnJ24jNuA5Ymq7J/wt1P+unt/4Hc2D01TU0qhbMq7kdXAgw3+mXaBpCEfF2TtFdiOGfWnkZbsA56FecG3l3SAcAKG3sCSeglVjvIYx65KspzumI5cdMw1RhFWfdj4= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713476947; c=relaxed/simple; bh=QwH46wzk/dE4LOApJtCpIE3Xq9j/G3ekiEz9YejC93g=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=lFWD8uIx1ncx5xMQTjbIv3BKBvvwD9pNEwK2d9Ee+xNrCcKCYwB9RM1hNurrQzZH64jbeOrU0WdDZHpRu3IeZmniUSbXVvmslm4cOzC/1L2xt5e+ABrN+MOgSSf6x9+NT5OhGDGRBaw8lf5vG8RlCLh30yY52X1pUTo8MEdxJCk= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FZXqO3i2prIq1ZySg8K0V40Kjd/IyzUzDUvaCsdXrRmv8wkR/Ee9AXR6cM3CO57mDEyDVax0hdDwU1bHpVGHVYnEEMOp+dq+dhI7xI5ej9LupWJHCymqZXNapyNVHEhoiO1qhEy1klwrblQU8botmbc3P34CMxIwtxESG9INZn4hAC9LPMUKdcsurUcidnzHpE0JJUJWiLnZyyfcqcvZk+Ev6PT8UBdt9T+/hzCvNJYsY1g1T8KvImRYKCkooCq830K4NV5ydnxmnQ+xya9YPfoZBo52VcDH5w9n2I1VoVlzjeC99uXRr7GsCBxufEXlylq5v7eCE6Qn/LJzanMa3w== 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=WF4Ojr1HevNTzlRIQ2GKaaSBZVrkaGdt+UUbrqo/zxY=; b=fyYfLFcq9UQOsSAHxfQ/NaSuNn3Loe+T26rgM0Rpfa/QhwWRc1vKj2Dnly7l1ToqhjJscw1IIBZkvu/j29Ohd/sLxDb0Ws19VB0mTu8gwMgGlrTcEKVfPiqctaWrSNazr37AH1pzEXxi8gRDn45+17vRgf8lIIFIL+B5GMZU4oeZSI7KumkCRqywjXD9d7hvMIZHVqjJIf8FsdsF03fDDLSWy60Qhvt3oxkn+0r8MDr96CLJZ0jy+BpNoBknu0vRKg/3duwG/IohyMd7N3DI8aszKs5A+dGusIhC1dEcB67c82s9A4vyk4G4tpUqhgBF8g9MlNXrP7a7pbn4Tu/Cyw== 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=WF4Ojr1HevNTzlRIQ2GKaaSBZVrkaGdt+UUbrqo/zxY=; b=gV0sDPGOuEY35JALMZ8aQ1IfU/setuuVAwRAiIkqGTmZiZ6Cfr9jJamVZNp8dwyLPfR7sNq4yKQKxIZjQlN33nLrGEXM2T3IFQzQRZRjG/SZl+QfC9Sln0DadpMDlYi889MxPWxqQydRcAMxp7ToZTDSYYmpkmmLplt/fbIdzdg= Received: from PR3PR83MB0425.EURPRD83.prod.outlook.com (2603:10a6:102:5f::21) by VI0PR83MB0695.EURPRD83.prod.outlook.com (2603:10a6:800:218::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.14; Thu, 18 Apr 2024 21:49:00 +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:49:00 +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 6/6] aarch64: Add DLL import/export to AArch64 target Thread-Topic: [PATCH v1 6/6] aarch64: Add DLL import/export to AArch64 target Thread-Index: AQHakdo4qVa7NUNdHUCLYGVXx5V1eg== Date: Thu, 18 Apr 2024 21:49:00 +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_|VI0PR83MB0695:EE_ x-ms-office365-filtering-correlation-id: 6ee267d3-63f9-43e4-9eb7-08dc5ff15b3f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230031|376005|1800799015|366007|38070700009; x-microsoft-antispam-message-info: =?us-ascii?Q?QURbZ5PAuh3hDAWid50N2Xr42XGWeK+43s+O0GsUmBUMk51E6ajVEtuJni3k?= =?us-ascii?Q?WKe2CXwrycnhIvanLvgbXhD+eqaS6/zKDTz+dDCTS2s4U8ZziLDyGuXH5PWH?= =?us-ascii?Q?QPvpIWur1TqvcvDkzT75tlkW7Joie4CnOhUe+AXdvg4evT4i4VM/PuUh7+Rb?= =?us-ascii?Q?2wGMIVgyNKCSfZPg/YSkKyhJ0he9N9M915epDaoi75OX4H8RwWo9f1W9kIsh?= =?us-ascii?Q?UzVSaiTKG3t4z2k/ijA25EqN47dFopWKIYSky1LXb1saglDuh2jiU20p/ke5?= =?us-ascii?Q?3MKGn7fNSnaLJAv4UaqRI5KHlagr2ciCxi93RxbFnZKDW/QTVYRuWD0/rKUJ?= =?us-ascii?Q?kN0HN2A7V0nOXxeAWZvF8HW2FV7n7WU0pNJ5Wf/LsbVg9LAxJfTxwnSw+Vzb?= =?us-ascii?Q?3uEQhiz1oMr1Yallaza58WW7h0a/gJ69XfOj87Af0rgB5DQD0yvN2PGbXkqb?= =?us-ascii?Q?7FArnsNH6B54FHc7fBIjUkd/0lZsDGE7omZ6xYR0cj3FEjxBw0iGsduZhfAG?= =?us-ascii?Q?YH7lah11eyASD0ISzGvtUdNZJjyn4LzKdCnRC13tJ9eii9WHYZHUCyByOdap?= =?us-ascii?Q?qw9GyGJoDBjxmbxZGsO24JbtopemEynNlsMg38Y6PYUlSlwQx0o3ZnA9rsNI?= =?us-ascii?Q?CaOb0zIkVI2uHIP8wdwnP59S4gaf2uKXQzFzBN0oaH7+g3G21Gu+kS/qSRp3?= =?us-ascii?Q?h65EQF3BMvgIkMlCtKursAsE9ep9YjQh8vS/ga40JlKq/j7/7Blc+ImmHtqR?= =?us-ascii?Q?UnCp9ycx/wLqAPFjXR23y6a5hVnzTdyBmYLEkJtx7D/N0xoLqoHPsHE8vcN3?= =?us-ascii?Q?gZn5CNdDSP+vJMi4sch2r9eu8np+FyAp+CutaQ1yM/uZCgke9rm1EJ1owlCE?= =?us-ascii?Q?xT6xhAgyr0zFkqt1JIexvv9Et2Mag3ZCnU9sN+zsmJOUDPlODCF8x7wiOCCG?= =?us-ascii?Q?2Wz++Cd3lY1zWGQ21LAc/lR5FSXWJfuXW2bsn3PrUETaEAoPTqsPXbztANZv?= =?us-ascii?Q?lDGooAsaHTFFcunnDR6hg7HMaPO4HjeC2FsJHiNDrQGdYodr7COnpmFCFsLx?= =?us-ascii?Q?nXLXll0n7QRof/A6XEuGp/1M+VJhIUyHfIFznw8PbgoBwslcMKvovaUhhJdF?= =?us-ascii?Q?irBCUaQ5WdEDHmVnbtoMhsuejlb1wm7GJGDReAhLAmdGATfnSVePV5ZpZIHy?= =?us-ascii?Q?Y52Qgpct0Ya2nJus/et5yNMEg7LCpeuTfbQSZ+zkvFgOYxkJoHuaUIp5QebH?= =?us-ascii?Q?Wt+6VTIhlFIvMgCqUnAPt8OX4UKfZUcpTJFSOZbSaMAh4h4S12In4ISjm8VH?= =?us-ascii?Q?l+evf2da78iTjGrCRgTmgzFdzJDyRRKeZYo35hMMHzvWng=3D=3D?= 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)(376005)(1800799015)(366007)(38070700009);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ysEZy8J4Vbxc4pLl/gx0qXz9ey7Z4vGkUbnk/LLlnkAsFYdfPEA9wmjeG1+S?= =?us-ascii?Q?SXtjWsfRASurtVgb6nCHt1obgEDK+oKRlSNMbPzWMOmO9EymvrqFgW38I92r?= =?us-ascii?Q?4g5MzTgZvCKec1YAqYfe/bmyAcRH9+2orWHI+4hvwW5yDWYbJk2/hGHQx3v3?= =?us-ascii?Q?Vgbt/H8dscPI/xVWGvIN0+IIyg1OLxf2HX0pF053+jGdY9Riq6ePeKASu8A0?= =?us-ascii?Q?5UoyplPoIRveYNfModxf9w215G3xKBHzDcOAH/AhP3Ukf6Qx8gR36F9Biwh7?= =?us-ascii?Q?pG/yihhXkVb7YRS/Jwj26ZzJNZEBO9g5WokgYcIjRcKkzpc6SI2m5GMHu7uk?= =?us-ascii?Q?XTnAtdiMLVaEzyhKpY/AQQPoYaRwoSS0AlxzV8t7sXeKMRKizVNtja/WLQKJ?= =?us-ascii?Q?4vItIZHCZjYuZT7qrnPGoyG1YrZM3owfppnmXeKZ/wnqUPb4lU9mgbEcErtL?= =?us-ascii?Q?bn89AkBbINnnVswmKaAcb/JxQKVFHjZmcGCWhxpTJf/O4Qs2OpcnQhBHyHIy?= =?us-ascii?Q?Yzn+bVrGD5Gt39iQahjrXspwI4L9/aFNrYA7B2p3H46G1GSJYHqxHSeQC78l?= =?us-ascii?Q?yJOb5A8evyLR3ZyIlpXEiiIz5sjIUQJ2ZWUdb+8gepuF3S/9yy6hsUFamm47?= =?us-ascii?Q?v7f9vxRG/h7kPXvHPNwf16I6JT7ZM0vTieg9ZYSvZP5mVtwD+Uh+S06SqWlt?= =?us-ascii?Q?i3cpKvmcWcT7EcIml743tKoZ64KkNyk3L3S+BtNqojvlc/nT4sOXlvNDgjeq?= =?us-ascii?Q?Sdg1UU0xxICXzFLSd324GU5tO11gsKs0nOA6rSzID2yfMM+TvVP5Dp9StbJa?= =?us-ascii?Q?LlbFEccSyIPl+NVWHO8KdR2Tc6w1TX+hP0bfnKWhFGbJshSy3A6PGCyowCyv?= =?us-ascii?Q?1kMVPVD+BnpsDpt77C3bkbueFvTZzCzUC6hZMDNY9F2mApvAqkpttsHGpO8c?= =?us-ascii?Q?x4Ei8OgUTQFo58tP1hmsTSaxRS64gCwWZYrgEeH2AktWgkAIsYt674jjihOO?= =?us-ascii?Q?OJ0iYvb8swGC4mYBSzNsvq7MsoOOnYAaY2ES0I8XYPE+PyG3RuEWL6QhFfOX?= =?us-ascii?Q?1+CCEWamA7aQNFqkcas60K2qNYshrPgqqqLPw5ApAA1JARaj9OeNRa3c4j7n?= =?us-ascii?Q?pxYCatW83y96k15CUvic/sqg3k6mt3ln4nAZOZkN/WAvfVwpKUtf/I7k6YTP?= =?us-ascii?Q?KQ1wXYwzMcBj4f9oFIThf4M/LVA0fxWjiaapipfrcbsymM2V+A6JnI1OEOpg?= =?us-ascii?Q?8KnPn0m1CfiCyfMdiHFzY5kbNoHKXT7kl/nGV7MoODOz7pIWqIqbMHeLBKqr?= =?us-ascii?Q?m3jMvYGVzlWsJXjjVCT6ytovn4LkYY1LJXNj0eDSjJ0CMV87Graqzh3ugUBM?= =?us-ascii?Q?ONfFvmvA/17LbTJQDxBAU5Qr7zLdRkppDq2pNfnvgED0rH8lbubWh4F08xoc?= =?us-ascii?Q?ceGqZf4jRMPjJHbL6Dvny2Vc1zviYjVbu3Fl92oX00ySCHLpXhHHfHFf9cep?= =?us-ascii?Q?kJCGZ1t40Lhlk/TJVk4xtORxcUW8cZ+S0kAt+RMAue9rQjK9Gxkji35+UeLZ?= =?us-ascii?Q?ocuA51R8EpF7gSotpD5GW8gJlL8pmAs3LyrDO6Vu?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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: 6ee267d3-63f9-43e4-9eb7-08dc5ff15b3f X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2024 21:49:00.1928 (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: GHho7bRigCX5yicLHv+D0uyPFET7K1gFGDyyUaU44pRZkJ+75S09XHmQietDCwdbLGHaWeEwlvjj4xy2799KDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR83MB0695 X-Spam-Status: No, score=-11.1 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_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 List-Id: This patch reuses the MinGW implementation to enable DLL import/export functionality for the aarch64-w64-mingw32 target. It also modifies environment configurations for MinGW. gcc/ChangeLog: * config.gcc: Add winnt-dll.o, which contains the DLL import/export implementation. * config/aarch64/aarch64-protos.h (legitimize_pe_coff_symbol): Declare a MinGW function for expanding a symbol for COFF. * config/aarch64/aarch64.cc (aarch64_legitimize_pe_coff_symbol): Add a conditional function that reuses the MinGW implementation for COFF and does nothing otherwise. (aarch64_load_symref_appropriately): Add dllimport implementation. (aarch64_expand_call): Likewise. (aarch64_legitimize_address): Likewise. * config/aarch64/cygming.h (SYMBOL_FLAG_DLLIMPORT): Modify MinGW environment to support DLL import/export. (SYMBOL_FLAG_DLLEXPORT): Likewise. (SYMBOL_REF_DLLIMPORT_P): Likewise. (SYMBOL_FLAG_STUBVAR): Likewise. (SYMBOL_REF_STUBVAR_P): Likewise. (mingw_pe_valid_dllimport_attribute_p): Likewise. (mingw_pe_file_end): Likewise. (mingw_pe_record_stub): Likewise. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Likewise. (TARGET_ASM_FILE_END): Likewise. (SUB_TARGET_RECORD_STUB): Likewise. --- gcc/config.gcc | 2 +- gcc/config/aarch64/aarch64-protos.h | 1 + gcc/config/aarch64/aarch64.cc | 37 +++++++++++++++++++++++++++++ gcc/config/aarch64/cygming.h | 19 +++++++++++++-- 4 files changed, 56 insertions(+), 3 deletions(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index be2b20a155c..dce3a422daf 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1280,7 +1280,7 @@ aarch64-*-mingw*) tmake_file=3D"${tmake_file} aarch64/t-aarch64" target_gtfiles=3D"$target_gtfiles \$(srcdir)/config/mingw/winnt.cc" extra_options=3D"${extra_options} mingw/cygming.opt mingw/mingw.opt" - extra_objs=3D"${extra_objs} winnt.o" + extra_objs=3D"${extra_objs} winnt.o winnt-dll.o" c_target_objs=3D"${c_target_objs} msformat-c.o" d_target_objs=3D"${d_target_objs} winnt-d.o" tmake_file=3D"${tmake_file} mingw/t-cygming" diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch= 64-protos.h index 95972556c56..996acb60d61 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -25,6 +25,7 @@ #include "input.h" #include "config/arm/aarch-common.h" #include "config/mingw/winnt.h" +#include "config/mingw/winnt-dll.h" =20 /* SYMBOL_SMALL_ABSOLUTE: Generate symbol accesses through high and lo relocs that calculate the base address using a PC diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 19205927430..7e28b5f0c08 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -856,6 +856,10 @@ static const attribute_spec aarch64_gnu_attributes[] = =3D { "Advanced SIMD type", 1, 1, false, true, false, true, NULL, NULL }, { "SVE type", 3, 3, false, true, false, true, NULL, NULL }, { "SVE sizeless type", 0, 0, false, true, false, true, NULL, NULL }, +#if TARGET_DLLIMPORT_DECL_ATTRIBUTES + { "dllimport", 0, 0, false, false, false, false, handle_dll_attribute, N= ULL }, + { "dllexport", 0, 0, false, false, false, false, handle_dll_attribute, N= ULL }, +#endif #ifdef SUBTARGET_ATTRIBUTE_TABLE SUBTARGET_ATTRIBUTE_TABLE #endif @@ -2815,6 +2819,15 @@ tls_symbolic_operand_type (rtx addr) return tls_kind; } =20 +rtx aarch64_legitimize_pe_coff_symbol (rtx addr, bool inreg) +{ +#if TARGET_PECOFF + return legitimize_pe_coff_symbol (addr, inreg); +#else + return NULL_RTX; +#endif +} + /* We'll allow lo_sum's in addresses in our legitimate addresses so that combine would take care of combining addresses where necessary, but for generation purposes, we'll generate the address @@ -2861,6 +2874,17 @@ static void aarch64_load_symref_appropriately (rtx dest, rtx imm, enum aarch64_symbol_type type) { + /* If legitimize returns a value + copy it directly to the destination and return. */ + + rtx tmp =3D aarch64_legitimize_pe_coff_symbol (imm, true); + + if (tmp) + { + emit_insn (gen_rtx_SET (dest, tmp)); + return; + } + switch (type) { case SYMBOL_SMALL_ABSOLUTE: @@ -11231,6 +11255,12 @@ aarch64_expand_call (rtx result, rtx mem, rtx cook= ie, bool sibcall) =20 gcc_assert (MEM_P (mem)); callee =3D XEXP (mem, 0); + + tmp =3D aarch64_legitimize_pe_coff_symbol (callee, false); + + if (tmp) + callee =3D tmp; + mode =3D GET_MODE (callee); gcc_assert (mode =3D=3D Pmode); =20 @@ -12707,6 +12737,13 @@ aarch64_anchor_offset (HOST_WIDE_INT offset, HOST_= WIDE_INT size, static rtx aarch64_legitimize_address (rtx x, rtx /* orig_x */, machine_mode mode) { + if (TARGET_DLLIMPORT_DECL_ATTRIBUTES) + { + rtx tmp =3D aarch64_legitimize_pe_coff_symbol (x, true); + if (tmp) + return tmp; + } + /* Try to split X+CONST into Y=3DX+(CONST & ~mask), Y+(CONST&mask), where mask is selected by alignment and size of the offset. We try to pick as large a range for the offset as possible to diff --git a/gcc/config/aarch64/cygming.h b/gcc/config/aarch64/cygming.h index 76623153080..4beebf9e093 100644 --- a/gcc/config/aarch64/cygming.h +++ b/gcc/config/aarch64/cygming.h @@ -28,12 +28,18 @@ along with GCC; see the file COPYING3. If not see =20 #define print_reg(rtx, code, file) (gcc_unreachable ()) =20 -#define SYMBOL_FLAG_DLLIMPORT 0 -#define SYMBOL_FLAG_DLLEXPORT 0 +#define SYMBOL_FLAG_DLLIMPORT (SYMBOL_FLAG_MACH_DEP << 0) +#define SYMBOL_REF_DLLIMPORT_P(X) \ + ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_DLLIMPORT) !=3D 0) =20 +#define SYMBOL_FLAG_DLLEXPORT (SYMBOL_FLAG_MACH_DEP << 1) #define SYMBOL_REF_DLLEXPORT_P(X) \ ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_DLLEXPORT) !=3D 0) =20 +#define SYMBOL_FLAG_STUBVAR (SYMBOL_FLAG_MACH_DEP << 2) +#define SYMBOL_REF_STUBVAR_P(X) \ + ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_STUBVAR) !=3D 0) + /* Disable SEH and declare the required SEH-related macros that are still needed for compilation. */ #undef TARGET_SEH @@ -59,6 +65,12 @@ still needed for compilation. */ #define TARGET_ASM_UNIQUE_SECTION mingw_pe_unique_section #define TARGET_ENCODE_SECTION_INFO mingw_pe_encode_section_info =20 +#define TARGET_VALID_DLLIMPORT_ATTRIBUTE_P mingw_pe_valid_dllimport_attrib= ute_p + +/* Output function declarations at the end of the file. */ +#undef TARGET_ASM_FILE_END +#define TARGET_ASM_FILE_END mingw_pe_file_end + /* Declare the type properly for any external libcall. */ #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ mingw_pe_declare_function_type (FILE, XSTR (FUN, 0), 1) @@ -158,6 +170,9 @@ still needed for compilation. */ { "selectany", 0, 0, true, false, false, false, \ mingw_handle_selectany_attribute, NULL } =20 +#undef SUB_TARGET_RECORD_STUB +#define SUB_TARGET_RECORD_STUB mingw_pe_record_stub + #define SUPPORTS_ONE_ONLY 1 =20 /* Define this to be nonzero if static stack checking is supported. */ --=20 2.25.1