This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Skip the PR 14918 linker test for ARM targets.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=231ca753239211b72eb761593083a0ee859274e7

commit 231ca753239211b72eb761593083a0ee859274e7
Author: Nick Clifton <nickc@redhat.com>
Date:   Thu Sep 28 11:33:20 2017 +0100

    Skip the PR 14918 linker test for ARM targets.
    
     I am applying a patch that has been lying around in the Fedora
      binutils sources for a while.  It skips the PR14918 linker test for
      ARM based targets.  This test checks that libgcc is not included in a
      link of an empty executable.  This works for most targets, but on the
      ARM the crt1.o startup code calls __libc_csu_init which is in
      /usr/lib/libc_nonshared.a(elf-init.oS).  This in turn needs
      __aeabi_unwind_cpp_pr0@@GCC_3.5 which is provided by libgcc_s.so.1,
      and so the test fails.

Diff:
---
 ld/ChangeLog                   |  6 ++++++
 ld/testsuite/ld-plugin/lto.exp | 16 +++++++++++++---
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index d671ed1..1c5ca55 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-28  Nick Clifton  <nickc@redhat.com>
+
+	PR 14918
+	* testsuite/ld-plugin/lto.exp (link_elf_tests): Skip the pr14918
+	test for ARM targets as they always link with libgcc.
+
 2017-09-28  Alan Modra  <amodra@gmail.com>
 
 	* testsuite/ld-plugin/pr22220.h,
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 6b7ad53..d34479f 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -286,9 +286,6 @@ set lto_link_elf_tests [list \
   [list "PR ld/16746 (2)" \
    "-O2 -flto -fuse-linker-plugin tmpdir/pr16746c.o tmpdir/pr16746a.o" "-O2 -flto" \
    {dummy.c} {} "pr16746b.exe"] \
-  [list "PR ld/14918" \
-   "-flto" "-flto" \
-   {pr14918.c} {{"readelf" {-d --wide} "pr14918.d"}} "pr14918.exe" "c"] \
   [list "Build pr21382a.o" \
    "" "-O2 -flto" \
    {pr21382a.c} {} "" "c"] \
@@ -303,6 +300,19 @@ set lto_link_elf_tests [list \
    {pr22220main.cc} {} {} {c++}] \
 ]
 
+# PR 14918 checks that libgcc is not spuriously included in a shared link of
+# an empty program.  The ARM crt1.o startup code however calls __libc_csu_init
+# in /usr/lib/libc_nonshared.a(elf-init.oS).  This in turn needs
+# __aeabi_unwind_cpp_pr0@@GCC_3.5 which is provided by libgcc_s.so.1, so the
+# test fails.  Hence this code to skip the test.
+if { ! [istarget "arm*-*-*"] } {
+    set lto_link_elf_tests [concat $lto_link_elf_tests [list \
+  [list "PR ld/14918" \
+   "-flto" "-flto" \
+   {pr14918.c} {{"readelf" {-d --wide} "pr14918.d"}} "pr14918.exe" "c"] \
+  ]]
+}
+
 # Check final symbols in executables.
 set lto_link_symbol_tests [list \
   [list "LTO 3 symbol" \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]