]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Adjust DLL import/export implementation for AArch64
authorEvgeny Karpov <Evgeny.Karpov@microsoft.com>
Mon, 24 Jun 2024 12:46:54 +0000 (12:46 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Tue, 25 Jun 2024 06:38:39 +0000 (06:38 +0000)
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.

gcc/config/i386/cygming.h
gcc/config/mingw/mingw32.h
gcc/config/mingw/winnt-dll.cc

index 4bb8d7f920c18ce3fbdd88ac23e84c161f63a984..0493b3be8755b6bcf00420c59737f2ecbbc702de 100644 (file)
@@ -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
index da8e1e8949e79e6965655d99e64a54a3f03c57a7..0dfe8e995b6d4addccc92b9c1c1c6a2db1f6a07e 100644 (file)
@@ -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
index 1354402a959bf71bf3df6e01aa226ab859baf4a6..66c445cba77af2692c6e9093b34f74df1ae408f0 100644 (file)
@@ -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