summaryrefslogtreecommitdiffstats
path: root/0012-handle-dllimport-properly-in-medium-model.patch
diff options
context:
space:
mode:
Diffstat (limited to '0012-handle-dllimport-properly-in-medium-model.patch')
-rw-r--r--0012-handle-dllimport-properly-in-medium-model.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/0012-handle-dllimport-properly-in-medium-model.patch b/0012-handle-dllimport-properly-in-medium-model.patch
new file mode 100644
index 0000000..6520bb0
--- /dev/null
+++ b/0012-handle-dllimport-properly-in-medium-model.patch
@@ -0,0 +1,35 @@
+From 8d351787bfcd1db7a5661dd9fccd0a1fa0fa04fc Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 09:52:21 +0800
+Subject: [PATCH 12/21] handle dllimport properly in medium model
+
+---
+ 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 bc76a5b..e886af2 100644
+--- a/gcc/config/i386/predicates.md
++++ b/gcc/config/i386/predicates.md
+@@ -168,6 +168,7 @@
+ switch (XINT (XEXP (op, 0), 1))
+ {
+ case UNSPEC_GOTPCREL:
++ if (TARGET_PECOFF) break;
+ case UNSPEC_DTPOFF:
+ case UNSPEC_GOTNTPOFF:
+ case UNSPEC_NTPOFF:
+@@ -263,6 +264,10 @@
+ /* TLS symbols are not constant. */
+ if (SYMBOL_REF_TLS_MODEL (op))
+ return false;
++ /* Dll-imported symbols are always external. */
++ if (TARGET_DLLIMPORT_DECL_ATTRIBUTES && SYMBOL_REF_DLLIMPORT_P (op))
++ return false;
++
+ return (ix86_cmodel == CM_SMALL
+ || (ix86_cmodel == CM_MEDIUM
+ && !SYMBOL_REF_FAR_ADDR_P (op)));
+--
+2.4.5
+