public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64
@ 2012-07-05 15:58 H.J. Lu
  2012-07-07 10:45 ` Alan Modra
  0 siblings, 1 reply; 18+ messages in thread
From: H.J. Lu @ 2012-07-05 15:58 UTC (permalink / raw)
  To: binutils

This patch fixes "-fpie -pie --unresolved-symbols=ignore-all" segfault
on Linux/ia64.  The original submission is at

http://sourceware.org/ml/binutils/2007-05/msg00129.html

I have been using this for several years.  OK to install?

Thanks.

H.J.
---
bfd/

2012-04-25  H.J. Lu  <hongjiu.lu@intel.com>

	* elf64-ia64-vms.c (elf64_ia64_relocate_section): Add an
	argument for error ignored.

2012-01-12  Bernhard Rosenkränzer <bernhard.rosenkranzer@linaro.org>

	* elf32-epiphany.c (epiphany_elf_relocate_section): Add an
	argument for error ignored.
	* elf32-rl78.c (rl78_elf_relocate_section): Likewise.
	* elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
	* elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
	
2010-07-01  H.J. Lu  <hongjiu.lu@intel.com>

	* elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Silence unused warning
	on ignored.

	* elf32-tic6x.c (elf32_tic6x_relocate_section): Add an argument for
	error ignored.
	
2007-07-03  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4409
	* elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add an argument for
	error ignored.
	* elf-m10200.c (mn10200_elf_relocate_section): Updated.
	* elf-m10300.c (mn10300_elf_relocate_section): Likewise.
	* elf32-arm.c (elf32_arm_relocate_section): Likewise.
	* elf32-avr.c (elf32_avr_relocate_section): Likewise.
	* elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
	(bfin_relocate_section): Likewise.
	* elf32-cr16.c (elf32_cr16_relocate_section): Likewise.
	* elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
	* elf32-cris.c (cris_elf_relocate_section): Likewise.
	* elf32-crx.c (elf32_crx_relocate_section): Likewise.
	* elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
	* elf32-fr30.c (fr30_elf_relocate_section): Likewise.
	* elf32-frv.c (elf32_frv_relocate_section): Likewise.
	* elf32-h8300.c (elf32_h8_relocate_section): Likewise.
	* elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
	* elf32-i386.c (elf_i386_relocate_section): Likewise.
	* elf32-i860.c (elf32_i860_relocate_section): Likewise.
	* elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
	* elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
	* elf32-lm32.c (lm32_elf_relocate_section): Likewise.
	* elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
	* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
	* elf32-microblaze.c (microblaze_elf_relocate_section): Likewise.
	* elf32-mcore.c (mcore_elf_relocate_section): Likewise.
	* elf32-mep.c (mep_elf_relocate_section): Likewise.
	* elf32-moxie.c (moxie_elf_relocate_section): Likewise.
	* elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
	* elf32-mt.c (mt_elf_relocate_section): Likewise.
	* elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
	* elf32-rx.c (rx_elf_relocate_section): Likewise.
	* elf32-s390.c (elf_s390_relocate_section): Likewise.
	* elf32-v850.c (v850_elf_relocate_section): Likewise.
	* elf32-vax.c (elf_vax_relocate_section): Likewise.
	* elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
	* elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
	* elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
	* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
	* elf64-mmix.c (mmix_elf_relocate_section): Likewise.
	* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
	* elf64-s390.c (elf_s390_relocate_section): Likewise.
	* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.

	* elfnn-ia64.c (elfNN_ia64_relocate_section): Skip if error
	from RELOC_FOR_GLOBAL_SYMBOL in executable is ignored.

ld/

2007-07-03  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4409
	* ldmain.c (how_to_report_unresolved_symbols): New.
	(main): Set link_info.unresolved_syms_in_objects and
	link_info.unresolved_syms_in_shared_libs if they aren't set
	yet.

	* ldmain.h (how_to_report_unresolved_symbols): New.

	* lexsup.c (how_to_report_unresolved_symbols): Removed.
	(parse_args): Set link_info.pie to FALSE for -shared. Don't
	set default values for link_info.unresolved_syms_in_objects nor
	link_info.unresolved_syms_in_shared_libs.

ld/testsuite/

2007-07-03  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4409
	* ld-ia64/error1.d: New file.
	* ld-ia64/error1.s: Likewise.
	* ld-ia64/error2.d: Likewise.
	* ld-ia64/error3.d: Likewise.
	* ld-ia64/error4.d: Likewise.

diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 4821eaf..f9caf61 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2342,7 +2342,7 @@ extern asection _bfd_elf_large_com_section;
 #define RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel,	\
 				r_symndx, symtab_hdr, sym_hashes,	\
 				h, sec, relocation,			\
-				unresolved_reloc, warned)		\
+				unresolved_reloc, warned, ignored)	\
   do									\
     {									\
       /* It seems this can happen with erroneous or unsupported		\
@@ -2357,6 +2357,7 @@ extern asection _bfd_elf_large_com_section;
 	h = (struct elf_link_hash_entry *) h->root.u.i.link;		\
 									\
       warned = FALSE;							\
+      ignored = FALSE;							\
       unresolved_reloc = FALSE;						\
       relocation = 0;							\
       if (h->root.type == bfd_link_hash_defined				\
@@ -2379,7 +2380,7 @@ extern asection _bfd_elf_large_com_section;
 	;								\
       else if (info->unresolved_syms_in_objects == RM_IGNORE		\
 	       && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)		\
-	;								\
+	ignored = TRUE;							\
       else if (!info->relocatable)					\
 	{								\
 	  bfd_boolean err;						\
@@ -2395,6 +2396,7 @@ extern asection _bfd_elf_large_com_section;
 	}								\
       (void) unresolved_reloc;						\
       (void) warned;							\
+      (void) ignored;							\
     }									\
   while (0)
 
diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c
index 4c6564b..d623abb 100644
--- a/bfd/elf-m10200.c
+++ b/bfd/elf-m10200.c
@@ -393,12 +393,12 @@ mn10200_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index adbb009..9b577cb 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -2013,7 +2013,7 @@ mn10300_elf_relocate_section (bfd *output_bfd,
       bfd_reloc_status_type r;
       int tls_r_type;
       bfd_boolean unresolved_reloc = FALSE;
-      bfd_boolean warned;
+      bfd_boolean warned, ignored;
       struct elf_link_hash_entry * hh;
 
       relocation = 0;
@@ -2036,7 +2036,7 @@ mn10300_elf_relocate_section (bfd *output_bfd,
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   hh, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
       h = elf_mn10300_hash_entry (hh);
 
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 9560906..58a26d2 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -10471,12 +10471,12 @@ elf32_arm_relocate_section (bfd *                  output_bfd,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  sym_type = h->type;
 	}
diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c
index 41ab3f6..0e80b6a 100644
--- a/bfd/elf32-avr.c
+++ b/bfd/elf32-avr.c
@@ -1180,12 +1180,12 @@ elf32_avr_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index e5d9401..285a91b 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -1436,12 +1436,12 @@ bfin_relocate_section (bfd * output_bfd,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
@@ -2655,13 +2655,13 @@ bfinfdpic_relocate_section (bfd * output_bfd,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  osec = sec;
 	}
 
diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c
index a162191..bf0cdbd 100644
--- a/bfd/elf32-cr16.c
+++ b/bfd/elf32-cr16.c
@@ -1423,12 +1423,12 @@ elf32_cr16_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
         }
       else
         {
-          bfd_boolean unresolved_reloc, warned;
+          bfd_boolean unresolved_reloc, warned, ignored;
 
           RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
                                    r_symndx, symtab_hdr, sym_hashes,
                                    h, sec, relocation,
-                                   unresolved_reloc, warned);
+                                   unresolved_reloc, warned, ignored);
         }
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-cr16c.c b/bfd/elf32-cr16c.c
index 9dcbdde..8020c9a 100644
--- a/bfd/elf32-cr16c.c
+++ b/bfd/elf32-cr16c.c
@@ -715,12 +715,12 @@ elf32_cr16c_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 370bf1a..27958af 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -1106,13 +1106,13 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  symname = h->root.root.string;
 
diff --git a/bfd/elf32-crx.c b/bfd/elf32-crx.c
index d36c0ea..a94ea87 100644
--- a/bfd/elf32-crx.c
+++ b/bfd/elf32-crx.c
@@ -865,12 +865,12 @@ elf32_crx_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c
index e0e93c8..c571dc8 100644
--- a/bfd/elf32-d10v.c
+++ b/bfd/elf32-d10v.c
@@ -455,12 +455,12 @@ elf32_d10v_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-epiphany.c b/bfd/elf32-epiphany.c
index 7330204..70c907e 100644
--- a/bfd/elf32-epiphany.c
+++ b/bfd/elf32-epiphany.c
@@ -515,11 +515,12 @@ epiphany_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	{
 	  bfd_boolean warned ATTRIBUTE_UNUSED;
 	  bfd_boolean unresolved_reloc ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c
index 462e51b..cff5c50 100644
--- a/bfd/elf32-fr30.c
+++ b/bfd/elf32-fr30.c
@@ -568,12 +568,12 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
index 57de3c0..95a25a3 100644
--- a/bfd/elf32-frv.c
+++ b/bfd/elf32-frv.c
@@ -2801,13 +2801,13 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  osec = sec;
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c
index 28fab32..4b6c79b 100644
--- a/bfd/elf32-h8300.c
+++ b/bfd/elf32-h8300.c
@@ -452,12 +452,12 @@ elf32_h8_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 82a0db6..d6c16d4 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -3706,13 +3706,14 @@ elf32_hppa_relocate_section (bfd *output_bfd,
       else
 	{
 	  struct elf_link_hash_entry *eh;
-	  bfd_boolean unresolved_reloc;
+	  bfd_boolean unresolved_reloc, ignored;
 	  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rela,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   eh, sym_sec, relocation,
-				   unresolved_reloc, warned_undef);
+				   unresolved_reloc, warned_undef,
+				   ignored);
 
 	  if (!info->relocatable
 	      && relocation == 0
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 832ad89..44a48ad 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -3183,11 +3183,12 @@ elf_i386_relocate_section (bfd *output_bfd,
       else
 	{
 	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-i860.c b/bfd/elf32-i860.c
index b890384..875a6a0 100644
--- a/bfd/elf32-i860.c
+++ b/bfd/elf32-i860.c
@@ -1121,12 +1121,12 @@ elf32_i860_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c
index fe94615..35485e2 100644
--- a/bfd/elf32-ip2k.c
+++ b/bfd/elf32-ip2k.c
@@ -1425,13 +1425,13 @@ ip2k_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c
index fd3b263..247e99a 100644
--- a/bfd/elf32-iq2000.c
+++ b/bfd/elf32-iq2000.c
@@ -623,12 +623,12 @@ iq2000_elf_relocate_section (bfd *		     output_bfd ATTRIBUTE_UNUSED,
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c
index bd560e1..d94ae9f 100644
--- a/bfd/elf32-lm32.c
+++ b/bfd/elf32-lm32.c
@@ -884,12 +884,12 @@ lm32_elf_relocate_section (bfd *output_bfd,
         {
           /* It's a global symbol.  */
           bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  name = h->root.root.string;
         }
 
diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c
index f1d4586..30dcbdf 100644
--- a/bfd/elf32-m68hc1x.c
+++ b/bfd/elf32-m68hc1x.c
@@ -974,12 +974,12 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation, unresolved_reloc,
-				   warned);
+				   warned, ignored);
 
 	  is_far = (h && (h->other & STO_M68HC12_FAR));
 	}
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 47dece2..9cc4f9d 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -3702,12 +3702,12 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c
index c0769a8..c22722f 100644
--- a/bfd/elf32-mcore.c
+++ b/bfd/elf32-mcore.c
@@ -458,12 +458,12 @@ mcore_elf_relocate_section (bfd * output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-mep.c b/bfd/elf32-mep.c
index 9c53f3d..ce949e7 100644
--- a/bfd/elf32-mep.c
+++ b/bfd/elf32-mep.c
@@ -490,12 +490,12 @@ mep_elf_relocate_section
 	}
       else
 	{
-	  bfd_boolean warned, unresolved_reloc;
+	  bfd_boolean warned, unresolved_reloc, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel,
 				  r_symndx, symtab_hdr, sym_hashes,
 				  h, sec, relocation,
-				  unresolved_reloc, warned);
+				  unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
index a58f7b3..9e22dee 100644
--- a/bfd/elf32-microblaze.c
+++ b/bfd/elf32-microblaze.c
@@ -815,11 +815,12 @@ microblaze_elf_relocate_section (bfd *output_bfd,
 	    {
 	      /* External symbol.  */
 	      bfd_boolean warned ATTRIBUTE_UNUSED;
+	      bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	      RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				       r_symndx, symtab_hdr, sym_hashes,
 				       h, sec, relocation,
-				       unresolved_reloc, warned);
+				       unresolved_reloc, warned, ignored);
 	      sym_name = h->root.root.string;
 	    }
 
diff --git a/bfd/elf32-moxie.c b/bfd/elf32-moxie.c
index bc1d4c7..6dd69b7 100644
--- a/bfd/elf32-moxie.c
+++ b/bfd/elf32-moxie.c
@@ -240,12 +240,12 @@ moxie_elf_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c
index c79c474..1fde2d4 100644
--- a/bfd/elf32-msp430.c
+++ b/bfd/elf32-msp430.c
@@ -446,12 +446,12 @@ elf32_msp430_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-mt.c b/bfd/elf32-mt.c
index 7d18774..8a1238c 100644
--- a/bfd/elf32-mt.c
+++ b/bfd/elf32-mt.c
@@ -344,12 +344,12 @@ mt_elf_relocate_section
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-openrisc.c b/bfd/elf32-openrisc.c
index 1c9e14a..a01aeaa 100644
--- a/bfd/elf32-openrisc.c
+++ b/bfd/elf32-openrisc.c
@@ -365,12 +365,12 @@ openrisc_elf_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index ca6df26..518ddf2 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -6871,10 +6871,12 @@ ppc_elf_relocate_section (bfd *output_bfd,
 	}
       else
 	{
+	  bfd_boolean ignored;
+
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  sym_name = h->root.root.string;
 	}
diff --git a/bfd/elf32-rl78.c b/bfd/elf32-rl78.c
index 2806cd3..97e28a6 100644
--- a/bfd/elf32-rl78.c
+++ b/bfd/elf32-rl78.c
@@ -461,12 +461,13 @@ rl78_elf_relocate_section
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes, h,
 				   sec, relocation, unresolved_reloc,
-				   warned);
+				   warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c
index 942d4e0..d281a6f 100644
--- a/bfd/elf32-rx.c
+++ b/bfd/elf32-rx.c
@@ -511,12 +511,12 @@ rx_elf_relocate_section
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes, h,
 				   sec, relocation, unresolved_reloc,
-				   warned);
+				   warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 4b2b380..cba61d1 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -2293,11 +2293,12 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
       else
 	{
 	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
index 4d7f923..80bbce5 100644
--- a/bfd/elf32-tic6x.c
+++ b/bfd/elf32-tic6x.c
@@ -2319,12 +2319,12 @@ elf32_tic6x_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-tilepro.c b/bfd/elf32-tilepro.c
index 23073c1..764dc01 100644
--- a/bfd/elf32-tilepro.c
+++ b/bfd/elf32-tilepro.c
@@ -2856,12 +2856,13 @@ tilepro_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  if (warned)
 	    {
 	      /* To avoid generating warning messages about truncated
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index 236a0b2..a517cf9 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -2074,7 +2074,7 @@ v850_elf_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  /* Note - this check is delayed until now as it is possible and
 	     valid to have a file without any symbols but with relocs that
@@ -2091,7 +2091,7 @@ v850_elf_relocate_section (bfd *output_bfd,
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c
index f1b5d76..9f4574c 100644
--- a/bfd/elf32-vax.c
+++ b/bfd/elf32-vax.c
@@ -1403,12 +1403,12 @@ elf_vax_relocate_section (bfd *output_bfd,
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if ((h->root.type == bfd_link_hash_defined
 	      || h->root.type == bfd_link_hash_defweak)
diff --git a/bfd/elf32-xc16x.c b/bfd/elf32-xc16x.c
index dc8cab5..c969972 100644
--- a/bfd/elf32-xc16x.c
+++ b/bfd/elf32-xc16x.c
@@ -373,12 +373,12 @@ elf32_xc16x_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c
index 57445ba..d6c1399 100644
--- a/bfd/elf32-xstormy16.c
+++ b/bfd/elf32-xstormy16.c
@@ -817,12 +817,12 @@ xstormy16_elf_relocate_section (bfd *                   output_bfd ATTRIBUTE_UNU
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index cfbdff0..ab59e07 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -2643,10 +2643,12 @@ elf_xtensa_relocate_section (bfd *output_bfd,
 	}
       else
 	{
+	  bfd_boolean ignored;
+
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (relocation == 0
 	      && !unresolved_reloc
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index 495b601..2bd8fa9 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -4295,14 +4295,14 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  struct elf_link_hash_entry *hh;
 	  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   hh, sec, value,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (warned)
 	    continue;
diff --git a/bfd/elf64-ia64-vms.c b/bfd/elf64-ia64-vms.c
index 9c2cb4c..a3ce905 100644
--- a/bfd/elf64-ia64-vms.c
+++ b/bfd/elf64-ia64-vms.c
@@ -3489,13 +3489,13 @@ elf64_ia64_relocate_section (bfd *output_bfd,
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sym_sec, value,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (h->root.type == bfd_link_hash_undefweak)
 	    undef_weak_ref = TRUE;
diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c
index fd5921a..bf4625b 100644
--- a/bfd/elf64-mmix.c
+++ b/bfd/elf64-mmix.c
@@ -1467,12 +1467,13 @@ mmix_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc;
+	  bfd_boolean unresolved_reloc, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, undefined_signalled);
+				   unresolved_reloc, undefined_signalled,
+				   ignored);
 	  name = h->root.root.string;
 	}
 
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 0d6dd99..e910c46 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -12264,10 +12264,12 @@ ppc64_elf_relocate_section (bfd *output_bfd,
 	}
       else
 	{
+	  bfd_boolean ignored;
+
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h_elf, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  sym_name = h_elf->root.root.string;
 	  sym_type = h_elf->type;
 	}
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index c3ec24c..67fce07 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -2237,11 +2237,12 @@ elf_s390_relocate_section (bfd *output_bfd,
       else
 	{
 	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index e913246..23f1737 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -3136,11 +3136,12 @@ elf_x86_64_relocate_section (bfd *output_bfd,
       else
 	{
 	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c
index a1294ff..abae85a 100644
--- a/bfd/elfnn-ia64.c
+++ b/bfd/elfnn-ia64.c
@@ -3897,17 +3897,17 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sym_sec, value,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (h->root.type == bfd_link_hash_undefweak)
 	    undef_weak_ref = TRUE;
-	  else if (warned)
+	  else if (warned || (ignored && info->executable))
 	    continue;
 	}
 
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index 9a0a1a4..f068a1d 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -2993,12 +2993,12 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  if (warned)
 	    {
 	      /* To avoid generating warning messages about truncated
diff --git a/bfd/elfxx-tilegx.c b/bfd/elfxx-tilegx.c
index d87edf5..cd091a7 100644
--- a/bfd/elfxx-tilegx.c
+++ b/bfd/elfxx-tilegx.c
@@ -3122,12 +3122,13 @@ tilegx_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  if (warned)
 	    {
 	      /* To avoid generating warning messages about truncated
diff --git a/ld/lexsup.c b/ld/lexsup.c
index ea34104..15b1856 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -1192,12 +1192,7 @@ parse_args (unsigned argc, char **argv)
 	  if (config.has_shared)
 	    {
 	      link_info.shared = TRUE;
-	      /* When creating a shared library, the default
-		 behaviour is to ignore any unresolved references.  */
-	      if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
-		link_info.unresolved_syms_in_objects = RM_IGNORE;
-	      if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
-		link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
+	      link_info.pie = FALSE;
 	    }
 	  else
 	    einfo (_("%P%F: -shared not supported\n"));
@@ -1552,14 +1547,6 @@ parse_args (unsigned argc, char **argv)
       free (default_dirlist);
     }
 
-  if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
-    /* FIXME: Should we allow emulations a chance to set this ?  */
-    link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols;
-
-  if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
-    /* FIXME: Should we allow emulations a chance to set this ?  */
-    link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols;
-
   if (link_info.relocatable)
     {
       if (command_line.check_section_addresses < 0)
@@ -1616,6 +1603,27 @@ parse_args (unsigned argc, char **argv)
   if (! link_info.shared || link_info.pie)
     link_info.executable = TRUE;
 
+  /* When creating a shared library, the default behaviour is to
+     ignore any unresolved references.  */
+
+  if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
+    {
+      if (link_info.shared && !link_info.pie)
+	link_info.unresolved_syms_in_objects = RM_IGNORE;
+      else
+	link_info.unresolved_syms_in_objects
+	  = how_to_report_unresolved_symbols;
+    }
+
+  if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
+    {
+      if (link_info.shared && !link_info.pie)
+	link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
+      else
+	link_info.unresolved_syms_in_shared_libs
+	  = how_to_report_unresolved_symbols;
+    }
+
   /* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols).  I
      don't see how else this can be handled, since in this case we
      must preserve all externally visible symbols.  */
diff --git a/ld/testsuite/ld-ia64/error1.d b/ld/testsuite/ld-ia64/error1.d
new file mode 100644
index 0000000..82142b6
--- /dev/null
+++ b/ld/testsuite/ld-ia64/error1.d
@@ -0,0 +1,7 @@
+#source: error1.s
+#ld: -unresolved-symbols=ignore-all
+#readelf: -s
+
+#...
+[ 	]+[0-9]+:[ 	]+[0]+[ 	]+0[ 	]+NOTYPE[ 	]+GLOBAL DEFAULT[ 	]+UND[ 	]+foo
+#pass
diff --git a/ld/testsuite/ld-ia64/error1.s b/ld/testsuite/ld-ia64/error1.s
new file mode 100644
index 0000000..fd48eae
--- /dev/null
+++ b/ld/testsuite/ld-ia64/error1.s
@@ -0,0 +1,30 @@
+	.explicit
+	.pred.safe_across_calls p1-p5,p16-p63
+	.text
+	.align 16
+	.global _start#
+	.proc _start#
+_start:
+	.prologue 12, 32
+	.mii
+	.save ar.pfs, r33
+	alloc r33 = ar.pfs, 0, 3, 0, 0
+	.save rp, r32
+	mov r32 = b0
+	mov r34 = r1
+	.body
+	;;
+	.bbb
+	nop 0
+	nop 0
+	br.call.sptk.many b0 = foo#
+	;;
+	.mmi
+	nop 0
+	mov r1 = r34
+	mov b0 = r32
+	.mib
+	nop 0
+	mov ar.pfs = r33
+	br.ret.sptk.many b0
+	.endp _start#
diff --git a/ld/testsuite/ld-ia64/error2.d b/ld/testsuite/ld-ia64/error2.d
new file mode 100644
index 0000000..764ba66
--- /dev/null
+++ b/ld/testsuite/ld-ia64/error2.d
@@ -0,0 +1,7 @@
+#source: error1.s
+#ld: -pie -unresolved-symbols=ignore-all
+#readelf: -s
+
+#...
+[ 	]+[0-9]+:[ 	]+[0]+[ 	]+0[ 	]+NOTYPE[ 	]+GLOBAL DEFAULT[ 	]+UND[ 	]+foo
+#pass
diff --git a/ld/testsuite/ld-ia64/error3.d b/ld/testsuite/ld-ia64/error3.d
new file mode 100644
index 0000000..e14d451
--- /dev/null
+++ b/ld/testsuite/ld-ia64/error3.d
@@ -0,0 +1,7 @@
+#source: error1.s
+#ld: -pie -shared
+#readelf: -s
+
+#...
+[ 	]+[0-9]+:[ 	]+[0]+[ 	]+0[ 	]+NOTYPE[ 	]+GLOBAL DEFAULT[ 	]+UND[ 	]+foo
+#pass
diff --git a/ld/testsuite/ld-ia64/error4.d b/ld/testsuite/ld-ia64/error4.d
new file mode 100644
index 0000000..881e671
--- /dev/null
+++ b/ld/testsuite/ld-ia64/error4.d
@@ -0,0 +1,3 @@
+#source: error1.s
+#ld: -shared -pie
+#error: .*undefined reference to `foo'
Reply-To: "H.J. Lu" <hjl.tools@gmail.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64
  2012-07-05 15:58 PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64 H.J. Lu
