[patch binutils] Handle Win64 calling convention in ld-plugin tests

Stephen Kitt steve@sk2.org
Sun Aug 24 16:00:00 GMT 2014


Hi,

Currently the ld-plugin tests expect to find ___main, which fails when
targetting Win64. (The calling convention there specifies no additional
underscores.) The following patch adjusts the defsym in ld-lib.exp for this
case; this allows the testsuite to pass on x86_64-w64-mingw32.

Regards,

Stephen


diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index e4084e1..4efec65 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -410,10 +410,14 @@ proc ld_simple_link_defsyms {} {
         append flags " --defsym __gccmain=0"
     }
 
-    # Windows targets need __main, prefixed with underscore.
-    if {[istarget *-*-cygwin* ] || [istarget *-*-mingw*]} {
+    # Windows 32-bit targets need __main, prefixed with underscore.
+    if {[istarget *-*-cygwin* ] || [istarget i*86-*-mingw*]} {
         append flags " --defsym ___main=0"
     }
+    # Windows 64-bit targets need __main, not prefixed
+    if {[istarget x86_64-*-mingw*]} {
+       append flags " --defsym __main=0"
+    }
 
     # PowerPC EABI code calls __eabi.
     if {[istarget powerpc*-*-eabi*] || [istarget powerpc*-*-rtems*]} {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20140824/2bf3338a/attachment.sig>


More information about the Binutils mailing list