diff options
author | Kai Tietz <kai.tietz@onevision.com> | 2010-03-31 16:34:12 +0000 |
---|---|---|
committer | Kai Tietz <kai.tietz@onevision.com> | 2010-03-31 16:34:12 +0000 |
commit | 1e972e651b732a7f50c788958919defe95b887c1 (patch) | |
tree | d21bd0ac5f669d205a20c1b89140daf660948d9a /ld/testsuite | |
parent | b706dc83c1a3d333c25aaaeb088960322845b8fd (diff) | |
download | gdb-1e972e651b732a7f50c788958919defe95b887c1.zip gdb-1e972e651b732a7f50c788958919defe95b887c1.tar.gz gdb-1e972e651b732a7f50c788958919defe95b887c1.tar.bz2 |
2010-03-31 Kai TIetz <kai.tietz@onevision.com>
* ld-pe/basefile1.s: New.
* ld-pe/pe-compile.exp: Add base-file test.
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-pe/basefile1.s | 18 | ||||
-rwxr-xr-x | ld/testsuite/ld-pe/pe-compile.exp | 52 |
3 files changed, 75 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index d8d0475..c4852d6 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-03-31 Kai TIetz <kai.tietz@onevision.com> + + * ld-pe/basefile1.s: New. + * ld-pe/pe-compile.exp: Add base-file test. + 2010-03-31 Hans-Peter Nilsson <hp@axis.com> PR ld/11458 diff --git a/ld/testsuite/ld-pe/basefile1.s b/ld/testsuite/ld-pe/basefile1.s new file mode 100644 index 0000000..f24c4fc --- /dev/null +++ b/ld/testsuite/ld-pe/basefile1.s @@ -0,0 +1,18 @@ +.globl _start +.globl start +.text +_start: +start: + .long 0 + +.globl _d1 +.globl _d2 +.globl _d3 +.data +_d1: + .long 1 +_d2: + .secrel32 _d3 +_d3: + .long 2 + diff --git a/ld/testsuite/ld-pe/pe-compile.exp b/ld/testsuite/ld-pe/pe-compile.exp index b9bc4af..07ad016 100755 --- a/ld/testsuite/ld-pe/pe-compile.exp +++ b/ld/testsuite/ld-pe/pe-compile.exp @@ -34,6 +34,47 @@ if { [which $CC] == 0 } { return } +proc build_basefile1_o {} { + global CC + global CFLAGS + global srcdir + global subdir + + # Compile the object file. + if ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/basefile1.s tmpdir/basefile1.o] { + fail "compiling basefile1 object" + } +} + +proc run_basefile_test { testname } { + global LD + global DLLTOOL + global srcdir + global subdir + global verbose + + if ![ld_simple_link "$LD -e start \ + --base-file=tmpdir/$testname.base \ + --export-all-symbols" tmpdir/$testname.dll \ + "tmpdir/basefile1.o"] { + fail "linking DLL" + return + } + + if { $verbose > 2 } then { verbose "output is [file_contents tmpdir/$testname.base]" 3 } + + catch "exec wc -c tmpdir/$testname.base" err + + if ![string match "0 tmpdir/$testname.base" $err] then { + send_log "$err\n" + if { $verbose == 2 } then { verbose "$err" 2 } + fail $testname + return + } + + pass "$testname" +} + proc build_vers_script_dll_o {} { global CC global CFLAGS @@ -77,6 +118,17 @@ run_ver_script_test "vers-script-2" run_ver_script_test "vers-script-3" run_ver_script_test "vers-script-4" +if {[istarget i*86-*-cygwin*] + || [istarget i*86-*-pe] + || [istarget i*86-*-mingw*] + || [istarget x86_64-*-mingw*] } { + + build_basefile1_o + run_basefile_test "basefile-secrel" + } else { + untested "PE basefile test" + } + set align_tests { {"aligned common 1" "" "" {aligncomm-1.c} {{nm -C aligncomm.d}} "aligncomm-1.x"} |