This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[committed] Fix ld-pe aligncomm tests vs. GCC-3
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Thu, 21 May 2009 17:41:53 +0100
- Subject: [committed] Fix ld-pe aligncomm tests vs. GCC-3
Hi all,
As per the other day's discussion[*], gcc-3 used to call _alloca to align
the stack at the start of main(). Because these tests only need to link, not
run, a dummy definition will do fine, so this patch adds it.
Tested on i686-pc-cygwin with gcc-3 and gcc-4. Verified that it builds ok
with the addition on MinGW and arm-cegcc as well, although their standard
toolchains don't support the feature yet.
ld/testsuite/ChangeLog
* ld-pe/aligncomm-1.c (_alloca): Add dummy definition to
satisfy final link on Windows targets when using gcc-3.
* ld-pe/aligncomm-2.c (_alloca): Likewise.
* ld-pe/aligncomm-3.c (_alloca): Likewise.
* ld-pe/aligncomm-4.c (_alloca): Likewise.
cheers,
DaveK
--
[*] - http://sourceware.org/ml/binutils/2009-05/msg00312.html and thread.
Index: ld/testsuite/ld-pe/aligncomm-1.c
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-pe/aligncomm-1.c,v
retrieving revision 1.1
diff -p -u -r1.1 aligncomm-1.c
--- ld/testsuite/ld-pe/aligncomm-1.c 19 May 2009 16:08:08 -0000 1.1
+++ ld/testsuite/ld-pe/aligncomm-1.c 20 May 2009 06:20:17 -0000
@@ -17,3 +17,9 @@ void __main (void)
" .ascii \" -aligncomm:r,4\"\n"
" .text");
}
+
+#if defined (__CYGWIN__) || defined (__MINGW32__)
+void _alloca (void)
+{
+}
+#endif
Index: ld/testsuite/ld-pe/aligncomm-2.c
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-pe/aligncomm-2.c,v
retrieving revision 1.1
diff -p -u -r1.1 aligncomm-2.c
--- ld/testsuite/ld-pe/aligncomm-2.c 19 May 2009 16:08:08 -0000 1.1
+++ ld/testsuite/ld-pe/aligncomm-2.c 20 May 2009 06:20:17 -0000
@@ -18,3 +18,9 @@ void __main (void)
" .ascii \" -aligncomm:r,4\"\n"
" .text");
}
+
+#if defined (__CYGWIN__) || defined (__MINGW32__)
+void _alloca (void)
+{
+}
+#endif
Index: ld/testsuite/ld-pe/aligncomm-3.c
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-pe/aligncomm-3.c,v
retrieving revision 1.1
diff -p -u -r1.1 aligncomm-3.c
--- ld/testsuite/ld-pe/aligncomm-3.c 19 May 2009 16:08:08 -0000 1.1
+++ ld/testsuite/ld-pe/aligncomm-3.c 20 May 2009 06:20:17 -0000
@@ -19,3 +19,9 @@ void __main (void)
" .ascii \" -aligncomm:r,4\"\n"
" .text");
}
+
+#if defined (__CYGWIN__) || defined (__MINGW32__)
+void _alloca (void)
+{
+}
+#endif
Index: ld/testsuite/ld-pe/aligncomm-4.c
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-pe/aligncomm-4.c,v
retrieving revision 1.1
diff -p -u -r1.1 aligncomm-4.c
--- ld/testsuite/ld-pe/aligncomm-4.c 19 May 2009 16:08:08 -0000 1.1
+++ ld/testsuite/ld-pe/aligncomm-4.c 20 May 2009 06:20:17 -0000
@@ -20,3 +20,9 @@ void __main (void)
" .ascii \" -aligncomm:r,4\"\n"
" .text");
}
+
+#if defined (__CYGWIN__) || defined (__MINGW32__)
+void _alloca (void)
+{
+}
+#endif