@ 2012-07-07 10:45 ` Alan Modra
  2012-07-07 12:19   ` H.J. Lu
  0 siblings, 1 reply; 18+ messages in thread
From: Alan Modra @ 2012-07-07 10:45 UTC (permalink / raw)
  To: H.J. Lu; +Cc: binutils

On Thu, Jul 05, 2012 at 08:57:37AM -0700, H.J. Lu wrote:
> This patch fixes "-fpie -pie --unresolved-symbols=ignore-all" segfault
> on Linux/ia64.  The original submission is at
> 
> http://sourceware.org/ml/binutils/2007-05/msg00129.html
> 
> I have been using this for several years.  OK to install?

The change to lexsup.c is OK, but you need to fix your changelog.

For the ia64 change, please ping Jim Wilson.  As the listed ia64
maintainer and a blanket write committer, he ought to be the best
person to review that part of your patch.  I'm not at all concerned
about whether you change RELOC_FOR_GLOBAL_SYMBOL, or whether you make
a different change local to the ia64 backend.  What I am concerned
about is whether your change to elfxx-ia64.c is correct for all
relocation types.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64
  2012-07-07 10:45 ` Alan Modra
@ 2012-07-07 12:19   ` H.J. Lu
  2012-07-17 17:49     ` Jim Wilson
  0 siblings, 1 reply; 18+ messages in thread
From: H.J. Lu @ 2012-07-07 12:19 UTC (permalink / raw)
  To: Binutils, Jim Wilson

On Sat, Jul 7, 2012 at 3:45 AM, Alan Modra <amodra@gmail.com> wrote:
> On Thu, Jul 05, 2012 at 08:57:37AM -0700, H.J. Lu wrote:
>> This patch fixes "-fpie -pie --unresolved-symbols=ignore-all" segfault
>> on Linux/ia64.  The original submission is at
>>
>> http://sourceware.org/ml/binutils/2007-05/msg00129.html
>>
>> I have been using this for several years.  OK to install?
>
> The change to lexsup.c is OK, but you need to fix your changelog.
>
> For the ia64 change, please ping Jim Wilson.  As the listed ia64
> maintainer and a blanket write committer, he ought to be the best
> person to review that part of your patch.  I'm not at all concerned
> about whether you change RELOC_FOR_GLOBAL_SYMBOL, or whether you make
> a different change local to the ia64 backend.  What I am concerned
> about is whether your change to elfxx-ia64.c is correct for all
> relocation types.
>

Hi Jim,

Can you review this patch?

http://sourceware.org/ml/binutils/2012-07/msg00065.html

Thanks.


-- 
H.J.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64
  2012-07-07 12:19   ` H.J. Lu
@ 2012-07-17 17:49     ` Jim Wilson
  2012-07-17 19:23       ` H.J. Lu
  0 siblings, 1 reply; 18+ messages in thread
From: Jim Wilson @ 2012-07-17 17:49 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Binutils

On Sat, 2012-07-07 at 05:18 -0700, H.J. Lu wrote:
> Hi Jim,
> Can you review this patch?
> http://sourceware.org/ml/binutils/2012-07/msg00065.html

I've been out of the office for two weeks.  I took a quick look, and I
see that you are trying to handle ia64 differently from everything else,
which looks odd.  I would want to understand why you are doing that.
Unfortunately, I don't have access to an ia64 machine at the moment, and
can't easily build a linux cross compiler without a sysroot, so I don't
have a way to reproduce the problem at the moment.  I'm also a bit over
worked trying to catch up on my work backlog, and it may take me some
time before I can look at this.

