* 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.
This commit is contained in:
Nick Clifton
2004-10-23 17:26:36 +00:00
parent 121d8485df
commit 0fd555c412
6 changed files with 109 additions and 48 deletions

View File

@@ -1,3 +1,14 @@
2004-10-23 Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
* 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.
2004-07-12 Nick Clifton <nickc@redhat.com>
* binutils-all/dlltool.exp: Check that the -p switch is not

View File

@@ -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)"
}

View File

@@ -71,19 +71,28 @@ if ![info exists DLLTOOL] then {
if ![file isdirectory tmpdir] {catch "exec mkdir tmpdir" status}
# Make a symlink from tmpdir/gas/as and tmpdir/gas/ld to the assembler
# Make a copy from tmpdir/gas/as and tmpdir/gas/ld to the assembler
# and linker in the build tree, so that we can use a -B option to gcc
# to force it to use the newly built assembler/linker.
if {![file isdirectory tmpdir/gas]} then {
catch "exec mkdir tmpdir/gas" status
if {[file isfile ../gas/as-new]} then {
catch "exec ln -s ../../../gas/as-new tmpdir/gas/as" status
send_user "file isfile ../gas/as-new[exe_ext]: [file isfile ../gas/as-new[exe_ext]]\n"
if {[file isfile ../gas/as-new[exe_ext]]} then {
catch "exec cp ../gas/as-new[exe_ext] tmpdir/gas/as[exe_ext]" status
} else {
# For non-Windows hosts there may be an executable
# without a .exe suffix, so try copying that instead.
catch "exec cp ../gas/as-new tmpdir/gas/as[exe_ext]" status
}
if {[file isfile ../ld/ld-new]} then {
catch "exec ln -s ../../../ld/ld-new tmpdir/gas/ld" status
# This may not be needed any more...
if {[file isfile ../ld/ld-new[exe_ext]]} then {
catch "exec cp ../ld/ld-new[exe_ext] tmpdir/gas/ld[exe_ext]" status
} else {
catch "exec cp ../ld/ld-new tmpdir/gas/ld[exe_ext]" status
}
}
set gcc_gas_flag "-B[pwd]/tmpdir/gas/"
set dlltool_gas_flag "-S [pwd]/tmpdir/gas/as[exe_ext]"
#
# binutils_run

View File

@@ -149,3 +149,15 @@ proc is_elf_format {} {
}
return 1
}
#
# exe_ext
# Returns target executable extension, if any.
#
proc exe_ext {} {
if { [istarget *-*-mingw32] || [istarget *-*-cygwin*] } {
return ".exe"
} else {
return ""
}
}