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] Fix more linker testsuite failures.


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

commit 1b857aeed3f5cfddc4b5b1f5836ccd341aeb9f5d
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue Jun 28 15:55:22 2016 +0100

    Fix more linker testsuite failures.
    
    bfin	* elf32-bfin.c (bfin_adjust_dynamic_symbol): Fail if a COPY reloc
    	is needed.
    
    ld	* testsuite/ld-elf/comm-data.exp: Expect comm-data2 test to fail
    	for bfin.
    	* testsuite/ld-elf/elf.exp: Expect pr14170 and symbolic function
    	tests to fail for bfin.
    	* testsuite/ld-elf/endsym.d: Expect to fail with cr16, crx, dlx,
    	nds32 and visium.
    	* testsuite/ld-elf/var1.d: Expect to fail with d30v, dlx, ft32 and
    	microblaze.
    	* testsuite/ld-pe/pe.exp: Expect foreign symbol test to fail for
    	mcore-pe.

Diff:
---
 bfd/ChangeLog                     |  3 +++
 bfd/elf32-bfin.c                  | 11 +++++++++--
 ld/ChangeLog                      | 27 +++++++++++++++++++++++++++
 ld/testsuite/ld-elf/comm-data.exp |  3 +++
 ld/testsuite/ld-elf/elf.exp       | 10 ++++++++++
 ld/testsuite/ld-elf/endsym.d      |  2 +-
 ld/testsuite/ld-elf/var1.d        |  1 +
 ld/testsuite/ld-pe/pe.exp         |  2 ++
 8 files changed, 56 insertions(+), 3 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 68d81c0..8ad7d0d 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,8 @@
 2016-06-28  Nick Clifton  <nickc@redhat.com>
 
