aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Karpov <Evgeny.Karpov@microsoft.com>2024-06-24 12:46:54 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2024-06-25 06:38:39 +0000
commited20feebd9ea31d58861f61205bd412b0c3febd0 (patch)
tree23a654fd5c2a5bc0cb89461c7884a34fa68d8e8b
parent337632ef02a77d20ceb3dcb04751b4d4c844e23e (diff)
Adjust DLL import/export implementation for AArch64
The DLL import/export mingw implementation, originally from ix86, requires minor adjustments to be compatible with AArch64. 2024-06-08 Evgeny Karpov <Evgeny.Karpov@microsoft.com> gcc/ChangeLog: * config/i386/cygming.h (PE_COFF_EXTERN_DECL_SHOULD_BE_LEGITIMIZED): Declare whether an external declaration should be legitimized. (HAVE_64BIT_POINTERS): Define whether the target supports 64-bit pointers. * config/mingw/mingw32.h (defined): Use the correct DllMainCRTStartup entry function. * config/mingw/winnt-dll.cc (defined): Exclude ix86-related code.
-rw-r--r--gcc/config/i386/cygming.h5
-rw-r--r--gcc/config/mingw/mingw32.h2
-rw-r--r--gcc/config/mingw/winnt-dll.cc2
3 files changed, 7 insertions, 2 deletions
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index 4bb8d7f920c..0493b3be875 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -472,3 +472,8 @@ do { \
#undef GOT_ALIAS_SET
#define GOT_ALIAS_SET mingw_GOT_alias_set ()
+
+#define PE_COFF_EXTERN_DECL_SHOULD_BE_LEGITIMIZED \
+ ix86_cmodel == CM_LARGE_PIC || ix86_cmodel == CM_MEDIUM_PIC
+
+#define HAVE_64BIT_POINTERS TARGET_64BIT_DEFAULT
diff --git a/gcc/config/mingw/mingw32.h b/gcc/config/mingw/mingw32.h
index da8e1e8949e..0dfe8e995b6 100644
--- a/gcc/config/mingw/mingw32.h
+++ b/gcc/config/mingw/mingw32.h
@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. If not see
#endif
#undef SUB_LINK_ENTRY
-#if TARGET_64BIT_DEFAULT
+#if HAVE_64BIT_POINTERS
#define SUB_LINK_ENTRY SUB_LINK_ENTRY64
#else
#define SUB_LINK_ENTRY SUB_LINK_ENTRY32
diff --git a/gcc/config/mingw/winnt-dll.cc b/gcc/config/mingw/winnt-dll.cc
index 1354402a959..66c445cba77 100644
--- a/gcc/config/mingw/winnt-dll.cc
+++ b/gcc/config/mingw/winnt-dll.cc
@@ -206,7 +206,7 @@ legitimize_pe_coff_symbol (rtx addr, bool inreg)
}
}
- if (ix86_cmodel != CM_LARGE_PIC && ix86_cmodel != CM_MEDIUM_PIC)
+ if (!PE_COFF_EXTERN_DECL_SHOULD_BE_LEGITIMIZED)
return NULL_RTX;
if (GET_CODE (addr) == SYMBOL_REF