Jim


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64
  2012-07-17 17:49     ` Jim Wilson
@ 2012-07-17 19:23       ` H.J. Lu
  0 siblings, 0 replies; 18+ messages in thread
From: H.J. Lu @ 2012-07-17 19:23 UTC (permalink / raw)
  To: Jim Wilson; +Cc: Binutils

On Tue, Jul 17, 2012 at 10:54 AM, Jim Wilson <wilson@tuliptree.org> wrote:
> On Sat, 2012-07-07 at 05:18 -0700, H.J. Lu wrote:
>> Hi Jim,
>> Can you review this patch?
>> http://sourceware.org/ml/binutils/2012-07/msg00065.html
>
> I've been out of the office for two weeks.  I took a quick look, and I
> see that you are trying to handle ia64 differently from everything else,
> which looks odd.  I would want to understand why you are doing that.

With --unresolved-symbols=ignore-all, ia64 linker keeps going when
seeing an unresolved symbol, which leads to segfault when checking
PLT entry.

> Unfortunately, I don't have access to an ia64 machine at the moment, and
> can't easily build a linux cross compiler without a sysroot, so I don't
> have a way to reproduce the problem at the moment.  I'm also a bit over
> worked trying to catch up on my work backlog, and it may take me some
> time before I can look at this.
>

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64
@ 2013-11-05 17:05 H.J. Lu
  0 siblings, 0 replies; 18+ messages in thread
From: H.J. Lu @ 2013-11-05 17:05 UTC (permalink / raw)
  To: binutils

Hi,

This is a very old patch.  IA64 backend crashes when there are
unresolved relocations when building an executable.  This patch adds
an argument to RELOC_FOR_GLOBAL_SYMBOL to tell the backend that an
unresolved relocation is ignored.  IA64 backend uses this information
to skip the ignored unresolved relocation when building an executable to
avoid crash.  It is OK to do so since ia64 backend can't generate
working executable anyway when there is an unresolved relocation.  This
patch has no functional impact on other backend.  I will check it
in shortly.

Thanks.


H.J.
---
bfd/

2013-11-05  H.J. Lu  <hongjiu.lu@intel.com>
	    Bernhard Rosenkränzer <bernhard.rosenkranzer@linaro.org>

	PR ld/4409
	* elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add an argument for
	error ignored.
	* elf-m10200.c (mn10200_elf_relocate_section): Updated.
	* elf-m10300.c (mn10300_elf_relocate_section): Likewise.
	* elf32-arm.c (elf32_arm_relocate_section): Likewise.
	* elf32-avr.c (elf32_avr_relocate_section): Likewise.
	* elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
	(bfin_relocate_section): Likewise.
	* elf32-cr16.c (elf32_cr16_relocate_section): Likewise.
	* elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
	* elf32-cris.c (cris_elf_relocate_section): Likewise.
	* elf32-crx.c (elf32_crx_relocate_section): Likewise.
	* elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
	* elf32-epiphany.c (epiphany_elf_relocate_section): Likewise.
	* elf32-fr30.c (fr30_elf_relocate_section): Likewise.
	* elf32-frv.c (elf32_frv_relocate_section): Likewise.
	* elf32-h8300.c (elf32_h8_relocate_section): Likewise.
	* elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
	* elf32-i386.c (elf_i386_relocate_section): Likewise.
	* elf32-i860.c (elf32_i860_relocate_section): Likewise.
	* elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
	* elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
	* elf32-lm32.c (lm32_elf_relocate_section): Likewise.
	* elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
	* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
	* elf32-metag.c (elf_metag_relocate_section): Likewise.
	* elf32-microblaze.c (microblaze_elf_relocate_section): Likewise.
	* elf32-mcore.c (mcore_elf_relocate_section): Likewise.
	* elf32-mep.c (mep_elf_relocate_section): Likewise.
	* elf32-moxie.c (moxie_elf_relocate_section): Likewise.
	* elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
	* elf32-mt.c (mt_elf_relocate_section): Likewise.
	* elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
	* elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
	* elf32-rl78.c (rl78_elf_relocate_section): Likewise.
	* elf32-rx.c (rx_elf_relocate_section): Likewise.
	* elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
	* elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
	* elf32-s390.c (elf_s390_relocate_section): Likewise.
	* elf32-v850.c (v850_elf_relocate_section): Likewise.
	* elf32-vax.c (elf_vax_relocate_section): Likewise.
	* elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
	* elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
	* elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
	* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
	* elf64-ia64-vms.c (elf64_ia64_relocate_section): Likewise.
	* elf64-mmix.c (mmix_elf_relocate_section): Likewise.
	* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
	* elf64-s390.c (elf_s390_relocate_section): Likewise.
	* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
	* elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
	* elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.

	* elfnn-ia64.c (elfNN_ia64_relocate_section): Skip if error
	from RELOC_FOR_GLOBAL_SYMBOL in executable is ignored.

ld/testsuite/

2013-11-05  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4409
	* ld-ia64/error1.d: New file.
	* ld-ia64/error1.s: Likewise.
	* ld-ia64/error2.d: Likewise.
	* ld-ia64/error3.d: Likewise.
	* ld-ia64/error4.d: Likewise.

diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index add80b3..15dab94 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2414,7 +2414,7 @@ extern asection _bfd_elf_large_com_section;
 #define RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel,	\
 				r_symndx, symtab_hdr, sym_hashes,	\
 				h, sec, relocation,			\
-				unresolved_reloc, warned)		\
+				unresolved_reloc, warned, ignored)	\
   do									\
     {									\
       /* It seems this can happen with erroneous or unsupported		\
@@ -2429,6 +2429,7 @@ extern asection _bfd_elf_large_com_section;
 	h = (struct elf_link_hash_entry *) h->root.u.i.link;		\
 									\
       warned = FALSE;							\
+      ignored = FALSE;							\
       unresolved_reloc = FALSE;						\
       relocation = 0;							\
       if (h->root.type == bfd_link_hash_defined				\
@@ -2451,7 +2452,7 @@ extern asection _bfd_elf_large_com_section;
 	;								\
       else if (info->unresolved_syms_in_objects == RM_IGNORE		\
 	       && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)		\
-	;								\
+	ignored = TRUE;							\
       else if (!info->relocatable)					\
 	{								\
 	  bfd_boolean err;						\
@@ -2467,6 +2468,7 @@ extern asection _bfd_elf_large_com_section;
 	}								\
       (void) unresolved_reloc;						\
       (void) warned;							\
+      (void) ignored;							\
     }									\
   while (0)
 
diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c
index f427f97..a7553f3 100644
--- a/bfd/elf-m10200.c
+++ b/bfd/elf-m10200.c
@@ -373,12 +373,12 @@ mn10200_elf_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index c0a9309..bc3700d 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -2011,7 +2011,7 @@ mn10300_elf_relocate_section (bfd *output_bfd,
       bfd_reloc_status_type r;
       int tls_r_type;
       bfd_boolean unresolved_reloc = FALSE;
-      bfd_boolean warned;
+      bfd_boolean warned, ignored;
       struct elf_link_hash_entry * hh;
 
       relocation = 0;
@@ -2034,7 +2034,7 @@ mn10300_elf_relocate_section (bfd *output_bfd,
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   hh, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
       h = elf_mn10300_hash_entry (hh);
 
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 5af1643..e9c0d20 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -10510,12 +10510,12 @@ elf32_arm_relocate_section (bfd *                  output_bfd,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  sym_type = h->type;
 	}
diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c
index 43100cd..b54b67f 100644
--- a/bfd/elf32-avr.c
+++ b/bfd/elf32-avr.c
@@ -1214,12 +1214,12 @@ elf32_avr_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index d3d0f1c..73d0d09 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -1444,12 +1444,12 @@ bfin_relocate_section (bfd * output_bfd,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
@@ -2662,13 +2662,13 @@ bfinfdpic_relocate_section (bfd * output_bfd,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  osec = sec;
 	}
 
diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c
index 8ed5af1..af1cf7b 100644
--- a/bfd/elf32-cr16.c
+++ b/bfd/elf32-cr16.c
@@ -1425,12 +1425,12 @@ elf32_cr16_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
         }
       else
         {
-          bfd_boolean unresolved_reloc, warned;
+          bfd_boolean unresolved_reloc, warned, ignored;
 
           RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
                                    r_symndx, symtab_hdr, sym_hashes,
                                    h, sec, relocation,
-                                   unresolved_reloc, warned);
+                                   unresolved_reloc, warned, ignored);
         }
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-cr16c.c b/bfd/elf32-cr16c.c
index 4231a42..27d8f80 100644
--- a/bfd/elf32-cr16c.c
+++ b/bfd/elf32-cr16c.c
@@ -715,12 +715,12 @@ elf32_cr16c_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index f35292e..ab79151 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -1040,13 +1040,13 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  symname = h->root.root.string;
 
diff --git a/bfd/elf32-crx.c b/bfd/elf32-crx.c
index 601f715..f26c01e 100644
--- a/bfd/elf32-crx.c
+++ b/bfd/elf32-crx.c
@@ -865,12 +865,12 @@ elf32_crx_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c
index f75c16a..7963bba 100644
--- a/bfd/elf32-d10v.c
+++ b/bfd/elf32-d10v.c
@@ -459,12 +459,12 @@ elf32_d10v_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-epiphany.c b/bfd/elf32-epiphany.c
index b427ef3..f796a67 100644
--- a/bfd/elf32-epiphany.c
+++ b/bfd/elf32-epiphany.c
@@ -515,11 +515,12 @@ epiphany_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	{
 	  bfd_boolean warned ATTRIBUTE_UNUSED;
 	  bfd_boolean unresolved_reloc ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c
index 3aed435..a6ffda3 100644
--- a/bfd/elf32-fr30.c
+++ b/bfd/elf32-fr30.c
@@ -547,12 +547,12 @@ fr30_elf_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
index 788c299..cf187ac 100644
--- a/bfd/elf32-frv.c
+++ b/bfd/elf32-frv.c
@@ -2735,13 +2735,13 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  osec = sec;
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c
index 67bca3f..822d985 100644
--- a/bfd/elf32-h8300.c
+++ b/bfd/elf32-h8300.c
@@ -468,12 +468,12 @@ elf32_h8_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index dfffbcb..7d1725f 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -3690,13 +3690,14 @@ elf32_hppa_relocate_section (bfd *output_bfd,
       else
 	{
 	  struct elf_link_hash_entry *eh;
-	  bfd_boolean unresolved_reloc;
+	  bfd_boolean unresolved_reloc, ignored;
 	  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rela,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   eh, sym_sec, relocation,
-				   unresolved_reloc, warned_undef);
+				   unresolved_reloc, warned_undef,
+				   ignored);
 
 	  if (!info->relocatable
 	      && relocation == 0
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 560e05c..070e4c4 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -3311,11 +3311,12 @@ elf_i386_relocate_section (bfd *output_bfd,
       else
 	{
 	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  st_size = h->size;
 	}
 
diff --git a/bfd/elf32-i860.c b/bfd/elf32-i860.c
index c7991bd..5440c8b 100644
--- a/bfd/elf32-i860.c
+++ b/bfd/elf32-i860.c
@@ -1121,12 +1121,12 @@ elf32_i860_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c
index 3bbad14..2ee907c 100644
--- a/bfd/elf32-ip2k.c
+++ b/bfd/elf32-ip2k.c
@@ -1425,13 +1425,13 @@ ip2k_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c
index 3a90a99..ff7ef4a 100644
--- a/bfd/elf32-iq2000.c
+++ b/bfd/elf32-iq2000.c
@@ -627,12 +627,12 @@ iq2000_elf_relocate_section (bfd *		     output_bfd ATTRIBUTE_UNUSED,
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c
index df6f346..4ebe534 100644
--- a/bfd/elf32-lm32.c
+++ b/bfd/elf32-lm32.c
@@ -875,12 +875,12 @@ lm32_elf_relocate_section (bfd *output_bfd,
         {
           /* It's a global symbol.  */
           bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  name = h->root.root.string;
         }
 
diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c
index 427e3cd..f5f68bc 100644
--- a/bfd/elf32-m68hc1x.c
+++ b/bfd/elf32-m68hc1x.c
@@ -979,12 +979,12 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation, unresolved_reloc,
-				   warned);
+				   warned, ignored);
 
 	  is_far = (h && (h->other & STO_M68HC12_FAR));
 	  is_xgate_symbol = (h && (h->target_internal));
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index f266d63..d8e3be1 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -3669,12 +3669,12 @@ elf_m68k_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c
index 28ee2c4..8eb74c5 100644
--- a/bfd/elf32-mcore.c
+++ b/bfd/elf32-mcore.c
@@ -458,12 +458,12 @@ mcore_elf_relocate_section (bfd * output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-mep.c b/bfd/elf32-mep.c
index f356fd0..2204488 100644
--- a/bfd/elf32-mep.c
+++ b/bfd/elf32-mep.c
@@ -490,12 +490,12 @@ mep_elf_relocate_section
 	}
       else
 	{
-	  bfd_boolean warned, unresolved_reloc;
+	  bfd_boolean warned, unresolved_reloc, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel,
 				  r_symndx, symtab_hdr, sym_hashes,
 				  h, sec, relocation,
-				  unresolved_reloc, warned);
+				  unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-metag.c b/bfd/elf32-metag.c
index 8851845..9c11dd3 100644
--- a/bfd/elf32-metag.c
+++ b/bfd/elf32-metag.c
@@ -1536,12 +1536,12 @@ elf_metag_relocate_section (bfd *output_bfd,
       else
 	{
 	  struct elf_link_hash_entry *eh;
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, eh_syms,
 				   eh, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = eh->root.root.string;
 	  hh = (struct elf_metag_link_hash_entry *) eh;
diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
index 4a5e80d..d936c42 100644
--- a/bfd/elf32-microblaze.c
+++ b/bfd/elf32-microblaze.c
@@ -1023,11 +1023,12 @@ microblaze_elf_relocate_section (bfd *output_bfd,
 	    {
 	      /* External symbol.  */
 	      bfd_boolean warned ATTRIBUTE_UNUSED;
+	      bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	      RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				       r_symndx, symtab_hdr, sym_hashes,
 				       h, sec, relocation,
-				       unresolved_reloc, warned);
+				       unresolved_reloc, warned, ignored);
 	      sym_name = h->root.root.string;
 	    }
 
diff --git a/bfd/elf32-moxie.c b/bfd/elf32-moxie.c
index d0cbb0f..a2215db 100644
--- a/bfd/elf32-moxie.c
+++ b/bfd/elf32-moxie.c
@@ -240,12 +240,12 @@ moxie_elf_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c
index 2f7a3da..533eea3 100644
--- a/bfd/elf32-msp430.c
+++ b/bfd/elf32-msp430.c
@@ -1276,12 +1276,12 @@ elf32_msp430_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  name = h->root.root.string;
 	}
 
