PicoJava weak undefined symbols

Message ID 20190506022031.GM3195@bubble.grove.modra.org
State New
Headers show
Series
  • PicoJava weak undefined symbols
Related show

Commit Message

Alan Modra May 6, 2019, 2:20 a.m.
This fixes the recently added ld-elf/pr24511 test failure on pj-elf.
Incidentally, pj-elf has failed its gas "pj" test since 2005-12-22
(git commit 54758c3e39).  I think that makes the target ripe for
obsolescence.

bfd/
	* elf32-pj.c (pj_elf_reloc): Don't report undefined weak as an error.
ld/
	* testsuite/ld-undefined/weak-undef.exp: Don't xfail pj.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/bfd/elf32-pj.c b/bfd/elf32-pj.c
index 712b352e9d..c97d620c50 100644
--- a/bfd/elf32-pj.c
+++ b/bfd/elf32-pj.c
@@ -54,6 +54,7 @@  pj_elf_reloc (bfd *abfd,
     }
 
   if (symbol_in != NULL
+      && (symbol_in->flags & BSF_WEAK) == 0
       && bfd_is_und_section (symbol_in->section))
     return bfd_reloc_undefined;
 
diff --git a/ld/testsuite/ld-undefined/weak-undef.exp b/ld/testsuite/ld-undefined/weak-undef.exp
index 136c5dbcfe..73b6cf05b4 100644
--- a/ld/testsuite/ld-undefined/weak-undef.exp
+++ b/ld/testsuite/ld-undefined/weak-undef.exp
@@ -35,7 +35,6 @@  if { ![is_elf_format] && ![is_pecoff_format] } then {
     if {! [istarget i?86-*-*]} {
 	setup_xfail *-*-pe*
     }
-    setup_xfail pj-*-*
     fail $testname
 } elseif {![is_remote host] && [which $objdump] == 0} then {
     unresolved $testname