Run --gc-sections tests only if supported.
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 7 Oct 2011 19:55:47 +0000 (19:55 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 7 Oct 2011 19:55:47 +0000 (19:55 +0000)
2011-10-07  H.J. Lu  <hongjiu.lu@intel.com>

* ld-elf/elf.exp: Run --gc-sections tests only if --gc-sections
is available.

ld/testsuite/ChangeLog
ld/testsuite/ld-elf/elf.exp

index b59aed7..592e7e3 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-07  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * ld-elf/elf.exp: Run --gc-sections tests only if --gc-sections
+       is available.
+
 2011-10-06  Alan Modra  <amodra@gmail.com>
 
        * ld-plugin/plugin-1.d, * ld-plugin/plugin-2.d, * ld-plugin/plugin-3.d,
index 866c866..b993c96 100644 (file)
@@ -138,9 +138,11 @@ if ![isnative] {
     return
 }
 
-run_cc_link_tests {
-    {"PR ld/13195" "-Wl,--gc-sections" ""
-     {pr13195.c} {} "pr13195"}
+if [check_gc_sections_available] {
+    run_cc_link_tests {
+       {"PR ld/13195" "-Wl,--gc-sections" ""
+        {pr13195.c} {} "pr13195"}
+    }
 }
 
 set array_tests {