aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorDave Korn <dave.korn@artimi.com>2009-04-01 17:20:19 +0000
committerDave Korn <dave.korn@artimi.com>2009-04-01 17:20:19 +0000
commit2fe50fe3ef07d80e667b932f46098d6b0b966d65 (patch)
tree5337c22f6d4b491bc572643034ff77f792b8afee /ld
parent4343666d145c423a5207b9ef168817387cd4079c (diff)
downloadgdb-2fe50fe3ef07d80e667b932f46098d6b0b966d65.zip
gdb-2fe50fe3ef07d80e667b932f46098d6b0b966d65.tar.gz
gdb-2fe50fe3ef07d80e667b932f46098d6b0b966d65.tar.bz2
binutils/ChangeLog
* dlltool.c (set_dll_name_from_def): Accept new second arg that indicates if we are building DLL or EXE, and use it to add a default suffix to the output filename when none is already present. (def_name): Indicate we are building an EXE when calling it. (def_library): Indicate we are building a DLL when calling it. ld/testsuite/ChangeLog * ld-cygwin/exe-export.exp: Add "-lkernel32" when linking test exe. * ld-cygwin/testexe.c (testexe_main): Indicate whether global_a was set to correct final value using error return status. (testexe_dummy): Dummy function calls an import from kernel32.dll to ensure it is mapped into the process space at runtime.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog8
-rw-r--r--ld/testsuite/ld-cygwin/exe-export.exp2
-rw-r--r--ld/testsuite/ld-cygwin/testexe.c17
3 files changed, 25 insertions, 2 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 209ac99..124b11c 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2009-04-01 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ * ld-cygwin/exe-export.exp: Add "-lkernel32" when linking test exe.
+ * ld-cygwin/testexe.c (testexe_main): Indicate whether global_a
+ was set to correct final value using error return status.
+ (testexe_dummy): Dummy function calls an import from kernel32.dll
+ to ensure it is mapped into the process space at runtime.
+
2009-04-01 Christophe Lyon <christophe.lyon@st.com>
* ld-arm/arm-elf.exp: BE8 tests expect the same output as the
diff --git a/ld/testsuite/ld-cygwin/exe-export.exp b/ld/testsuite/ld-cygwin/exe-export.exp
index 5fd3cf7..b05cbea 100644
--- a/ld/testsuite/ld-cygwin/exe-export.exp
+++ b/ld/testsuite/ld-cygwin/exe-export.exp
@@ -119,7 +119,7 @@ if ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/testexe.c $tmpdir/testexe.o] {
return
}
-if ![ld_special_link "$CC $LDFLAGS $MYLDFLAGS -e _testexe_main@16" $tmpdir/testexe.exe "$tmpdir/testexe.o $srcdir/$subdir/testexe.def $tmpdir/testdll.lib"] {
+if ![ld_special_link "$CC $LDFLAGS $MYLDFLAGS -e _testexe_main@16" $tmpdir/testexe.exe "$tmpdir/testexe.o $srcdir/$subdir/testexe.def $tmpdir/testdll.lib -lkernel32"] {
fail "linking executable"
return
}
diff --git a/ld/testsuite/ld-cygwin/testexe.c b/ld/testsuite/ld-cygwin/testexe.c
index 333c389..50a980b 100644
--- a/ld/testsuite/ld-cygwin/testexe.c
+++ b/ld/testsuite/ld-cygwin/testexe.c
@@ -12,5 +12,20 @@ int _stdcall
testexe_main (void* p1, void *p2, char* p3, int p4)
{
dllwrite ();
- return 0;
+ /* We can't print or assert in a minimal app like this,
+ so use the return status to indicate if global_a
+ ended up with the correct expected value. */
+ return 1 - global_a;
}
+
+/* We have to import something, anything at all, from
+ kernel32, in order to have the thread and process
+ base thunk routines loaded when we start running!. */
+extern __attribute((dllimport)) void _stdcall Sleep (unsigned int duration);
+
+int _stdcall
+testexe_dummy (unsigned int foobar)
+{
+ Sleep (foobar);
+}
+