+	* elf32-bfin.c (bfin_adjust_dynamic_symbol): Fail if a COPY reloc
+	is needed.
+
 	* elf32-arm.c (elf32_arm_backend_symbol_processing): New
 	function.  Marks mapping symbols in object files as precious, so
 	that strip will not remove them.
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index d7d096a..9c5802a 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -5252,7 +5252,8 @@ bfin_adjust_dynamic_symbol (struct bfd_link_info *info,
   s = bfd_get_linker_section (dynobj, ".dynbss");
   BFD_ASSERT (s != NULL);
 
-  /* We must generate a R_68K_COPY reloc to tell the dynamic linker to
+#if 0 /* Bfin does not currently have a COPY reloc.  */
+  /* We must generate a R_BFIN_COPY reloc to tell the dynamic linker to
      copy the initial value out of the dynamic object and into the
      runtime process image.  We need to remember the offset into the
      .rela.bss section we are going to use.  */
@@ -5265,7 +5266,13 @@ bfin_adjust_dynamic_symbol (struct bfd_link_info *info,
       srel->size += sizeof (Elf32_External_Rela);
       h->needs_copy = 1;
     }
-
+#else
+  if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
+    {
+      (*_bfd_error_handler) (_("the bfin target does not currently support the generation of copy relocations"),
+      return FALSE;
+    }
+#endif
   /* We need to figure out the alignment required for this symbol.  I
      have no idea how ELF linkers handle this.  */
   power_of_two = bfd_log2 (h->size);
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 9b6ff77..631fec5 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,30 @@
+2016-06-28  Nick Clifton  <nickc@redhat.com>
+
+	* testsuite/ld-elf/comm-data.exp: Expect comm-data2 test to fail
+	for bfin.
+	* testsuite/ld-elf/elf.exp: Expect pr14170 and symbolic function
+	tests to fail for bfin.
+	* testsuite/ld-elf/endsym.d: Expect to fail with cr16, crx, dlx,
+	nds32 and visium.
+	* testsuite/ld-elf/var1.d: Expect to fail with d30v, dlx, ft32 and
+	microblaze.
+	* testsuite/ld-pe/pe.exp: Expect foreign symbol test to fail for
+	mcore-pe.
+
+2016-06-28  Nick Clifton  <nickc@redhat.com>
+
+	* testsuite/ld-elf/merge.d: Add m68hc11 to list of targets that
+	expect to fail this test.
+	* testsuite/ld-scripts/overlay-size.d: Skip the entire test for
+	RX.
+	* testsuite/ld-scripts/rgn-at10.d: No longer expect this test to
+	fail for the RX.
+	* testsuite/ld-scripts/rgn-at11.d: Likewise.
+	* testsuite/ld-scripts/rgn-at2.d: Likewise.
+	* testsuite/ld-scripts/rgn-at6.d: Likewise.
+	* testsuite/ld-scripts/rgn-at7.d: Likewise.
+	* testsuite/ld-scripts/rgn-at8.d: Likewise.
+
 2016-06-28  James Clarke  <jrtc27@jrtc27.com>
 
 	* testsuite/ld-elf/symbolic-func.r: Allow non-zero offsets from
diff --git a/ld/testsuite/ld-elf/comm-data.exp b/ld/testsuite/ld-elf/comm-data.exp
index c7bf41d..1b75a79 100644
--- a/ld/testsuite/ld-elf/comm-data.exp
+++ b/ld/testsuite/ld-elf/comm-data.exp
@@ -68,6 +68,9 @@ if [istarget "*-*-hpux*"] {
     append AFLAGS " --defsym HPUX=1"
 }
 
+# bfin does not currently support copy relocs.
+setup_xfail "bfin-*-*"
+
 setup_xfail "arm*-*-*" "ld/13802"
 
 # List targets here that keep copy relocs rather than eliminating
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index af0b091..2dfd0e8 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -70,6 +70,10 @@ if { ![istarget hppa64*-hpux*] } {
 	run_ld_link_tests {
 	    {"Build shared library for pr14170"
 		"-shared" "" "" "pr14170b.s" {} "pr14170.so" }
+	}
+	# bfin does not currently support copy relocs.
+	setup_xfail "bfin-*-*"
+	run_ld_link_tests {
 	    {"PR ld/14170"
 		"tmpdir/pr14170a.o tmpdir/pr14170.so" "" "" "pr14170c.s"
 		{ } "pr14170" }
@@ -103,6 +107,10 @@ if { [check_shared_lib_support] } then {
 	{"Build pr17068b.a"
 	    "" "" ""
 	    {pr17068b.s pr17068e.s} {} "pr17068b.a"}
+    }
+    # bfin does not currently support copy relocs.
+    setup_xfail "bfin-*-*"
+    run_ld_link_tests {
 	{"pr17068 link --as-needed lib in group"
 	    "--as-needed" "--start-group tmpdir/pr17068a.a tmpdir/pr17068.so tmpdir/pr17068b.a --end-group" ""
 	    {start.s pr17068.s} {} "pr17068"}
@@ -111,6 +119,8 @@ if { [check_shared_lib_support] } then {
     setup_xfail "tic6x-*-*"
     # Fails on MIPS because ABI trickery means that a NULL reloc is also emitted.
     setup_xfail "mips*-*-*"
+    # Fails on bfin because relocations are not created.
+    setup_xfail "bfin-*-*"
     run_ld_link_tests {
 	{"-Bsymbolic-functions"
 	    "-shared -Bsymbolic-functions" "" ""
diff --git a/ld/testsuite/ld-elf/endsym.d b/ld/testsuite/ld-elf/endsym.d
index 483cc83..eefdd43 100644
--- a/ld/testsuite/ld-elf/endsym.d
+++ b/ld/testsuite/ld-elf/endsym.d
@@ -3,7 +3,7 @@
 #ld: --sort-common
 #nm: -n
 #notarget: hppa*-*-hpux*
-#xfail: m68hc1*-* xgate-*
+#xfail: m68hc1*-* xgate-* cr16-*-* crx-*-* dlx-*-* nds32*-*-* visium-*-*
 
 #...
 .* end
diff --git a/ld/testsuite/ld-elf/var1.d b/ld/testsuite/ld-elf/var1.d
index 718efb7..36a1f63 100644
--- a/ld/testsuite/ld-elf/var1.d
+++ b/ld/testsuite/ld-elf/var1.d
@@ -1,5 +1,6 @@
 #ld:  $srcdir/$subdir/var1.t --sort-section name
 #nm: -n
+#xfail: d30v-*-* dlx-*-* ft32-*-* microblaze-*-*
 
 #...
 [0-9a-f]* D var1
diff --git a/ld/testsuite/ld-pe/pe.exp b/ld/testsuite/ld-pe/pe.exp
index a31f6e7..8d86e8f 100644
--- a/ld/testsuite/ld-pe/pe.exp
+++ b/ld/testsuite/ld-pe/pe.exp
@@ -101,4 +101,6 @@ set foreign_sym_test {
    {{nm -C non-c-lang-syms.d}} "non-c-lang-syms.x"}
 }
 
+# MCore rearranges symbol order.
+setup_xfail mcore-*-pe
 run_ld_link_tests $foreign_sym_test


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