[binutils-gdb] tic6x FAIL: ld-elf/pr3455

Alan Modra amodra@sourceware.org
Sun Aug 30 22:19:32 GMT 2026


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

commit ee7896781dc7ca425b5fe20eb5a9894553059ecf
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Aug 31 07:23:09 2026 +0930

    tic6x FAIL: ld-elf/pr3455
    
    This fixes a fail for a recently added testcase, the underlying cause
    being that tic6x-ld target defaults to "elf32-tic6x-elf-le", while
    tic6x-as target defaults to "elf32-tic6x-le".  I don't know why that
    is the case, so rather than reconciling the difference I decided to
    tackle the reason why tic6x-ld --shared doesn't create dynamic sections
    unless an input object contains relocations.  The fix is to relax the
    input object test where this normally occurs to match other places
    that test object suitability for dynamic sections.
    
    bfd/
            * elflink.c (elf_link_add_object_symbols): Use compatible_format
            rather than requiring an exact target match when creating
            dynamic sections for a dynamic output object.
    ld/
            * testsuite/ld-elf/elf.exp: Use append.
            * testsuite/ld-elf/pr24718-1.d: Don't xfail tic6x.
            * testsuite/ld-elf/pr27128a.d: Likewise.
            * testsuite/ld-elf/pr27128b.d: Likewise.
            * testsuite/ld-elf/pr27128c.d: Likewise.
            * testsuite/ld-elf/pr27128d.d: Likewise.
            * testsuite/ld-elf/pr27128e.d: Likewise.

Diff:
---
 bfd/elflink.c                   | 5 ++---
 ld/testsuite/ld-elf/elf.exp     | 6 +++---
 ld/testsuite/ld-elf/pr24718-1.d | 2 --
 ld/testsuite/ld-elf/pr27128a.d  | 2 --
 ld/testsuite/ld-elf/pr27128b.d  | 4 ++--
 ld/testsuite/ld-elf/pr27128c.d  | 2 --
 ld/testsuite/ld-elf/pr27128d.d  | 4 ++--
 ld/testsuite/ld-elf/pr27128e.d  | 4 ++--
 8 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/bfd/elflink.c b/bfd/elflink.c
