From df71cb5cbfa26ad79e5cf674056205f0505e229d Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 24 Jul 2013 17:24:20 +0000 Subject: [PATCH] Check .gnu.warning section in shared library PR ld/15762 * ld-elf/shared.exp (build_tests): Check .gnu.warning section in the libbarw.so library. * ld-elf/libbarw.rd: New. * lib/ld-lib.exp (run_cc_link_tests): Support checking on output with warning message. --- ld/testsuite/ChangeLog | 16 +++++++++++++--- ld/testsuite/ld-elf/libbarw.rd | 3 +++ ld/testsuite/ld-elf/shared.exp | 2 +- ld/testsuite/lib/ld-lib.exp | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 ld/testsuite/ld-elf/libbarw.rd diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index a161428..ae6a722 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,4 +1,14 @@ -* 2013-07-22 Sebastian Huber +2013-07-24 H.J. Lu + + PR ld/15762 + * ld-elf/shared.exp (build_tests): Check .gnu.warning section + in the libbarw.so library. + * ld-elf/libbarw.rd: New. + + * lib/ld-lib.exp (run_cc_link_tests): Support checking on + output with warning message. + +2013-07-22 Sebastian Huber * ld-scripts/script.exp: Use run_dump_test instead of ld_simple_link to check the error message. @@ -17,8 +27,8 @@ 2013-07-18 Terry Guo - * ld-arm/thumb-b-lks-sym.d: Updated to be more flexible. - * ld-arm/thumb-bl-lks-sym.d: Likewise. + * ld-arm/thumb-b-lks-sym.d: Updated to be more flexible. + * ld-arm/thumb-bl-lks-sym.d: Likewise. 2013-07-18 Roland McGrath diff --git a/ld/testsuite/ld-elf/libbarw.rd b/ld/testsuite/ld-elf/libbarw.rd new file mode 100644 index 0000000..c650c17 --- /dev/null +++ b/ld/testsuite/ld-elf/libbarw.rd @@ -0,0 +1,3 @@ +#... + \[[ 0-9]+\] \.gnu.warning.foo[ \t]+PROGBITS[ \t0-9a-f]+.* +#pass diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index 89409fa..56c724f 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -50,7 +50,7 @@ set build_tests { {begin.c end.c} {} "libbar.so"} {"Build warn libbar.so" "-shared" "-fPIC" - {beginwarn.c end.c} {} "libbarw.so" + {beginwarn.c end.c} {{readelf {-S --wide} libbarw.rd}} "libbarw.so" "C" "^.*\\\): warning: function foo is deprecated$"} {"Build hidden libbar.so" "-shared" "-fPIC" diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index ffbfd8b..256d826 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -1424,7 +1424,7 @@ proc run_cc_link_tests { ldtests } { if { $warnings != "" } then { verbose -log "returned with: <$exec_output>, expected: <$warnings>" if { [regexp $warnings $exec_output] } then { - set failed 2 + set failed 0 } else { set failed 1 } -- 2.7.4