diff options
author | Nick Clifton <nickc@redhat.com> | 2011-05-18 14:04:32 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2011-05-18 14:04:32 +0000 |
commit | dd98f8d276fb5538228255c4da43dd755738d151 (patch) | |
tree | cc041c39a61d0cbd8b5c9d31b7ac6098383bf235 /ld/testsuite/lib | |
parent | d0da06e2dfbebf62eef7a2ec510240844972dbdb (diff) | |
download | gdb-dd98f8d276fb5538228255c4da43dd755738d151.zip gdb-dd98f8d276fb5538228255c4da43dd755738d151.tar.gz gdb-dd98f8d276fb5538228255c4da43dd755738d151.tar.bz2 |
PR ld/12761
* elflink.c (elf_link_add_object_symbols): Process .gnu.warning
sections when building shared libraries.
* lib/ld-lib.exp (run_cc_link_tests): Add an optional 8th
parameter - an expected warning message from the linker.
* ld-elf/shared.exp (build_tests): Expect a warning message when
building the libbarw.so library.
* ld-elf/shared.exp: Run library building tests even when not
building a native toolchain.
Diffstat (limited to 'ld/testsuite/lib')
-rw-r--r-- | ld/testsuite/lib/ld-lib.exp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index 34de7c8..62e0ff7 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -1243,6 +1243,7 @@ proc run_ld_link_exec_tests { targets_to_xfail ldtests } { # 4:action and options. # 5:name of output file # 6:language (optional) +# 7:linker warnings (optional) # # Actions: # objdump: Apply objdump options on result. Compare with regex (last arg). @@ -1261,6 +1262,7 @@ proc run_cc_link_tests { ldtests } { global CFLAGS global CXXFLAGS global ar + global exec_output foreach testitem $ldtests { set testname [lindex $testitem 0] @@ -1270,6 +1272,7 @@ proc run_cc_link_tests { ldtests } { set actions [lindex $testitem 4] set binfile tmpdir/[lindex $testitem 5] set lang [lindex $testitem 6] + set warnings [lindex $testitem 7] set objfiles {} set is_unresolved 0 set failed 0 @@ -1306,8 +1309,18 @@ proc run_cc_link_tests { ldtests } { set failed 0 } } elseif { ![ld_simple_link $cc_cmd $binfile "-L$srcdir/$subdir $ldflags $objfiles"] } { - fail $testname - set failed 1 + # Check if exec_output is expected. + if { $warnings != "" } then { + verbose -log "returned with: <$exec_output>, expected: <$warnings>" + if { [regexp $warnings $exec_output] } then { + set failed 0 + } else { + set failed 1 + } + } else { + fail $testname + set failed 1 + } } else { set failed 0 } |