Fix more linker testsuite failures.
authorNick Clifton <nickc@redhat.com>
Tue, 28 Jun 2016 14:55:22 +0000 (15:55 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 28 Jun 2016 14:55:22 +0000 (15:55 +0100)
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.

bfd/ChangeLog
bfd/elf32-bfin.c
ld/ChangeLog
ld/testsuite/ld-elf/comm-data.exp
ld/testsuite/ld-elf/elf.exp
ld/testsuite/ld-elf/endsym.d
ld/testsuite/ld-elf/var1.d
ld/testsuite/ld-pe/pe.exp

index 68d81c04b722b622773f3685df4c531fb65a98e8..8ad7d0d49b1d441ddaabd756204228084de376b7 100644 (file)
@@ -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.
index d7d096af1c8146690434abac0a80a3c5b3eea1a2..9c5802ae3328db769682ed8b351995977e2d203e 100644 (file)
@@ -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);
index 9b6ff77afb1a58664d780dd03e147e0da1861e25..631fec5aef2be98df48b61bda1eb854c01904540 100644 (file)
@@ -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
index c7bf41d5c63f1fdc17b8a9bb91c43452d054a20c..1b75a793d9d6907cbf7ed60530b0bc094d1ac7db 100644 (file)
@@ -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
index af0b09187a4c37cf11bda76310c97301d69a4e2d..2dfd0e8012f6a99b8143bf650989f7077c88d2fe 100644 (file)
@@ -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" "" ""
index 483cc830355a48baf4f4b5ffa3a33d772c612a9b..eefdd43912c042cecce77cb1b1e63071b766c1b6 100644 (file)
@@ -3,7 +3,7 @@
 #ld: --sort-common
 #nm: -n
 #notarget: hppa*-*-hpux*
-#xfail: m68hc1*-* xgate-*
+#xfail: m68hc1*-* xgate-* cr16-*-* crx-*-* dlx-*-* nds32*-*-* visium-*-*
 
 #...
 .* end
index 718efb7252e5e2e8680510c630b222cbbf6a060e..36a1f634932bb6555221ad9e68f5a76c8bf76b1f 100644 (file)
@@ -1,5 +1,6 @@
 #ld:  $srcdir/$subdir/var1.t --sort-section name
 #nm: -n
+#xfail: d30v-*-* dlx-*-* ft32-*-* microblaze-*-*
 
 #...
 [0-9a-f]* D var1
index a31f6e7fd74e1e622d019a33b3e5f82000cc212d..8d86e8f2f2017a544f1d8d64fffb839d50d28be4 100644 (file)
@@ -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