Symbols using GOT are not supported by the aarch64-w64-mingw32
target and should be excluded from the code models.

gcc/ChangeLog:

        * config/aarch64/aarch64.cc (aarch64_classify_symbol):
        Disable GOT for PECOFF target.
---
 gcc/config/aarch64/aarch64.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index f07b63bf199..62a154e5083 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -21105,7 +21105,8 @@ aarch64_classify_symbol (rtx x, HOST_WIDE_INT offset)
        case AARCH64_CMODEL_TINY:
          /* With -fPIC non-local symbols use the GOT.  For orthogonality
             always use the GOT for extern weak symbols.  */
-         if ((flag_pic || SYMBOL_REF_WEAK (x))
+         if (!TARGET_PECOFF
+             && (flag_pic || SYMBOL_REF_WEAK (x))
              && !aarch64_symbol_binds_local_p (x))
            return SYMBOL_TINY_GOT;
 
@@ -21127,7 +21128,8 @@ aarch64_classify_symbol (rtx x, HOST_WIDE_INT offset)
        case AARCH64_CMODEL_SMALL_SPIC:
        case AARCH64_CMODEL_SMALL_PIC:
        case AARCH64_CMODEL_SMALL:
-         if ((flag_pic || SYMBOL_REF_WEAK (x))
+         if (!TARGET_PECOFF
+             && (flag_pic || SYMBOL_REF_WEAK (x))
              && !aarch64_symbol_binds_local_p (x))
            return aarch64_cmodel == AARCH64_CMODEL_SMALL_SPIC
                    ? SYMBOL_SMALL_GOT_28K : SYMBOL_SMALL_GOT_4G;
-- 
2.34.1

Reply via email to