diff --git a/bfd/elf32-mt.c b/bfd/elf32-mt.c
index ea05c91..597665c 100644
--- a/bfd/elf32-mt.c
+++ b/bfd/elf32-mt.c
@@ -344,12 +344,12 @@ mt_elf_relocate_section
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
index ba89b94..82e5516 100644
--- a/bfd/elf32-nios2.c
+++ b/bfd/elf32-nios2.c
@@ -1717,12 +1717,12 @@ nios2_elf32_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec && discarded_section (sec))
diff --git a/bfd/elf32-openrisc.c b/bfd/elf32-openrisc.c
index 7abc938..496d263 100644
--- a/bfd/elf32-openrisc.c
+++ b/bfd/elf32-openrisc.c
@@ -365,12 +365,12 @@ openrisc_elf_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 63928dc..47c92ba 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -7493,10 +7493,12 @@ ppc_elf_relocate_section (bfd *output_bfd,
 	}
       else
 	{
+	  bfd_boolean ignored;
+
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  sym_name = h->root.root.string;
 	}
diff --git a/bfd/elf32-rl78.c b/bfd/elf32-rl78.c
index a8ee414..9060663 100644
--- a/bfd/elf32-rl78.c
+++ b/bfd/elf32-rl78.c
@@ -460,12 +460,13 @@ rl78_elf_relocate_section
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes, h,
 				   sec, relocation, unresolved_reloc,
-				   warned);
+				   warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c
index af84e08..a1f29eb 100644
--- a/bfd/elf32-rx.c
+++ b/bfd/elf32-rx.c
@@ -510,12 +510,12 @@ rx_elf_relocate_section
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes, h,
 				   sec, relocation, unresolved_reloc,
