Check .gnu.warning section in shared library
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 24 Jul 2013 17:24:20 +0000 (17:24 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 24 Jul 2013 17:24:20 +0000 (17:24 +0000)
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
ld/testsuite/ld-elf/libbarw.rd [new file with mode: 0644]
ld/testsuite/ld-elf/shared.exp
ld/testsuite/lib/ld-lib.exp

index a1614282cff79f8cf3986309038e3efd6c4e0937..ae6a722d7ef781474113e85b1b8f9a03950b9bcc 100644 (file)
@@ -1,4 +1,14 @@
-* 2013-07-22  Sebastian Huber  <sebastian.huber@embedded-brains.de>
+2013-07-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+       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  <sebastian.huber@embedded-brains.de>
 
        * 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  <terry.guo@arm.com>
 
-        * 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  <mcgrathr@google.com>
 
diff --git a/ld/testsuite/ld-elf/libbarw.rd b/ld/testsuite/ld-elf/libbarw.rd
new file mode 100644 (file)
index 0000000..c650c17
--- /dev/null
@@ -0,0 +1,3 @@
+#...
+  \[[ 0-9]+\] \.gnu.warning.foo[ \t]+PROGBITS[ \t0-9a-f]+.*
+#pass
index 89409fad3f9a0edfd89f3244be008bd963691ec4..56c724f4b17d2b90f883da910b687961ae7bf442 100644 (file)
@@ -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"
index ffbfd8b41420745cdcdfc30eb5cc574d5f69be5a..256d8263c916879d67e668a8890217ad8cec06c3 100644 (file)
@@ -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
                }