MSYS2-packages/mingw-w64-cross-gcc/0003-Cygwin-handle-dllimport-properly-in-medium-model-V2.patch
Christoph Reiter 5d0ae9ff04 cross-gcc: Update to 13.2.0
* sync in patches from cygwin gcc
* sync in important patches from mingw gcc not related to the build
* enabling stripping (not sure why it was disabled)
* reduce diff for build options to the mingw gcc build a bit
2023-11-13 19:49:38 +01:00

36 lines
1.1 KiB
Diff

From 8efd8be0cefbf4f0dff1473a4b1077c571145197 Mon Sep 17 00:00:00 2001
From: Jonathan Yong <10walls@gmail.com>
Date: Tue, 8 Sep 2020 14:56:50 +0200
Subject: [PATCH 03/13] Cygwin: handle dllimport properly in medium model V2
---
gcc/config/i386/predicates.md | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index b815aca0da7..c71eed7f60c 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -202,6 +202,7 @@
switch (XINT (XEXP (op, 0), 1))
{
case UNSPEC_GOTPCREL:
+ if (TARGET_PECOFF) break;
case UNSPEC_DTPOFF:
case UNSPEC_GOTNTPOFF:
case UNSPEC_NTPOFF:
@@ -307,6 +308,10 @@
if (ix86_force_load_from_GOT_p (op))
return false;
+ /* Dll-imported symbols are always external. */
+ if (TARGET_DLLIMPORT_DECL_ATTRIBUTES && SYMBOL_REF_DLLIMPORT_P (op))
+ return false;
+
/* For certain code models, the symbolic references are known to fit. */
return (ix86_cmodel == CM_SMALL
|| (ix86_cmodel == CM_MEDIUM
--
2.39.0