-				   warned);
+				   warned, ignored);
 
 	  name = h->root.root.string;
 	}
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 6467b03..9827d46 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -2415,11 +2415,12 @@ elf_s390_relocate_section (bfd *output_bfd,
       else
 	{
 	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
index 7ac6325..92726b2 100644
--- a/bfd/elf32-tic6x.c
+++ b/bfd/elf32-tic6x.c
@@ -2309,12 +2309,12 @@ elf32_tic6x_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-tilepro.c b/bfd/elf32-tilepro.c
index c36da2b..0e808c4 100644
--- a/bfd/elf32-tilepro.c
+++ b/bfd/elf32-tilepro.c
@@ -2892,12 +2892,13 @@ tilepro_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  if (warned)
 	    {
 	      /* To avoid generating warning messages about truncated
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index 89724ad..6528dc1 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -2211,7 +2211,7 @@ v850_elf_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  /* Note - this check is delayed until now as it is possible and
 	     valid to have a file without any symbols but with relocs that
@@ -2228,7 +2228,7 @@ v850_elf_relocate_section (bfd *output_bfd,
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c
index c6a8f81..d6ae14e 100644
--- a/bfd/elf32-vax.c
+++ b/bfd/elf32-vax.c
@@ -1408,12 +1408,12 @@ elf_vax_relocate_section (bfd *output_bfd,
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if ((h->root.type == bfd_link_hash_defined
 	      || h->root.type == bfd_link_hash_defweak)
diff --git a/bfd/elf32-xc16x.c b/bfd/elf32-xc16x.c
index 9f285c7..ec7e3da 100644
--- a/bfd/elf32-xc16x.c
+++ b/bfd/elf32-xc16x.c
@@ -373,12 +373,12 @@ elf32_xc16x_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c
index 851ebbc..b5946b7 100644
--- a/bfd/elf32-xstormy16.c
+++ b/bfd/elf32-xstormy16.c
@@ -818,12 +818,12 @@ xstormy16_elf_relocate_section (bfd *                   output_bfd ATTRIBUTE_UNU
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index 28ed9aa..75ccefe 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -2638,10 +2638,12 @@ elf_xtensa_relocate_section (bfd *output_bfd,
 	}
       else
 	{
+	  bfd_boolean ignored;
+
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (relocation == 0
 	      && !unresolved_reloc
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index 289164f..3dbdab7 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -4303,14 +4303,14 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  struct elf_link_hash_entry *hh;
 	  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   hh, sec, value,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (warned)
 	    continue;
diff --git a/bfd/elf64-ia64-vms.c b/bfd/elf64-ia64-vms.c
index 102cdff..58a05af 100644
--- a/bfd/elf64-ia64-vms.c
+++ b/bfd/elf64-ia64-vms.c
@@ -3495,13 +3495,13 @@ elf64_ia64_relocate_section (bfd *output_bfd,
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sym_sec, value,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (h->root.type == bfd_link_hash_undefweak)
 	    undef_weak_ref = TRUE;
diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c
index 499bcd6..c7e1c25 100644
--- a/bfd/elf64-mmix.c
+++ b/bfd/elf64-mmix.c
@@ -1413,12 +1413,13 @@ mmix_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc;
+	  bfd_boolean unresolved_reloc, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, undefined_signalled);
+				   unresolved_reloc, undefined_signalled,
+				   ignored);
 	  name = h->root.root.string;
 	}
 
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 136887f..24c733e 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -12973,10 +12973,12 @@ ppc64_elf_relocate_section (bfd *output_bfd,
 	}
       else
 	{
+	  bfd_boolean ignored;
+
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h_elf, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  sym_name = h_elf->root.root.string;
 	  sym_type = h_elf->type;
 	  if (sec != NULL
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 3aea98c..601aa43 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -2374,11 +2374,12 @@ elf_s390_relocate_section (bfd *output_bfd,
       else
 	{
 	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && discarded_section (sec))
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index f748641..c95fdf5 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -3298,11 +3298,12 @@ elf_x86_64_relocate_section (bfd *output_bfd,
       else
 	{
 	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  st_size = h->size;
 	}
 
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 8f0e716..3424ae2 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -4132,12 +4132,12 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  sym_type = h->type;
 	}
diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c
index 117b4c8..ef340cf 100644
--- a/bfd/elfnn-ia64.c
+++ b/bfd/elfnn-ia64.c
@@ -3902,17 +3902,17 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sym_sec, value,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (h->root.type == bfd_link_hash_undefweak)
 	    undef_weak_ref = TRUE;
-	  else if (warned)
+	  else if (warned || (ignored && info->executable))
 	    continue;
 	}
 
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index 94da360..8250f84 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -3019,12 +3019,12 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  if (warned)
 	    {
 	      /* To avoid generating warning messages about truncated
diff --git a/bfd/elfxx-tilegx.c b/bfd/elfxx-tilegx.c
index c57e38f..594ee79 100644
--- a/bfd/elfxx-tilegx.c
+++ b/bfd/elfxx-tilegx.c
@@ -3191,12 +3191,13 @@ tilegx_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  if (warned)
 	    {
 	      /* To avoid generating warning messages about truncated
diff --git a/ld/testsuite/ld-ia64/error1.d b/ld/testsuite/ld-ia64/error1.d
new file mode 100644
index 0000000..82142b6
--- /dev/null
+++ b/ld/testsuite/ld-ia64/error1.d
@@ -0,0 +1,7 @@
+#source: error1.s
+#ld: -unresolved-symbols=ignore-all
+#readelf: -s
+
+#...
+[ 	]+[0-9]+:[ 	]+[0]+[ 	]+0[ 	]+NOTYPE[ 	]+GLOBAL DEFAULT[ 	]+UND[ 	]+foo
+#pass
diff --git a/ld/testsuite/ld-ia64/error1.s b/ld/testsuite/ld-ia64/error1.s
new file mode 100644
index 0000000..fd48eae
--- /dev/null
+++ b/ld/testsuite/ld-ia64/error1.s
@@ -0,0 +1,30 @@
+	.explicit
+	.pred.safe_across_calls p1-p5,p16-p63
+	.text
+	.align 16
+	.global _start#
+	.proc _start#
+_start:
+	.prologue 12, 32
+	.mii
+	.save ar.pfs, r33
+	alloc r33 = ar.pfs, 0, 3, 0, 0
+	.save rp, r32
+	mov r32 = b0
+	mov r34 = r1
+	.body
+	;;
+	.bbb
+	nop 0
+	nop 0
+	br.call.sptk.many b0 = foo#
+	;;
+	.mmi
+	nop 0
+	mov r1 = r34
+	mov b0 = r32
+	.mib
+	nop 0
+	mov ar.pfs = r33
+	br.ret.sptk.many b0
+	.endp _start#
diff --git a/ld/testsuite/ld-ia64/error2.d b/ld/testsuite/ld-ia64/error2.d
new file mode 100644
index 0000000..764ba66
--- /dev/null
+++ b/ld/testsuite/ld-ia64/error2.d
@@ -0,0 +1,7 @@
+#source: error1.s
+#ld: -pie -unresolved-symbols=ignore-all
+#readelf: -s
+
+#...
+[ 	]+[0-9]+:[ 	]+[0]+[ 	]+0[ 	]+NOTYPE[ 	]+GLOBAL DEFAULT[ 	]+UND[ 	]+foo
+#pass
diff --git a/ld/testsuite/ld-ia64/error3.d b/ld/testsuite/ld-ia64/error3.d
new file mode 100644
index 0000000..e14d451
--- /dev/null
+++ b/ld/testsuite/ld-ia64/error3.d
@@ -0,0 +1,7 @@
+#source: error1.s
+#ld: -pie -shared
+#readelf: -s
+
+#...
+[ 	]+[0-9]+:[ 	]+[0]+[ 	]+0[ 	]+NOTYPE[ 	]+GLOBAL DEFAULT[ 	]+UND[ 	]+foo
+#pass
diff --git a/ld/testsuite/ld-ia64/error4.d b/ld/testsuite/ld-ia64/error4.d
new file mode 100644
index 0000000..881e671
--- /dev/null
+++ b/ld/testsuite/ld-ia64/error4.d
@@ -0,0 +1,3 @@
+#source: error1.s
+#ld: -shared -pie
+#error: .*undefined reference to `foo'

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64
  2007-07-03 18:29         ` H.J. Lu
  2007-07-03 18:33           ` Andreas Schwab
@ 2007-07-04  0:09           ` NightStrike
  1 sibling, 0 replies; 18+ messages in thread
From: NightStrike @ 2007-07-04  0:09 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Andreas Schwab, binutils

On 7/3/07, H.J. Lu <hjl@lucon.org> wrote:
>
> Now the question is what linker should do when 2 exclusive options,
> like:
>
>  -shared, -Bshareable        Create a shared library
>  -pie, --pic-executable      Create a position independent executable
>
> are given at the same time. Linker can issue an error or let the
> last one wins. I am OK with either choice. What do people perfer?
> Whatever we do, we should be consistent.

Why would you not want to always take the last option?  That would be
consistent with most all unix tools, yes?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on  ia64
  2007-07-03 18:50               ` H.J. Lu
@ 2007-07-03 19:06                 ` Andreas Schwab
  0 siblings, 0 replies; 18+ messages in thread
From: Andreas Schwab @ 2007-07-03 19:06 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Eric Christopher, binutils

"H.J. Lu" <hjl@lucon.org> writes:

> Where is it documented.

Nowhere.

> Gcc 4.3 just passes "-shared -pie" to linker. I don't see gcc driver
> remove -pie.

Look at the use of Scrt1.o.  It's much of a mess.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on  ia64
  2007-07-03 18:42             ` Eric Christopher
@ 2007-07-03 18:50               ` H.J. Lu
  2007-07-03 19:06                 ` Andreas Schwab
  0 siblings, 1 reply; 18+ messages in thread
From: H.J. Lu @ 2007-07-03 18:50 UTC (permalink / raw)
  To: Eric Christopher; +Cc: Andreas Schwab, binutils

On Tue, Jul 03, 2007 at 11:32:57AM -0700, Eric Christopher wrote:
> 
> On Jul 3, 2007, at 11:29 AM, Andreas Schwab wrote:
> 
> >"H.J. Lu" <hjl@lucon.org> writes:
> >
> >>Now the question is what linker should do when 2 exclusive options,
> >>like:
> >>
> >> -shared, -Bshareable        Create a shared library
> >> -pie, --pic-executable      Create a position independent executable
> >>
> >>are given at the same time. Linker can issue an error or let the
> >>last one wins. I am OK with either choice. What do people perfer?
> >>Whatever we do, we should be consistent.
> >
> >In gcc -shared wins over -pie.
> 
> And that's definitely what we should do.

Where is it documented. Gcc 4.3 just passes "-shared -pie" to
linker. I don't see gcc driver remove -pie.


H.J.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64
  2007-07-03 18:33           ` Andreas Schwab
@ 2007-07-03 18:42             ` Eric Christopher
  2007-07-03 18:50               ` H.J. Lu
  0 siblings, 1 reply; 18+ messages in thread
From: Eric Christopher @ 2007-07-03 18:42 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: H.J. Lu, binutils


On Jul 3, 2007, at 11:29 AM, Andreas Schwab wrote:

> "H.J. Lu" <hjl@lucon.org> writes:
>
>> Now the question is what linker should do when 2 exclusive options,
>> like:
>>
>>  -shared, -Bshareable        Create a shared library
>>  -pie, --pic-executable      Create a position independent executable
>>
>> are given at the same time. Linker can issue an error or let the
>> last one wins. I am OK with either choice. What do people perfer?
>> Whatever we do, we should be consistent.
>
> In gcc -shared wins over -pie.

And that's definitely what we should do.

-eric

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64
  2007-07-03 18:29         ` H.J. Lu
@ 2007-07-03 18:33           ` Andreas Schwab
  2007-07-03 18:42             ` Eric Christopher
  2007-07-04  0:09           ` NightStrike
  1 sibling, 1 reply; 18+ messages in thread
From: Andreas Schwab @ 2007-07-03 18:33 UTC (permalink / raw)
  To: H.J. Lu; +Cc: binutils

"H.J. Lu" <hjl@lucon.org> writes:

> Now the question is what linker should do when 2 exclusive options,
> like:
>
>   -shared, -Bshareable        Create a shared library
>   -pie, --pic-executable      Create a position independent executable
>
> are given at the same time. Linker can issue an error or let the
> last one wins. I am OK with either choice. What do people perfer?
> Whatever we do, we should be consistent.

In gcc -shared wins over -pie.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on  ia64
  2007-07-03 18:07       ` Andreas Schwab
@ 2007-07-03 18:29         ` H.J. Lu
  2007-07-03 18:33           ` Andreas Schwab
  2007-07-04  0:09           ` NightStrike
  0 siblings, 2 replies; 18+ messages in thread
From: H.J. Lu @ 2007-07-03 18:29 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: binutils

On Tue, Jul 03, 2007 at 07:57:52PM +0200, Andreas Schwab wrote:
> "H.J. Lu" <hjl@lucon.org> writes:
> 
> > --- binutils/ld/testsuite/ld-ia64/error3.d.error	2007-07-03 09:43:00.000000000 -0700
> > +++ binutils/ld/testsuite/ld-ia64/error3.d	2007-07-03 09:43:17.000000000 -0700
> > @@ -0,0 +1,7 @@
> > +#source: error1.s
> > +#ld: -pie -shared
> > +#readelf: -s
> > +
> > +#...
> > +[ 	]+[0-9]+:[ 	]+[0]+[ 	]+0[ 	]+NOTYPE[ 	]+GLOBAL DEFAULT[ 	]+UND[ 	]+foo
> > +#pass
> > --- binutils/ld/testsuite/ld-ia64/error4.d.error	2007-07-03 09:56:43.000000000 -0700
> > +++ binutils/ld/testsuite/ld-ia64/error4.d	2007-07-03 10:23:18.000000000 -0700
> > @@ -0,0 +1,3 @@
> > +#source: error1.s
> > +#ld: -shared -pie
> > +#error: .*undefined reference to `foo'
> 
> The order of arguments should not change the behaviour.  The combination
> of -shared with -pie should be an error instead.
> 

Now the question is what linker should do when 2 exclusive options,
like:

  -shared, -Bshareable        Create a shared library
  -pie, --pic-executable      Create a position independent executable

are given at the same time. Linker can issue an error or let the
last one wins. I am OK with either choice. What do people perfer?
Whatever we do, we should be consistent.


H.J.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64
  2007-07-03 17:57     ` PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64 H.J. Lu
@ 2007-07-03 18:07       ` Andreas Schwab
  2007-07-03 18:29         ` H.J. Lu
  0 siblings, 1 reply; 18+ messages in thread
From: Andreas Schwab @ 2007-07-03 18:07 UTC (permalink / raw)
  To: H.J. Lu; +Cc: binutils

"H.J. Lu" <hjl@lucon.org> writes:

> --- binutils/ld/testsuite/ld-ia64/error3.d.error	2007-07-03 09:43:00.000000000 -0700
> +++ binutils/ld/testsuite/ld-ia64/error3.d	2007-07-03 09:43:17.000000000 -0700
> @@ -0,0 +1,7 @@
> +#source: error1.s
> +#ld: -pie -shared
> +#readelf: -s
> +
> +#...
> +[ 	]+[0-9]+:[ 	]+[0]+[ 	]+0[ 	]+NOTYPE[ 	]+GLOBAL DEFAULT[ 	]+UND[ 	]+foo
> +#pass
> --- binutils/ld/testsuite/ld-ia64/error4.d.error	2007-07-03 09:56:43.000000000 -0700
> +++ binutils/ld/testsuite/ld-ia64/error4.d	2007-07-03 10:23:18.000000000 -0700
> @@ -0,0 +1,3 @@
> +#source: error1.s
> +#ld: -shared -pie
> +#error: .*undefined reference to `foo'

The order of arguments should not change the behaviour.  The combination
of -shared with -pie should be an error instead.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 18+ messages in thread

* PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64
  2007-07-03 14:12   ` Andreas Schwab
@ 2007-07-03 17:57     ` H.J. Lu
  2007-07-03 18:07       ` Andreas Schwab
  0 siblings, 1 reply; 18+ messages in thread
From: H.J. Lu @ 2007-07-03 17:57 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: binutils

On Tue, Jul 03, 2007 at 04:07:30PM +0200, Andreas Schwab wrote:
> "H.J. Lu" <hjl@lucon.org> writes:
> 
> > On Tue, Jul 03, 2007 at 03:30:36PM +0200, Andreas Schwab wrote:
> >> There is a problem with the ia64 linker that it crashes when seeing a
> >> R_IA64_PCREL21B relocation against an unresolved symbol, because no PLT
> >> has been allocated for it.  This can be fixed with the patch below, but
> >> I'm not sure whether that combination should be allowed in the first
> >> place.
> >> 
> >
> > Is this the same as
> >
> > http://sourceware.org/bugzilla/show_bug.cgi?id=4409
> >
> > Does the Linux binutils 2.17.50.0.17 crash?
> 
> It silently generates a shared library that crashes at runtime, so I'd
> rather ban the combination of -shared with -pie regardless of how the
> crash is resolved.
> 

This is the updated patch for PR ld/4409 and will be in the next
Linux binutils.


H.J.
-----
bfd/

2007-07-03  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4409
	* elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add an argument for
	error ignored.
	* elf-m10200.c (mn10200_elf_relocate_section): Updated.
	* elf-m10300.c (mn10300_elf_relocate_section): Likewise.
	* elf32-arm.c (elf32_arm_relocate_section): Likewise.
	* elf32-avr.c (elf32_avr_relocate_section): Likewise.
	* elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
	(bfin_relocate_section): Likewise.
	* elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
	* elf32-cris.c (cris_elf_relocate_section): Likewise.
	* elf32-crx.c (elf32_crx_relocate_section): Likewise.
	* elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
	* elf32-fr30.c (fr30_elf_relocate_section): Likewise.
	* elf32-frv.c (elf32_frv_relocate_section): Likewise.
	* elf32-h8300.c (elf32_h8_relocate_section): Likewise.
	* elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
	* elf32-i386.c (elf_i386_relocate_section): Likewise.
	* elf32-i860.c (elf32_i860_relocate_section): Likewise.
	* elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
	* elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
	* elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
	* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
	* elf32-mcore.c (mcore_elf_relocate_section): Likewise.
	* elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
	* elf32-mt.c (mt_elf_relocate_section): Likewise.
	* elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
	* elf32-s390.c (elf_s390_relocate_section): Likewise.
	* elf32-spu.c (spu_elf_relocate_section): Likewise.
	* elf32-v850.c (v850_elf_relocate_section): Likewise.
	* elf32-vax.c (elf_vax_relocate_section): Likewise.
	* elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
	* elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
	* elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
	* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
	* elf64-mmix.c (mmix_elf_relocate_section): Likewise.
	* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
	* elf64-s390.c (elf_s390_relocate_section): Likewise.
	* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.

	* elfxx-ia64.c (elfNN_ia64_relocate_section): Skip if error
	from RELOC_FOR_GLOBAL_SYMBOL in executable is ignored.

ld/

2007-07-03  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4409
	* ldmain.c (how_to_report_unresolved_symbols): New.
	(main): Set link_info.unresolved_syms_in_objects and
	link_info.unresolved_syms_in_shared_libs if they aren't set
	yet.

	* ldmain.h (how_to_report_unresolved_symbols): New.

	* lexsup.c (how_to_report_unresolved_symbols): Removed.
	(parse_args): Set link_info.pie to FALSE for -shared. Don't
	set default values for link_info.unresolved_syms_in_objects nor
	link_info.unresolved_syms_in_shared_libs.

ld/testsuite/

2007-07-03  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4409
	* ld-ia64/error1.d: New file.
	* ld-ia64/error1.s: Likewise.
	* ld-ia64/error2.d: Likewise.
	* ld-ia64/error3.d: Likewise.
	* ld-ia64/error4.d: Likewise.

--- binutils/bfd/elf-bfd.h.error	2007-07-02 09:14:15.000000000 -0700
+++ binutils/bfd/elf-bfd.h	2007-07-02 09:14:15.000000000 -0700
@@ -2082,7 +2082,7 @@ extern bfd_boolean _sh_elf_set_mach_from
 #define RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel,	\
 				r_symndx, symtab_hdr, sym_hashes,	\
 				h, sec, relocation,			\
-				unresolved_reloc, warned)		\
+				unresolved_reloc, warned, ignored)	\
   do									\
     {									\
       /* It seems this can happen with erroneous or unsupported		\
@@ -2097,6 +2097,7 @@ extern bfd_boolean _sh_elf_set_mach_from
 	h = (struct elf_link_hash_entry *) h->root.u.i.link;		\
 									\
       warned = FALSE;							\
+      ignored = FALSE;							\
       unresolved_reloc = FALSE;						\
       relocation = 0;							\
       if (h->root.type == bfd_link_hash_defined				\
@@ -2119,7 +2120,7 @@ extern bfd_boolean _sh_elf_set_mach_from
 	;								\
       else if (info->unresolved_syms_in_objects == RM_IGNORE		\
 	       && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)		\
-	;								\
+	ignored = TRUE;							\
       else if (!info->relocatable)					\
 	{								\
 	  bfd_boolean err;						\
--- binutils/bfd/elf-m10200.c.error	2007-04-26 08:57:29.000000000 -0700
+++ binutils/bfd/elf-m10200.c	2007-07-02 09:14:15.000000000 -0700
@@ -391,12 +391,12 @@ mn10200_elf_relocate_section (output_bfd
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf-m10300.c.error	2007-05-15 10:29:15.000000000 -0700
+++ binutils/bfd/elf-m10300.c	2007-07-02 09:14:15.000000000 -0700
@@ -1416,13 +1416,13 @@ mn10300_elf_relocate_section (output_bfd
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  struct elf_link_hash_entry *hh;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   hh, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  h = (struct elf32_mn10300_link_hash_entry *) hh;
 
--- binutils/bfd/elf32-arm.c.error	2007-06-29 11:40:54.000000000 -0700
+++ binutils/bfd/elf32-arm.c	2007-07-02 09:14:15.000000000 -0700
@@ -6446,12 +6446,12 @@ elf32_arm_relocate_section (bfd *       
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  sym_type = h->type;
 	}
--- binutils/bfd/elf32-avr.c.error	2007-04-26 08:57:29.000000000 -0700
+++ binutils/bfd/elf32-avr.c	2007-07-02 09:14:15.000000000 -0700
@@ -1204,12 +1204,12 @@ elf32_avr_relocate_section (bfd *output_
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
--- binutils/bfd/elf32-bfin.c.error	2007-06-29 11:40:54.000000000 -0700
+++ binutils/bfd/elf32-bfin.c	2007-07-02 09:14:15.000000000 -0700
@@ -2197,13 +2197,13 @@ bfinfdpic_relocate_section (bfd * output
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  osec = sec;
 	}
 
@@ -2895,12 +2895,12 @@ bfin_relocate_section (bfd * output_bfd,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-cr16c.c.error	2007-04-26 08:57:29.000000000 -0700
+++ binutils/bfd/elf32-cr16c.c	2007-07-02 09:14:15.000000000 -0700
@@ -717,12 +717,12 @@ elf32_cr16c_relocate_section (bfd *outpu
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-cris.c.error	2007-05-15 10:29:16.000000000 -0700
+++ binutils/bfd/elf32-cris.c	2007-07-02 09:14:15.000000000 -0700
@@ -995,13 +995,13 @@ cris_elf_relocate_section (output_bfd, i
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (unresolved_reloc
 	      /* Perhaps we should detect the cases that
--- binutils/bfd/elf32-crx.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-crx.c	2007-07-02 09:14:15.000000000 -0700
@@ -868,12 +868,12 @@ elf32_crx_relocate_section (bfd *output_
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-d10v.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-d10v.c	2007-07-02 09:14:15.000000000 -0700
@@ -456,12 +456,12 @@ elf32_d10v_relocate_section (bfd *output
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-fr30.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-fr30.c	2007-07-02 09:14:15.000000000 -0700
@@ -566,12 +566,12 @@ fr30_elf_relocate_section (output_bfd, i
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
--- binutils/bfd/elf32-frv.c.error	2007-06-29 11:40:54.000000000 -0700
+++ binutils/bfd/elf32-frv.c	2007-07-02 09:14:15.000000000 -0700
@@ -2812,13 +2812,13 @@ elf32_frv_relocate_section (output_bfd, 
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  osec = sec;
 	}
 
--- binutils/bfd/elf32-h8300.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-h8300.c	2007-07-02 09:14:15.000000000 -0700
@@ -451,12 +451,12 @@ elf32_h8_relocate_section (bfd *output_b
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-hppa.c.error	2007-05-15 10:29:16.000000000 -0700
+++ binutils/bfd/elf32-hppa.c	2007-07-02 09:14:15.000000000 -0700
@@ -3675,13 +3675,14 @@ elf32_hppa_relocate_section (bfd *output
       else
 	{
 	  struct elf_link_hash_entry *eh;
-	  bfd_boolean unresolved_reloc;
+	  bfd_boolean unresolved_reloc, ignored;
 	  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rela,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   eh, sym_sec, relocation,
-				   unresolved_reloc, warned_undef);
+				   unresolved_reloc, warned_undef,
+				   ignored);
 
 	  if (!info->relocatable
 	      && relocation == 0
--- binutils/bfd/elf32-i386.c.error	2007-07-02 09:14:15.000000000 -0700
+++ binutils/bfd/elf32-i386.c	2007-07-02 09:14:15.000000000 -0700
@@ -2361,12 +2361,12 @@ elf_i386_relocate_section (bfd *output_b
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-i860.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-i860.c	2007-07-02 09:14:15.000000000 -0700
@@ -1119,12 +1119,12 @@ elf32_i860_relocate_section (bfd *output
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-ip2k.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-ip2k.c	2007-07-02 09:14:15.000000000 -0700
@@ -1449,13 +1449,13 @@ ip2k_elf_relocate_section (bfd *output_b
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
--- binutils/bfd/elf32-iq2000.c.error	2007-06-29 11:40:54.000000000 -0700
+++ binutils/bfd/elf32-iq2000.c	2007-07-02 09:14:15.000000000 -0700
@@ -586,12 +586,12 @@ iq2000_elf_relocate_section (bfd *		    
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
--- binutils/bfd/elf32-m68hc1x.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-m68hc1x.c	2007-07-02 09:14:15.000000000 -0700
@@ -944,12 +944,12 @@ elf32_m68hc11_relocate_section (bfd *out
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation, unresolved_reloc,
-				   warned);
+				   warned, ignored);
 
 	  is_far = (h && (h->other & STO_M68HC12_FAR));
 	  stub_name = h->root.root.string;
--- binutils/bfd/elf32-m68k.c.error	2007-05-15 10:29:17.000000000 -0700
+++ binutils/bfd/elf32-m68k.c	2007-07-02 09:14:15.000000000 -0700
@@ -1645,12 +1645,12 @@ elf_m68k_relocate_section (output_bfd, i
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-mcore.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-mcore.c	2007-07-02 09:14:15.000000000 -0700
@@ -457,12 +457,12 @@ mcore_elf_relocate_section (bfd * output
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-msp430.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-msp430.c	2007-07-02 09:14:15.000000000 -0700
@@ -449,12 +449,12 @@ elf32_msp430_relocate_section (bfd * out
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-mt.c.error	2007-06-29 11:40:54.000000000 -0700
+++ binutils/bfd/elf32-mt.c	2007-07-02 09:14:15.000000000 -0700
@@ -343,12 +343,12 @@ mt_elf_relocate_section
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
--- binutils/bfd/elf32-openrisc.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-openrisc.c	2007-07-02 09:14:15.000000000 -0700
@@ -365,12 +365,12 @@ openrisc_elf_relocate_section (bfd *outp
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-ppc.c.error	2007-06-30 21:00:19.000000000 -0700
+++ binutils/bfd/elf32-ppc.c	2007-07-02 09:14:15.000000000 -0700
@@ -5713,10 +5713,12 @@ ppc_elf_relocate_section (bfd *output_bf
 	}
       else
 	{
+	  bfd_boolean ignored;
+
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  sym_name = h->root.root.string;
 	}
--- binutils/bfd/elf32-s390.c.error	2007-05-15 10:29:18.000000000 -0700
+++ binutils/bfd/elf32-s390.c	2007-07-02 09:14:15.000000000 -0700
@@ -2311,11 +2311,12 @@ elf_s390_relocate_section (output_bfd, i
       else
 	{
 	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-spu.c.error	2007-06-29 11:40:55.000000000 -0700
+++ binutils/bfd/elf32-spu.c	2007-07-02 09:14:15.000000000 -0700
@@ -2724,10 +2724,12 @@ spu_elf_relocate_section (bfd *output_bf
 	}
       else
 	{
+	  bfd_boolean ignored;
+
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  sym_name = h->root.root.string;
 	}
 
--- binutils/bfd/elf32-v850.c.error	2007-04-26 08:57:31.000000000 -0700
+++ binutils/bfd/elf32-v850.c	2007-07-02 09:14:15.000000000 -0700
@@ -1623,7 +1623,7 @@ v850_elf_relocate_section (bfd *output_b
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  /* Note - this check is delayed until now as it is possible and
 	     valid to have a file without any symbols but with relocs that
@@ -1640,7 +1640,7 @@ v850_elf_relocate_section (bfd *output_b
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-vax.c.error	2007-05-15 10:29:18.000000000 -0700
+++ binutils/bfd/elf32-vax.c	2007-07-02 09:14:15.000000000 -0700
@@ -1414,12 +1414,12 @@ elf_vax_relocate_section (bfd *output_bf
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if ((h->root.type == bfd_link_hash_defined
 	      || h->root.type == bfd_link_hash_defweak)
--- binutils/bfd/elf32-xc16x.c.error	2007-04-26 08:57:31.000000000 -0700
+++ binutils/bfd/elf32-xc16x.c	2007-07-02 09:14:15.000000000 -0700
@@ -373,12 +373,12 @@ elf32_xc16x_relocate_section (bfd *outpu
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-xstormy16.c.error	2007-04-26 08:57:31.000000000 -0700
+++ binutils/bfd/elf32-xstormy16.c	2007-07-02 09:14:15.000000000 -0700
@@ -821,12 +821,12 @@ xstormy16_elf_relocate_section (bfd *   
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-xtensa.c.error	2007-06-12 08:49:17.000000000 -0700
+++ binutils/bfd/elf32-xtensa.c	2007-07-02 09:14:15.000000000 -0700
@@ -2055,10 +2055,12 @@ elf_xtensa_relocate_section (bfd *output
 	}
       else
 	{
+	  bfd_boolean ignored;
+
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (relocation == 0
 	      && !unresolved_reloc
--- binutils/bfd/elf64-alpha.c.error	2007-04-26 08:57:31.000000000 -0700
+++ binutils/bfd/elf64-alpha.c	2007-07-02 09:14:15.000000000 -0700
@@ -4174,7 +4174,7 @@ elf64_alpha_relocate_section (bfd *outpu
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 	  struct elf_link_hash_entry *hh;
 	  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
@@ -4182,7 +4182,7 @@ elf64_alpha_relocate_section (bfd *outpu
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   hh, sec, value,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (warned)
 	    continue;
--- binutils/bfd/elf64-mmix.c.error	2007-04-26 08:57:31.000000000 -0700
+++ binutils/bfd/elf64-mmix.c	2007-07-02 09:14:15.000000000 -0700
@@ -1400,12 +1400,13 @@ mmix_elf_relocate_section (output_bfd, i
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc;
+	  bfd_boolean unresolved_reloc, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, undefined_signalled);
+				   unresolved_reloc, undefined_signalled,
+				   ignored);
 	  name = h->root.root.string;
 	}
 
--- binutils/bfd/elf64-ppc.c.error	2007-05-15 10:29:19.000000000 -0700
+++ binutils/bfd/elf64-ppc.c	2007-07-02 09:14:15.000000000 -0700
@@ -9899,10 +9899,12 @@ ppc64_elf_relocate_section (bfd *output_
 	}
       else
 	{
+	  bfd_boolean ignored;
+
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h_elf, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  sym_name = h_elf->root.root.string;
 	  sym_type = h_elf->type;
 	}
--- binutils/bfd/elf64-s390.c.error	2007-05-15 10:29:19.000000000 -0700
+++ binutils/bfd/elf64-s390.c	2007-07-02 09:14:15.000000000 -0700
@@ -2285,11 +2285,12 @@ elf_s390_relocate_section (output_bfd, i
       else
 	{
 	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf64-x86-64.c.error	2007-07-02 09:14:15.000000000 -0700
+++ binutils/bfd/elf64-x86-64.c	2007-07-02 09:14:15.000000000 -0700
@@ -2123,12 +2123,12 @@ elf64_x86_64_relocate_section (bfd *outp
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elfxx-ia64.c.error	2007-07-02 09:14:15.000000000 -0700
+++ binutils/bfd/elfxx-ia64.c	2007-07-02 09:14:15.000000000 -0700
@@ -4741,17 +4741,17 @@ elfNN_ia64_relocate_section (output_bfd,
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sym_sec, value,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (h->root.type == bfd_link_hash_undefweak)
 	    undef_weak_ref = TRUE;
-	  else if (warned)
+	  else if (warned || (ignored && info->executable))
 	    continue;
 	}
 
--- binutils/bfd/elfxx-sparc.c.error	2007-05-15 10:29:20.000000000 -0700
+++ binutils/bfd/elfxx-sparc.c	2007-07-02 09:14:15.000000000 -0700
@@ -2531,12 +2531,12 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  if (warned)
 	    {
 	      /* To avoid generating warning messages about truncated
--- binutils/ld/ldmain.c.error	2007-07-02 09:14:15.000000000 -0700
+++ binutils/ld/ldmain.c	2007-07-03 10:40:21.000000000 -0700
@@ -103,6 +103,9 @@ bfd_boolean add_needed = TRUE;
 /* TRUE if we should demangle symbol names.  */
 bfd_boolean demangling;
 
+/* How to report unresolved symbols.  */
+enum report_method how_to_report_unresolved_symbols = RM_GENERATE_ERROR;
+
 args_type command_line;
 
 ld_config_type config;
@@ -388,6 +391,27 @@ main (int argc, char **argv)
   if (! link_info.shared || link_info.pie)
     link_info.executable = TRUE;
 
+  /* When creating a shared library, the default behaviour is to
+     ignore any unresolved references.  */
+
+  if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
+    {
+      if (link_info.shared && !link_info.pie)
+	link_info.unresolved_syms_in_objects = RM_IGNORE;
+      else
+	link_info.unresolved_syms_in_objects
+	  = how_to_report_unresolved_symbols;
+    }
+
+  if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
+    {
+      if (link_info.shared && !link_info.pie)
+	link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
+      else
+	link_info.unresolved_syms_in_shared_libs
+	  = how_to_report_unresolved_symbols;
+    }
+
   /* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols).  I
      don't see how else this can be handled, since in this case we
      must preserve all externally visible symbols.  */
--- binutils/ld/ldmain.h.error	2005-05-12 00:32:03.000000000 -0700
+++ binutils/ld/ldmain.h	2007-07-03 10:31:08.000000000 -0700
@@ -35,6 +35,7 @@ extern bfd_boolean whole_archive;
 extern bfd_boolean as_needed;
 extern bfd_boolean add_needed;
 extern bfd_boolean demangling;
+extern enum report_method how_to_report_unresolved_symbols;
 extern int g_switch_value;
 extern const char *output_filename;
 extern struct bfd_link_info link_info;
--- binutils/ld/lexsup.c.error	2007-05-03 17:57:28.000000000 -0700
+++ binutils/ld/lexsup.c	2007-07-03 10:31:08.000000000 -0700
@@ -567,7 +567,6 @@ parse_args (unsigned argc, char **argv)
   struct option *longopts;
   struct option *really_longopts;
   int last_optind;
-  enum report_method how_to_report_unresolved_symbols = RM_GENERATE_ERROR;
 
   shortopts = xmalloc (OPTION_COUNT * 3 + 2);
   longopts = xmalloc (sizeof (*longopts) * (OPTION_COUNT + 1));
@@ -1113,12 +1112,7 @@ parse_args (unsigned argc, char **argv)
 	  if (config.has_shared)
 	    {
 	      link_info.shared = TRUE;
-	      /* When creating a shared library, the default
-		 behaviour is to ignore any unresolved references.  */
-	      if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
-		link_info.unresolved_syms_in_objects = RM_IGNORE;
-	      if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
-		link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
+	      link_info.pie = FALSE;
 	    }
 	  else
 	    einfo (_("%P%F: -shared not supported\n"));
@@ -1444,14 +1438,6 @@ parse_args (unsigned argc, char **argv)
       set_default_dirlist (default_dirlist);
       free (default_dirlist);
     }
-
-  if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
-    /* FIXME: Should we allow emulations a chance to set this ?  */
-    link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols;
-
-  if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
-    /* FIXME: Should we allow emulations a chance to set this ?  */
-    link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols;
 }
 
 /* Add the (colon-separated) elements of DIRLIST_PTR to the
--- binutils/ld/testsuite/ld-ia64/error1.d.error	2007-07-02 09:14:15.000000000 -0700
+++ binutils/ld/testsuite/ld-ia64/error1.d	2007-07-03 09:56:52.000000000 -0700
@@ -0,0 +1,7 @@
+#source: error1.s
+#ld: -unresolved-symbols=ignore-all
+#readelf: -s
+
+#...
+[ 	]+[0-9]+:[ 	]+[0]+[ 	]+0[ 	]+NOTYPE[ 	]+GLOBAL DEFAULT[ 	]+UND[ 	]+foo
+#pass
--- binutils/ld/testsuite/ld-ia64/error1.s.error	2007-07-02 09:14:15.000000000 -0700
+++ binutils/ld/testsuite/ld-ia64/error1.s	2007-07-03 10:21:46.000000000 -0700
@@ -0,0 +1,30 @@
+	.explicit
+	.pred.safe_across_calls p1-p5,p16-p63
+	.text
+	.align 16
+	.global _start#
+	.proc _start#
+_start:
+	.prologue 12, 32
+	.mii
+	.save ar.pfs, r33
+	alloc r33 = ar.pfs, 0, 3, 0, 0
+	.save rp, r32
+	mov r32 = b0
+	mov r34 = r1
+	.body
+	;;
+	.bbb
+	nop 0
+	nop 0
+	br.call.sptk.many b0 = foo#
+	;;
+	.mmi
+	nop 0
+	mov r1 = r34
+	mov b0 = r32
+	.mib
+	nop 0
+	mov ar.pfs = r33
+	br.ret.sptk.many b0
+	.endp _start#
--- binutils/ld/testsuite/ld-ia64/error2.d.error	2007-07-03 09:41:51.000000000 -0700
+++ binutils/ld/testsuite/ld-ia64/error2.d	2007-07-03 09:56:38.000000000 -0700
@@ -0,0 +1,7 @@
+#source: error1.s
+#ld: -pie -unresolved-symbols=ignore-all
+#readelf: -s
+
+#...
+[ 	]+[0-9]+:[ 	]+[0]+[ 	]+0[ 	]+NOTYPE[ 	]+GLOBAL DEFAULT[ 	]+UND[ 	]+foo
+#pass
--- binutils/ld/testsuite/ld-ia64/error3.d.error	2007-07-03 09:43:00.000000000 -0700
+++ binutils/ld/testsuite/ld-ia64/error3.d	2007-07-03 09:43:17.000000000 -0700
@@ -0,0 +1,7 @@
+#source: error1.s
+#ld: -pie -shared
+#readelf: -s
+
+#...
+[ 	]+[0-9]+:[ 	]+[0]+[ 	]+0[ 	]+NOTYPE[ 	]+GLOBAL DEFAULT[ 	]+UND[ 	]+foo
+#pass
--- binutils/ld/testsuite/ld-ia64/error4.d.error	2007-07-03 09:56:43.000000000 -0700
+++ binutils/ld/testsuite/ld-ia64/error4.d	2007-07-03 10:23:18.000000000 -0700
@@ -0,0 +1,3 @@
+#source: error1.s
+#ld: -shared -pie
+#error: .*undefined reference to `foo'

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64
  2007-05-10 13:04   ` H. J. Lu
@ 2007-05-11  1:15     ` Alan Modra
  0 siblings, 0 replies; 18+ messages in thread
From: Alan Modra @ 2007-05-11  1:15 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Thu, May 10, 2007 at 06:04:03AM -0700, H. J. Lu wrote:
> On Thu, May 10, 2007 at 02:15:39PM +0930, Alan Modra wrote:
> > On Wed, May 09, 2007 at 09:14:20PM -0700, H. J. Lu wrote:
> > > When an error from RELOC_FOR_GLOBAL_SYMBOL in executable is ignored
> > > on ia64, we shouldn't continue since unresolved symbol in executable
> > > is fatal on ia64. This patch fixes it.
> > > 
> > 
> > This would have been a lot less typing if you'd just changed
> > elfxx-ia64.c.  The following does the same as your patch, I think.
> > 
> > Index: bfd/elfxx-ia64.c
> > ===================================================================
> > RCS file: /cvs/src/src/bfd/elfxx-ia64.c,v
> > retrieving revision 1.198
> > diff -u -p -r1.198 elfxx-ia64.c
> > --- bfd/elfxx-ia64.c	26 Apr 2007 14:46:57 -0000	1.198
> > +++ bfd/elfxx-ia64.c	10 May 2007 04:39:41 -0000
> > @@ -4672,7 +4672,9 @@ elfNN_ia64_relocate_section (output_bfd,
> >  
> >  	  if (h->root.type == bfd_link_hash_undefweak)
> >  	    undef_weak_ref = TRUE;
> > -	  else if (warned)
> > +	  else if (h->root.type != bfd_link_hash_defined
> > +		   && h->root.type != bfd_link_hash_defweak
> > +		   && (warned || info->executable))
> >  	    continue;
> >  	}
> >  
> 
> They aren't the same for symbols with non-default visibility. We can

Yeah, I got it wrong.

> certainly copy the same logic to elfNN_ia64_relocate_section. But is
> this necessary given that I already did the typing :-(?

I'll defer that decision to Jim.  I don't really know enough about
ia64 to OK the patch.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64
  2007-05-10  4:45 ` Alan Modra
@ 2007-05-10 13:04   ` H. J. Lu
  2007-05-11  1:15     ` Alan Modra
  0 siblings, 1 reply; 18+ messages in thread
From: H. J. Lu @ 2007-05-10 13:04 UTC (permalink / raw)
  To: binutils

On Thu, May 10, 2007 at 02:15:39PM +0930, Alan Modra wrote:
> On Wed, May 09, 2007 at 09:14:20PM -0700, H. J. Lu wrote:
> > When an error from RELOC_FOR_GLOBAL_SYMBOL in executable is ignored
> > on ia64, we shouldn't continue since unresolved symbol in executable
> > is fatal on ia64. This patch fixes it.
> > 
> 
> This would have been a lot less typing if you'd just changed
> elfxx-ia64.c.  The following does the same as your patch, I think.
> 
> Index: bfd/elfxx-ia64.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/elfxx-ia64.c,v
> retrieving revision 1.198
> diff -u -p -r1.198 elfxx-ia64.c
> --- bfd/elfxx-ia64.c	26 Apr 2007 14:46:57 -0000	1.198
> +++ bfd/elfxx-ia64.c	10 May 2007 04:39:41 -0000
> @@ -4672,7 +4672,9 @@ elfNN_ia64_relocate_section (output_bfd,
>  
>  	  if (h->root.type == bfd_link_hash_undefweak)
>  	    undef_weak_ref = TRUE;
> -	  else if (warned)
> +	  else if (h->root.type != bfd_link_hash_defined
> +		   && h->root.type != bfd_link_hash_defweak
> +		   && (warned || info->executable))
>  	    continue;
>  	}
>  

They aren't the same for symbols with non-default visibility. We can
certainly copy the same logic to elfNN_ia64_relocate_section. But is
this necessary given that I already did the typing :-(?


H.J.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64
  2007-05-10  4:14 H. J. Lu
@ 2007-05-10  4:45 ` Alan Modra
  2007-05-10 13:04   ` H. J. Lu
  0 siblings, 1 reply; 18+ messages in thread
From: Alan Modra @ 2007-05-10  4:45 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Wed, May 09, 2007 at 09:14:20PM -0700, H. J. Lu wrote:
> When an error from RELOC_FOR_GLOBAL_SYMBOL in executable is ignored
> on ia64, we shouldn't continue since unresolved symbol in executable
> is fatal on ia64. This patch fixes it.
> 
> 
> H.J.
> -----
> bfd/
> 
> 2007-05-09  H.J. Lu  <hongjiu.lu@intel.com>
> 
> 	PR ld/4409
> 	* elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add an argument for
> 	error ignored.
> 	* elf-m10200.c (mn10200_elf_relocate_section): Updated.
> 	* elf-m10300.c (mn10300_elf_relocate_section): Likewise.
> 	* elf32-arm.c (elf32_arm_relocate_section): Likewise.
> 	* elf32-avr.c (elf32_avr_relocate_section): Likewise.
> 	* elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
> 	(bfin_relocate_section): Likewise.
> 	* elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
> 	* elf32-cris.c (cris_elf_relocate_section): Likewise.
> 	* elf32-crx.c (elf32_crx_relocate_section): Likewise.
> 	* elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
> 	* elf32-fr30.c (fr30_elf_relocate_section): Likewise.
> 	* elf32-frv.c (elf32_frv_relocate_section): Likewise.
> 	* elf32-h8300.c (elf32_h8_relocate_section): Likewise.
> 	* elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
> 	* elf32-i386.c (elf_i386_relocate_section): Likewise.
> 	* elf32-i860.c (elf32_i860_relocate_section): Likewise.
> 	* elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
> 	* elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
> 	* elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
> 	* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
> 	* elf32-mcore.c (mcore_elf_relocate_section): Likewise.
> 	* elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
> 	* elf32-mt.c (mt_elf_relocate_section): Likewise.
> 	* elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
> 	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
> 	* elf32-s390.c (elf_s390_relocate_section): Likewise.
> 	* elf32-spu.c (spu_elf_relocate_section): Likewise.
> 	* elf32-v850.c (v850_elf_relocate_section): Likewise.
> 	* elf32-vax.c (elf_vax_relocate_section): Likewise.
> 	* elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
> 	* elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
> 	* elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
> 	* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
> 	* elf64-mmix.c (mmix_elf_relocate_section): Likewise.
> 	* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
> 	* elf64-s390.c (elf_s390_relocate_section): Likewise.
> 	* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
> 	* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
> 
> 	* elfxx-ia64.c (elfNN_ia64_relocate_section): Skip if error
> 	from RELOC_FOR_GLOBAL_SYMBOL in executable is ignored.

This would have been a lot less typing if you'd just changed
elfxx-ia64.c.  The following does the same as your patch, I think.

Index: bfd/elfxx-ia64.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-ia64.c,v
retrieving revision 1.198
diff -u -p -r1.198 elfxx-ia64.c
--- bfd/elfxx-ia64.c	26 Apr 2007 14:46:57 -0000	1.198
+++ bfd/elfxx-ia64.c	10 May 2007 04:39:41 -0000
@@ -4672,7 +4672,9 @@ elfNN_ia64_relocate_section (output_bfd,
 
 	  if (h->root.type == bfd_link_hash_undefweak)
 	    undef_weak_ref = TRUE;
-	  else if (warned)
+	  else if (h->root.type != bfd_link_hash_defined
+		   && h->root.type != bfd_link_hash_defweak
+		   && (warned || info->executable))
 	    continue;
 	}
 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 18+ messages in thread

* PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64
@ 2007-05-10  4:14 H. J. Lu
  2007-05-10  4:45 ` Alan Modra
  0 siblings, 1 reply; 18+ messages in thread
From: H. J. Lu @ 2007-05-10  4:14 UTC (permalink / raw)
  To: binutils

When an error from RELOC_FOR_GLOBAL_SYMBOL in executable is ignored
on ia64, we shouldn't continue since unresolved symbol in executable
is fatal on ia64. This patch fixes it.


H.J.
-----
bfd/

2007-05-09  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4409
	* elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add an argument for
	error ignored.
	* elf-m10200.c (mn10200_elf_relocate_section): Updated.
	* elf-m10300.c (mn10300_elf_relocate_section): Likewise.
	* elf32-arm.c (elf32_arm_relocate_section): Likewise.
	* elf32-avr.c (elf32_avr_relocate_section): Likewise.
	* elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
	(bfin_relocate_section): Likewise.
	* elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
	* elf32-cris.c (cris_elf_relocate_section): Likewise.
	* elf32-crx.c (elf32_crx_relocate_section): Likewise.
	* elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
	* elf32-fr30.c (fr30_elf_relocate_section): Likewise.
	* elf32-frv.c (elf32_frv_relocate_section): Likewise.
	* elf32-h8300.c (elf32_h8_relocate_section): Likewise.
	* elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
	* elf32-i386.c (elf_i386_relocate_section): Likewise.
	* elf32-i860.c (elf32_i860_relocate_section): Likewise.
	* elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
	* elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
	* elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
	* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
	* elf32-mcore.c (mcore_elf_relocate_section): Likewise.
	* elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
	* elf32-mt.c (mt_elf_relocate_section): Likewise.
	* elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
	* elf32-s390.c (elf_s390_relocate_section): Likewise.
	* elf32-spu.c (spu_elf_relocate_section): Likewise.
	* elf32-v850.c (v850_elf_relocate_section): Likewise.
	* elf32-vax.c (elf_vax_relocate_section): Likewise.
	* elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
	* elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
	* elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
	* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
	* elf64-mmix.c (mmix_elf_relocate_section): Likewise.
	* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
	* elf64-s390.c (elf_s390_relocate_section): Likewise.
	* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.

	* elfxx-ia64.c (elfNN_ia64_relocate_section): Skip if error
	from RELOC_FOR_GLOBAL_SYMBOL in executable is ignored.

ld/testsuite/

2007-05-09  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4409
	* ld-ia64/error1.d: New file.
	* ld-ia64/error1.s: Likewise.

--- binutils/bfd/elf-bfd.h.error	2007-05-09 10:54:22.000000000 -0700
+++ binutils/bfd/elf-bfd.h	2007-05-09 18:49:25.000000000 -0700
@@ -1994,7 +1994,7 @@ extern bfd_boolean _sh_elf_set_mach_from
 #define RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel,	\
 				r_symndx, symtab_hdr, sym_hashes,	\
 				h, sec, relocation,			\
-				unresolved_reloc, warned)		\
+				unresolved_reloc, warned, ignored)	\
   do									\
     {									\
       /* It seems this can happen with erroneous or unsupported		\
@@ -2009,6 +2009,7 @@ extern bfd_boolean _sh_elf_set_mach_from
 	h = (struct elf_link_hash_entry *) h->root.u.i.link;		\
 									\
       warned = FALSE;							\
+      ignored = FALSE;							\
       unresolved_reloc = FALSE;						\
       relocation = 0;							\
       if (h->root.type == bfd_link_hash_defined				\
@@ -2031,7 +2032,7 @@ extern bfd_boolean _sh_elf_set_mach_from
 	;								\
       else if (info->unresolved_syms_in_objects == RM_IGNORE		\
 	       && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)		\
-	;								\
+	ignored = TRUE;							\
       else if (!info->relocatable)					\
 	{								\
 	  bfd_boolean err;						\
--- binutils/bfd/elf-m10200.c.error	2007-04-26 08:57:29.000000000 -0700
+++ binutils/bfd/elf-m10200.c	2007-05-09 18:58:04.000000000 -0700
@@ -391,12 +391,12 @@ mn10200_elf_relocate_section (output_bfd
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf-m10300.c.error	2007-04-26 08:57:29.000000000 -0700
+++ binutils/bfd/elf-m10300.c	2007-05-09 18:58:16.000000000 -0700
@@ -1416,13 +1416,13 @@ mn10300_elf_relocate_section (output_bfd
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  struct elf_link_hash_entry *hh;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   hh, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  h = (struct elf32_mn10300_link_hash_entry *) hh;
 
--- binutils/bfd/elf32-arm.c.error	2007-05-09 06:26:57.000000000 -0700
+++ binutils/bfd/elf32-arm.c	2007-05-09 18:50:10.000000000 -0700
@@ -6626,12 +6626,12 @@ elf32_arm_relocate_section (bfd *       
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  sym_type = h->type;
 	}
--- binutils/bfd/elf32-avr.c.error	2007-04-26 08:57:29.000000000 -0700
+++ binutils/bfd/elf32-avr.c	2007-05-09 18:50:25.000000000 -0700
@@ -1204,12 +1204,12 @@ elf32_avr_relocate_section (bfd *output_
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
--- binutils/bfd/elf32-bfin.c.error	2007-04-26 08:57:29.000000000 -0700
+++ binutils/bfd/elf32-bfin.c	2007-05-09 20:04:41.000000000 -0700
@@ -2197,13 +2197,13 @@ bfinfdpic_relocate_section (bfd * output
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  osec = sec;
 	}
 
@@ -2895,12 +2895,12 @@ bfin_relocate_section (bfd * output_bfd,
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-cr16c.c.error	2007-04-26 08:57:29.000000000 -0700
+++ binutils/bfd/elf32-cr16c.c	2007-05-09 18:50:46.000000000 -0700
@@ -717,12 +717,12 @@ elf32_cr16c_relocate_section (bfd *outpu
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-cris.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-cris.c	2007-05-09 18:51:00.000000000 -0700
@@ -995,13 +995,13 @@ cris_elf_relocate_section (output_bfd, i
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (unresolved_reloc
 	      /* Perhaps we should detect the cases that
--- binutils/bfd/elf32-crx.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-crx.c	2007-05-09 18:51:09.000000000 -0700
@@ -868,12 +868,12 @@ elf32_crx_relocate_section (bfd *output_
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-d10v.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-d10v.c	2007-05-09 18:51:18.000000000 -0700
@@ -456,12 +456,12 @@ elf32_d10v_relocate_section (bfd *output
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-fr30.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-fr30.c	2007-05-09 18:51:27.000000000 -0700
@@ -566,12 +566,12 @@ fr30_elf_relocate_section (output_bfd, i
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
--- binutils/bfd/elf32-frv.c.error	2007-05-08 13:51:54.000000000 -0700
+++ binutils/bfd/elf32-frv.c	2007-05-09 18:51:38.000000000 -0700
@@ -2812,13 +2812,13 @@ elf32_frv_relocate_section (output_bfd, 
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  osec = sec;
 	}
 
--- binutils/bfd/elf32-h8300.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-h8300.c	2007-05-09 18:51:47.000000000 -0700
@@ -451,12 +451,12 @@ elf32_h8_relocate_section (bfd *output_b
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-hppa.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-hppa.c	2007-05-09 18:52:02.000000000 -0700
@@ -3697,13 +3697,14 @@ elf32_hppa_relocate_section (bfd *output
       else
 	{
 	  struct elf_link_hash_entry *eh;
-	  bfd_boolean unresolved_reloc;
+	  bfd_boolean unresolved_reloc, ignored;
 	  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rela,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   eh, sym_sec, relocation,
-				   unresolved_reloc, warned_undef);
+				   unresolved_reloc, warned_undef,
+				   ignored);
 
 	  if (!info->relocatable
 	      && relocation == 0
--- binutils/bfd/elf32-i386.c.error	2007-05-09 10:54:22.000000000 -0700
+++ binutils/bfd/elf32-i386.c	2007-05-09 18:52:13.000000000 -0700
@@ -2383,12 +2383,12 @@ elf_i386_relocate_section (bfd *output_b
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-i860.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-i860.c	2007-05-09 18:52:22.000000000 -0700
@@ -1119,12 +1119,12 @@ elf32_i860_relocate_section (bfd *output
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-ip2k.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-ip2k.c	2007-05-09 18:52:34.000000000 -0700
@@ -1449,13 +1449,13 @@ ip2k_elf_relocate_section (bfd *output_b
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
--- binutils/bfd/elf32-iq2000.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-iq2000.c	2007-05-09 18:52:47.000000000 -0700
@@ -586,12 +586,12 @@ iq2000_elf_relocate_section (bfd *		    
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
--- binutils/bfd/elf32-m68hc1x.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-m68hc1x.c	2007-05-09 18:52:57.000000000 -0700
@@ -944,12 +944,12 @@ elf32_m68hc11_relocate_section (bfd *out
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation, unresolved_reloc,
-				   warned);
+				   warned, ignored);
 
 	  is_far = (h && (h->other & STO_M68HC12_FAR));
 	  stub_name = h->root.root.string;
--- binutils/bfd/elf32-m68k.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-m68k.c	2007-05-09 18:53:19.000000000 -0700
@@ -1667,12 +1667,12 @@ elf_m68k_relocate_section (output_bfd, i
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-mcore.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-mcore.c	2007-05-09 18:53:30.000000000 -0700
@@ -457,12 +457,12 @@ mcore_elf_relocate_section (bfd * output
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-msp430.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-msp430.c	2007-05-09 18:53:38.000000000 -0700
@@ -449,12 +449,12 @@ elf32_msp430_relocate_section (bfd * out
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-mt.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-mt.c	2007-05-09 18:53:49.000000000 -0700
@@ -343,12 +343,12 @@ mt_elf_relocate_section
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  name = h->root.root.string;
 	}
--- binutils/bfd/elf32-openrisc.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-openrisc.c	2007-05-09 18:53:57.000000000 -0700
@@ -365,12 +365,12 @@ openrisc_elf_relocate_section (bfd *outp
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-ppc.c.error	2007-04-26 08:57:30.000000000 -0700
+++ binutils/bfd/elf32-ppc.c	2007-05-09 18:54:23.000000000 -0700
@@ -5627,10 +5627,12 @@ ppc_elf_relocate_section (bfd *output_bf
 	}
       else
 	{
+	  bfd_boolean ignored;
+
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  sym_name = h->root.root.string;
 	}
--- binutils/bfd/elf32-s390.c.error	2007-04-26 08:57:31.000000000 -0700
+++ binutils/bfd/elf32-s390.c	2007-05-09 18:54:46.000000000 -0700
@@ -2332,11 +2332,12 @@ elf_s390_relocate_section (output_bfd, i
       else
 	{
 	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-spu.c.error	2007-05-08 13:51:55.000000000 -0700
+++ binutils/bfd/elf32-spu.c	2007-05-09 18:55:09.000000000 -0700
@@ -2685,10 +2685,12 @@ spu_elf_relocate_section (bfd *output_bf
 	}
       else
 	{
+	  bfd_boolean ignored;
+
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  sym_name = h->root.root.string;
 	}
 
--- binutils/bfd/elf32-v850.c.error	2007-04-26 08:57:31.000000000 -0700
+++ binutils/bfd/elf32-v850.c	2007-05-09 18:55:24.000000000 -0700
@@ -1623,7 +1623,7 @@ v850_elf_relocate_section (bfd *output_b
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  /* Note - this check is delayed until now as it is possible and
 	     valid to have a file without any symbols but with relocs that
@@ -1640,7 +1640,7 @@ v850_elf_relocate_section (bfd *output_b
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-vax.c.error	2007-04-26 08:57:31.000000000 -0700
+++ binutils/bfd/elf32-vax.c	2007-05-09 18:55:34.000000000 -0700
@@ -1436,12 +1436,12 @@ elf_vax_relocate_section (bfd *output_bf
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if ((h->root.type == bfd_link_hash_defined
 	      || h->root.type == bfd_link_hash_defweak)
--- binutils/bfd/elf32-xc16x.c.error	2007-04-26 08:57:31.000000000 -0700
+++ binutils/bfd/elf32-xc16x.c	2007-05-09 18:55:43.000000000 -0700
@@ -373,12 +373,12 @@ elf32_xc16x_relocate_section (bfd *outpu
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-xstormy16.c.error	2007-04-26 08:57:31.000000000 -0700
+++ binutils/bfd/elf32-xstormy16.c	2007-05-09 18:55:53.000000000 -0700
@@ -821,12 +821,12 @@ xstormy16_elf_relocate_section (bfd *   
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc, warned;
+	  bfd_boolean unresolved_reloc, warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf32-xtensa.c.error	2007-04-27 16:19:35.000000000 -0700
+++ binutils/bfd/elf32-xtensa.c	2007-05-09 18:56:10.000000000 -0700
@@ -2055,10 +2055,12 @@ elf_xtensa_relocate_section (bfd *output
 	}
       else
 	{
+	  bfd_boolean ignored;
+
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (relocation == 0
 	      && !unresolved_reloc
--- binutils/bfd/elf64-alpha.c.error	2007-04-26 08:57:31.000000000 -0700
+++ binutils/bfd/elf64-alpha.c	2007-05-09 18:56:23.000000000 -0700
@@ -4174,7 +4174,7 @@ elf64_alpha_relocate_section (bfd *outpu
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  bfd_boolean unresolved_reloc;
 	  struct elf_link_hash_entry *hh;
 	  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
@@ -4182,7 +4182,7 @@ elf64_alpha_relocate_section (bfd *outpu
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   hh, sec, value,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (warned)
 	    continue;
--- binutils/bfd/elf64-mmix.c.error	2007-04-26 08:57:31.000000000 -0700
+++ binutils/bfd/elf64-mmix.c	2007-05-09 18:56:37.000000000 -0700
@@ -1400,12 +1400,13 @@ mmix_elf_relocate_section (output_bfd, i
 	}
       else
 	{
-	  bfd_boolean unresolved_reloc;
+	  bfd_boolean unresolved_reloc, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, undefined_signalled);
+				   unresolved_reloc, undefined_signalled,
+				   ignored);
 	  name = h->root.root.string;
 	}
 
--- binutils/bfd/elf64-ppc.c.error	2007-04-26 08:57:31.000000000 -0700
+++ binutils/bfd/elf64-ppc.c	2007-05-09 18:56:50.000000000 -0700
@@ -9916,10 +9916,12 @@ ppc64_elf_relocate_section (bfd *output_
 	}
       else
 	{
+	  bfd_boolean ignored;
+
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h_elf, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  sym_name = h_elf->root.root.string;
 	  sym_type = h_elf->type;
 	}
--- binutils/bfd/elf64-s390.c.error	2007-04-26 08:57:32.000000000 -0700
+++ binutils/bfd/elf64-s390.c	2007-05-09 18:57:02.000000000 -0700
@@ -2306,11 +2306,12 @@ elf_s390_relocate_section (output_bfd, i
       else
 	{
 	  bfd_boolean warned ATTRIBUTE_UNUSED;
+	  bfd_boolean ignored ATTRIBUTE_UNUSED;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elf64-x86-64.c.error	2007-05-09 10:54:22.000000000 -0700
+++ binutils/bfd/elf64-x86-64.c	2007-05-09 18:57:19.000000000 -0700
@@ -2148,12 +2148,12 @@ elf64_x86_64_relocate_section (bfd *outp
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
--- binutils/bfd/elfxx-ia64.c.error	2007-05-09 10:54:22.000000000 -0700
+++ binutils/bfd/elfxx-ia64.c	2007-05-09 21:03:12.000000000 -0700
@@ -4663,17 +4663,17 @@ elfNN_ia64_relocate_section (output_bfd,
       else
 	{
 	  bfd_boolean unresolved_reloc;
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 	  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sym_sec, value,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 
 	  if (h->root.type == bfd_link_hash_undefweak)
 	    undef_weak_ref = TRUE;
-	  else if (warned)
+	  else if (warned || (ignored && info->executable))
 	    continue;
 	}
 
--- binutils/bfd/elfxx-sparc.c.error	2007-04-26 08:57:32.000000000 -0700
+++ binutils/bfd/elfxx-sparc.c	2007-05-09 18:59:10.000000000 -0700
@@ -2552,12 +2552,12 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 	}
       else
 	{
-	  bfd_boolean warned;
+	  bfd_boolean warned, ignored;
 
 	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
-				   unresolved_reloc, warned);
+				   unresolved_reloc, warned, ignored);
 	  if (warned)
 	    {
 	      /* To avoid generating warning messages about truncated
--- binutils/ld/testsuite/ld-ia64/error1.d.error	2007-05-09 20:30:37.000000000 -0700
+++ binutils/ld/testsuite/ld-ia64/error1.d	2007-05-09 20:30:14.000000000 -0700
@@ -0,0 +1,7 @@
+#source: error1.s
+#ld: -unresolved-symbols=ignore-all
+#readelf: -s
+
+#...
+[ 	]+[0-9]+:[ 	]+[0]+[ 	]+0[ 	]+NOTYPE[ 	]+GLOBAL DEFAULT[ 	]+UND[ 	]+foo
+#pass
--- binutils/ld/testsuite/ld-ia64/error1.s.error	2007-05-09 20:30:41.000000000 -0700
+++ binutils/ld/testsuite/ld-ia64/error1.s	2007-05-09 20:25:15.000000000 -0700
@@ -0,0 +1,33 @@
+	.explicit
+	.pred.safe_across_calls p1-p5,p16-p63
+	.text
+	.globl	_start#
+	.proc	_start#
+_start:
+	addl	r14 = @ltoff(@tprel(sG2#)), gp
+	;;
+	ld8	r14 = [r14]
+	;;
+	add	r14 = r14, r13
+	;;
+
+	addl	r14 = @ltoff(@tprel(bl1#)), gp
+	;;
+	ld8	r14 = [r14]
+	;;
+	add	r14 = r14, r13
+	;;
+
+	mov	r2 = r13
+	;;
+	addl	r14 = @tprel(sg1#), r2
+	addl	r15 = @tprel(bl2#) + 2, r2
+	;;
+	adds	r14 = @tprel(sh2#) + 3, r13
+	movl	r15 = @tprel(bl2#) + 1
+	;;
+	br.call.sptk.many b0 = foo#
+	;;
+
+	br.ret.sptk.many b0;
+	.endp	_start#

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2013-11-05 17:05 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-05 15:58 PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64 H.J. Lu
2012-07-07 10:45 ` Alan Modra
2012-07-07 12:19   ` H.J. Lu
2012-07-17 17:49     ` Jim Wilson
2012-07-17 19:23       ` H.J. Lu
  -- strict thread matches above, loose matches on Subject: below --
2013-11-05 17:05 H.J. Lu
2007-07-03 13:33 ld -shared -pie vs. unresolved symbols Andreas Schwab
2007-07-03 14:07 ` H.J. Lu
2007-07-03 14:12   ` Andreas Schwab
2007-07-03 17:57     ` PATCH: PR ld/4409: --unresolved-symbols=ignore-all issues on ia64 H.J. Lu
2007-07-03 18:07       ` Andreas Schwab
2007-07-03 18:29         ` H.J. Lu
2007-07-03 18:33           ` Andreas Schwab
2007-07-03 18:42             ` Eric Christopher
2007-07-03 18:50               ` H.J. Lu
2007-07-03 19:06                 ` Andreas Schwab
2007-07-04  0:09           ` NightStrike
2007-05-10  4:14 H. J. Lu
2007-05-10  4:45 ` Alan Modra
2007-05-10 13:04   ` H. J. Lu
2007-05-11  1:15     ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).