index e7348901b8c..172cb439b6b 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -4633,13 +4633,12 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
 	 are no input BFD's of the same format as the output, we can't
 	 make a shared library.  */
       if (!just_syms
+	  && !htab->dynamic_sections_created
 	  && (bfd_link_pic (info)
 	      || (!bfd_link_relocatable (info)
 		  && info->nointerp
 		  && (info->export_dynamic || info->dynamic)))
-	  && is_elf_hash_table (&htab->root)
-	  && info->output_bfd->xvec == abfd->xvec
-	  && !htab->dynamic_sections_created)
+	  && compatible_format (info, abfd))
 	{
 	  if (!bfd_elf_link_create_dynamic_sections (info))
 	    goto error_return;
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index 2500d90e8f2..819b17ef4fc 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -40,7 +40,7 @@ proc riscv_little_endian { } {
 
 set old_ldflags $LDFLAGS
 if { [istarget spu*-*-*] } {
-    set LDFLAGS "$LDFLAGS --local-store 0:0"
+    append LDFLAGS " --local-store 0:0"
 }
 
 # hpux .comm differs from everyone else
@@ -48,7 +48,7 @@ set hpux ""
 set old_asflags $ASFLAGS
 if [istarget "*-*-hpux*"] {
     set hpux "--defsym HPUX=1"
-    set ASFLAGS "$ASFLAGS --defsym HPUX=1"
+    append ASFLAGS " --defsym HPUX=1"
 }
 
 # Some tests expect 32-bit addresses.  Force the executable to low addresses.
@@ -60,7 +60,7 @@ proc alpha_ld_flags { } {
 }
 
 if { [istarget alpha*-*-* ] } {
-    set ASFLAGS "$ASFLAGS --defsym NO_SET=1"
+    append ASFLAGS " --defsym NO_SET=1"
 }
 
 if [istarget "tic6x-*-*"] {
diff --git a/ld/testsuite/ld-elf/pr24718-1.d b/ld/testsuite/ld-elf/pr24718-1.d
index 767cf740ee0..9af9c3e9fc3 100644
--- a/ld/testsuite/ld-elf/pr24718-1.d
+++ b/ld/testsuite/ld-elf/pr24718-1.d
@@ -1,8 +1,6 @@
 #ld: -shared -version-script pr24718-1.t
 #readelf: -V
 #target: [check_shared_lib_support]
-#xfail: tic6x-*-*
-# tic6x requires a non-default emulation.
 
 #...
 Version definition section '\.gnu\.version_d' contains 3 entries:
diff --git a/ld/testsuite/ld-elf/pr27128a.d b/ld/testsuite/ld-elf/pr27128a.d
index 314b000b561..8675d18d50a 100644
--- a/ld/testsuite/ld-elf/pr27128a.d
+++ b/ld/testsuite/ld-elf/pr27128a.d
@@ -4,8 +4,6 @@
 #target: [check_shared_lib_support]
 #notarget: [is_underscore_target]
 # _Zrm1XS_ doesn't have an extra underscore.
-#xfail: tic6x-*-*
-# tic6x DYN lacks dynamic sections for this testcase
 
 #...
 VERS_2\.0 A 0+ 
diff --git a/ld/testsuite/ld-elf/pr27128b.d b/ld/testsuite/ld-elf/pr27128b.d
index 0721117edfa..af208ebd3c3 100644
--- a/ld/testsuite/ld-elf/pr27128b.d
+++ b/ld/testsuite/ld-elf/pr27128b.d
@@ -4,8 +4,8 @@
 #target: [check_shared_lib_support]
 #notarget: [is_underscore_target]
 # _Zrm1XS_ doesn't have an extra underscore.
-#xfail: hppa64-*-* tic6x-*-*
-# hppa64 uses dot-symbols, tic6x DYN lacks dynamic sections for this testcase
+#xfail: hppa64-*-*
+# hppa64 uses dot-symbols
 
 #...
 VERS_2\.0 A 0+ 
diff --git a/ld/testsuite/ld-elf/pr27128c.d b/ld/testsuite/ld-elf/pr27128c.d
index 1367bebb6ac..b7fa79bb300 100644
--- a/ld/testsuite/ld-elf/pr27128c.d
+++ b/ld/testsuite/ld-elf/pr27128c.d
@@ -4,8 +4,6 @@
 #target: [check_shared_lib_support]
 #notarget: [is_underscore_target]
 # _Zrm1XS_ doesn't have an extra underscore.
-#xfail: tic6x-*-*
-# tic6x DYN lacks dynamic sections for this testcase
 
 #...
 VERS_2\.0 +\|0+\| +A +\| +OBJECT\| +\| +\|\*ABS\*
diff --git a/ld/testsuite/ld-elf/pr27128d.d b/ld/testsuite/ld-elf/pr27128d.d
index 45d19729483..970dba22305 100644
--- a/ld/testsuite/ld-elf/pr27128d.d
+++ b/ld/testsuite/ld-elf/pr27128d.d
@@ -4,8 +4,8 @@
 #target: [check_shared_lib_support]
 #notarget: [is_underscore_target]
 # _Zrm1XS_ doesn't have an extra underscore.
-#xfail: hppa64-*-* tic6x-*-*
-# hppa64 uses dot-symbols, tic6x DYN lacks dynamic sections for this testcase
+#xfail: hppa64-*-*
+# hppa64 uses dot-symbols
 
 #...
 VERS_2\.0 +\|0+\| +A +\| +OBJECT\| +\| +\|\*ABS\*
diff --git a/ld/testsuite/ld-elf/pr27128e.d b/ld/testsuite/ld-elf/pr27128e.d
index 4263a059b57..5af787c6735 100644
--- a/ld/testsuite/ld-elf/pr27128e.d
+++ b/ld/testsuite/ld-elf/pr27128e.d
@@ -4,8 +4,8 @@
 #target: [check_shared_lib_support]
 #notarget: [is_underscore_target]
 # _Zrm1XS_ doesn't have an extra underscore.
-#xfail: hppa64-*-* tic6x-*-*
-# hppa64 uses dot-symbols, tic6x DYN lacks dynamic sections for this testcase
+#xfail: hppa64-*-*
+# hppa64 uses dot-symbols
 
 #...
 VERS_2\.0 A 0+


More information about the Binutils-cvs mailing list