aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite/binutils-all/dlltool.exp
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-10-23 17:26:36 +0000
committerNick Clifton <nickc@redhat.com>2004-10-23 17:26:36 +0000
commit0fd555c412ecfb816f441dce78a3f288c49eb8e5 (patch)
treef6f9da26e659862b61a76fae855fcddf538f33be /binutils/testsuite/binutils-all/dlltool.exp
parent121d8485df3bd59f8a74752e6ef3b7123b482b9e (diff)
downloadgdb-0fd555c412ecfb816f441dce78a3f288c49eb8e5.zip
gdb-0fd555c412ecfb816f441dce78a3f288c49eb8e5.tar.gz
gdb-0fd555c412ecfb816f441dce78a3f288c49eb8e5.tar.bz2
* dlltool.c: Include <assert.h>.
(PREFIX_ALIAS_BASE): Define. (struct export): Add member import_name; (def_exports): Set import_name. (make_one_lib_file): Remove prefix alias code, use import_name in .idata$6. (gen_lib_file): Create and delete aliases. * binutils-all/alias.def: New file. * binutils-all/dlltool.exp: Two new -p tests. * config/default.exp (dlltool_gas_flag): New variable. Copy gas and lds executables into tmpdir/gas directory rather than making symlinks which might not be supported by the host OS. Attempt to handle the case where the host OS does not use the .exe extension but the target OS does. * lib/utils-lib.exp (exe_ext): New procedure.
Diffstat (limited to 'binutils/testsuite/binutils-all/dlltool.exp')
-rw-r--r--binutils/testsuite/binutils-all/dlltool.exp31
1 files changed, 24 insertions, 7 deletions
diff --git a/binutils/testsuite/binutils-all/dlltool.exp b/binutils/testsuite/binutils-all/dlltool.exp
index ba758df..3f6cd31 100644
--- a/binutils/testsuite/binutils-all/dlltool.exp
+++ b/binutils/testsuite/binutils-all/dlltool.exp
@@ -41,19 +41,36 @@ if ![string match "" $err] then {
send_log "$err\n"
verbose "$err" 1
fail "dlltool (fastcall export)"
- continue
+} else {
+ pass "dlltool (fastcall export)"
}
-pass "dlltool (fastcall export)"
-
-verbose "$DLLTOOL -p foo -d $srcdir/$subdir/fastcall.def" 1
-catch "exec $DLLTOOL -p foo -d $srcdir/$subdir/fastcall.def" err
+verbose "$DLLTOOL -p prefix -l tmpdir/libalias.a -d $srcdir/$subdir/alias.def $dlltool_gas_flag" 1
+catch "exec $DLLTOOL -p prefix -l tmpdir/libalias.a -d $srcdir/$subdir/alias.def $dlltool_gas_flag" err
if ![string match "" $err] then {
send_log "$err\n"
verbose "$err" 1
- fail "dlltool (aliased export)"
+ fail "dlltool -p (execution)"
continue
}
-pass "dlltool (aliased export)"
+pass "dlltool -p (execution)"
+
+set got [binutils_run $NM "tmpdir/libalias.a"]
+set want "00000000 I __imp__prefix_symbol.*00000000 T _prefix_symbol.*00000000 I __imp__symbol.*00000000 T _symbol"
+
+if [regexp $want $got] then {
+ pass "dlltool -p (symbol names)"
+} else {
+ fail "dlltool -p (symbol names)"
+}
+
+set got [binutils_run $OBJDUMP "-s -j .idata\$6 tmpdir/libalias.a"]
+set want "(Contents of section .idata\\\$6:.*\\.\\.symbol\\.\\..*){2,2}"
+
+if [regexp $want $got] then {
+ pass "dlltool -p (import name)"
+} else {
+ fail "dlltool -p (import name)"
+}