This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR ld/15323: Unable to redefine weak function in -flto incrementally-linked executable


On Fri, Mar 29, 2013 at 05:40:50PM -0700, H.J. Lu wrote:
> We didn't set non_ir_ref for reference to the definition within the same
> file.  I checked in this patch to fix x86 ELF targets.  Other targets
> may need the similar fix.

This does the same for the rest of the ELF targets that implement a
check_relocs funcion, and simplifies the testcase.  MIPS also gets a
minor tidy.

bfd/
	PR ld/15323
	* elf-m10300.c (mn10300_elf_check_relocs): Set non_ir_ref for
	global symbols referenced by relocs.
	* elf32-arm.c (elf32_arm_check_relocs): Likewise.
	* elf32-bfin.c (bfin_check_relocs): Likewise.
	* elf32-cr16.c (cr16_elf_check_relocs): Likewise.
	* elf32-cris.c (cris_elf_check_relocs): Likewise.
	* elf32-d10v.c (elf32_d10v_check_relocs): Likewise.
	* elf32-dlx.c (elf32_dlx_check_relocs): Likewise.
	* elf32-fr30.c (fr30_elf_check_relocs): Likewise.
	* elf32-frv.c (elf32_frv_check_relocs): Likewise.
	* elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
	* elf32-i370.c (i370_elf_check_relocs): Likewise.
	* elf32-iq2000.c (iq2000_elf_check_relocs): Likewise.
	* elf32-lm32.c (lm32_elf_check_relocs): Likewise.
	* elf32-m32c.c (m32c_elf_check_relocs): Likewise.
	* elf32-m32r.c (m32r_elf_check_relocs): Likewise.
	* elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise.
	* elf32-m68k.c (elf_m68k_check_relocs): Likewise.
	* elf32-mcore.c (mcore_elf_check_relocs): Likewise.
	* elf32-metag.c (elf_metag_check_relocs): Likewise.
	* elf32-microblaze.c (microblaze_elf_check_relocs): Likewise.
	* elf32-moxie.c (moxie_elf_check_relocs): Likewise.
	* elf32-msp430.c (elf32_msp430_check_relocs): Likewise.
	* elf32-mt.c (mt_elf_check_relocs): Likewise.
	* elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
	* elf32-openrisc.c (openrisc_elf_check_relocs): Likewise.
	* elf32-ppc.c (ppc_elf_check_relocs): Likewise.
	* elf32-rl78.c (rl78_elf_check_relocs): Likewise.
	* elf32-s390.c (elf_s390_check_relocs): Likewise.
	* elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
	* elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
	* elf32-sh.c (sh_elf_check_relocs): Likewise.
	* elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
	* elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
	* elf32-v850.c (v850_elf_check_relocs): Likewise.
	* elf32-vax.c (elf_vax_check_relocs): Likewise.
	* elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise.
	* elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
	* elf64-aarch64.c (elf64_aarch64_check_relocs): Likewise.
	* elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
	* elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
	* elf64-ia64-vms.c (elf64_ia64_check_relocs): Likewise.
	* elf64-mmix.c (mmix_elf_check_relocs): Likewise.
	* elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
	* elf64-s390.c (elf_s390_check_relocs): Likewise.
	* elf64-sh64.c (sh_elf64_check_relocs): Likewise.
	* elfnn-ia64.c (elfNN_ia64_check_relocs): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
	* elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
	* elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.  Don't
	test indirect/warning links for NULL.
ld/testsuite/
	* ld-plugin/lto.exp (pr15323a.c): Compile without -flto rather
	than using -r to effectively strip out lto info.

Index: bfd/elf-m10300.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-m10300.c,v
retrieving revision 1.121
diff -u -p -r1.121 elf-m10300.c
--- bfd/elf-m10300.c	27 Mar 2013 13:37:50 -0000	1.121
+++ bfd/elf-m10300.c	30 Mar 2013 08:39:08 -0000
@@ -1084,6 +1084,10 @@ mn10300_elf_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       r_type = ELF32_R_TYPE (rel->r_info);
Index: bfd/elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.314
diff -u -p -r1.314 elf32-arm.c
--- bfd/elf32-arm.c	27 Mar 2013 13:37:50 -0000	1.314
+++ bfd/elf32-arm.c	30 Mar 2013 08:39:08 -0000
@@ -12465,6 +12465,10 @@ elf32_arm_check_relocs (bfd *abfd, struc
 	      while (h->root.type == bfd_link_hash_indirect
 		     || h->root.type == bfd_link_hash_warning)
 		h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	      /* PR15323, ref flags aren't set for references in the
+		 same object.  */
+	      h->root.non_ir_ref = 1;
 	    }
 	}
 
Index: bfd/elf32-bfin.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-bfin.c,v
retrieving revision 1.62
diff -u -p -r1.62 elf32-bfin.c
--- bfd/elf32-bfin.c	27 Mar 2013 13:37:50 -0000	1.62
+++ bfd/elf32-bfin.c	30 Mar 2013 08:39:08 -0000
@@ -1187,7 +1187,13 @@ bfin_check_relocs (bfd * abfd,
       if (r_symndx < symtab_hdr->sh_info)
 	h = NULL;
       else
-	h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+	{
+	  h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
+	}
 
       switch (ELF32_R_TYPE (rel->r_info))
 	{
Index: bfd/elf32-cr16.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cr16.c,v
retrieving revision 1.26
diff -u -p -r1.26 elf32-cr16.c
--- bfd/elf32-cr16.c	27 Mar 2013 13:37:51 -0000	1.26
+++ bfd/elf32-cr16.c	30 Mar 2013 08:39:08 -0000
@@ -725,6 +725,10 @@ cr16_elf_check_relocs (bfd *abfd, struct
           while (h->root.type == bfd_link_hash_indirect
                  || h->root.type == bfd_link_hash_warning)
             h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
         }
 
       /* Some relocs require a global offset table.  */
Index: bfd/elf32-cris.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cris.c,v
retrieving revision 1.130
diff -u -p -r1.130 elf32-cris.c
--- bfd/elf32-cris.c	27 Mar 2013 13:37:51 -0000	1.130
+++ bfd/elf32-cris.c	30 Mar 2013 08:39:09 -0000
@@ -3177,6 +3177,10 @@ cris_elf_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       r_type = ELF32_R_TYPE (rel->r_info);
Index: bfd/elf32-d10v.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-d10v.c,v
retrieving revision 1.41
diff -u -p -r1.41 elf32-d10v.c
--- bfd/elf32-d10v.c	7 May 2012 03:27:49 -0000	1.41
+++ bfd/elf32-d10v.c	30 Mar 2013 08:39:09 -0000
@@ -287,6 +287,10 @@ elf32_d10v_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       switch (ELF32_R_TYPE (rel->r_info))
Index: bfd/elf32-dlx.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-dlx.c,v
retrieving revision 1.24
diff -u -p -r1.24 elf32-dlx.c
--- bfd/elf32-dlx.c	14 Jan 2011 12:35:56 -0000	1.24
+++ bfd/elf32-dlx.c	30 Mar 2013 08:39:09 -0000
@@ -451,6 +451,10 @@ elf32_dlx_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       switch (ELF32_R_TYPE (rel->r_info))
Index: bfd/elf32-fr30.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-fr30.c,v
retrieving revision 1.43
diff -u -p -r1.43 elf32-fr30.c
--- bfd/elf32-fr30.c	13 Jul 2012 14:22:46 -0000	1.43
+++ bfd/elf32-fr30.c	30 Mar 2013 08:39:09 -0000
@@ -671,6 +671,10 @@ fr30_elf_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       switch (ELF32_R_TYPE (rel->r_info))
Index: bfd/elf32-frv.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-frv.c,v
retrieving revision 1.83
diff -u -p -r1.83 elf32-frv.c
--- bfd/elf32-frv.c	21 Feb 2013 03:02:28 -0000	1.83
+++ bfd/elf32-frv.c	30 Mar 2013 08:39:09 -0000
@@ -6046,6 +6046,10 @@ elf32_frv_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       switch (ELF32_R_TYPE (rel->r_info))
Index: bfd/elf32-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-hppa.c,v
retrieving revision 1.193
diff -u -p -r1.193 elf32-hppa.c
--- bfd/elf32-hppa.c	27 Mar 2013 13:37:51 -0000	1.193
+++ bfd/elf32-hppa.c	30 Mar 2013 08:39:09 -0000
@@ -1169,6 +1169,10 @@ elf32_hppa_check_relocs (bfd *abfd,
 	  while (hh->eh.root.type == bfd_link_hash_indirect
 		 || hh->eh.root.type == bfd_link_hash_warning)
 	    hh = hppa_elf_hash_entry (hh->eh.root.u.i.link);
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  hh->eh.root.non_ir_ref = 1;
 	}
 
       r_type = ELF32_R_TYPE (rela->r_info);
Index: bfd/elf32-i370.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i370.c,v
retrieving revision 1.74
diff -u -p -r1.74 elf32-i370.c
--- bfd/elf32-i370.c	29 Jun 2012 14:45:59 -0000	1.74
+++ bfd/elf32-i370.c	30 Mar 2013 08:39:09 -0000
@@ -825,6 +825,10 @@ i370_elf_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       if (info->shared)
Index: bfd/elf32-iq2000.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-iq2000.c,v
retrieving revision 1.30
diff -u -p -r1.30 elf32-iq2000.c
--- bfd/elf32-iq2000.c	10 Jan 2013 20:03:53 -0000	1.30
+++ bfd/elf32-iq2000.c	30 Mar 2013 08:39:09 -0000
@@ -478,6 +478,10 @@ iq2000_elf_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       switch (ELF32_R_TYPE (rel->r_info))
Index: bfd/elf32-lm32.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-lm32.c,v
retrieving revision 1.20
diff -u -p -r1.20 elf32-lm32.c
--- bfd/elf32-lm32.c	27 Mar 2013 13:37:51 -0000	1.20
+++ bfd/elf32-lm32.c	30 Mar 2013 08:39:09 -0000
@@ -1305,6 +1305,10 @@ lm32_elf_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       /* Some relocs require a global offset table.  */
Index: bfd/elf32-m32c.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m32c.c,v
retrieving revision 1.30
diff -u -p -r1.30 elf32-m32c.c
--- bfd/elf32-m32c.c	10 Jan 2013 20:03:53 -0000	1.30
+++ bfd/elf32-m32c.c	30 Mar 2013 08:39:09 -0000
@@ -621,6 +621,10 @@ m32c_elf_check_relocs
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       switch (ELF32_R_TYPE (rel->r_info))
Index: bfd/elf32-m32r.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m32r.c,v
retrieving revision 1.112
diff -u -p -r1.112 elf32-m32r.c
--- bfd/elf32-m32r.c	27 Mar 2013 13:37:51 -0000	1.112
+++ bfd/elf32-m32r.c	30 Mar 2013 08:39:09 -0000
@@ -3746,6 +3746,10 @@ m32r_elf_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       /* Some relocs require a global offset table.  */
Index: bfd/elf32-m68hc1x.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m68hc1x.c,v
retrieving revision 1.51
diff -u -p -r1.51 elf32-m68hc1x.c
--- bfd/elf32-m68hc1x.c	11 Feb 2013 05:30:54 -0000	1.51
+++ bfd/elf32-m68hc1x.c	30 Mar 2013 08:39:09 -0000
@@ -871,6 +871,10 @@ elf32_m68hc11_check_relocs (bfd *abfd, s
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       switch (ELF32_R_TYPE (rel->r_info))
Index: bfd/elf32-m68k.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m68k.c,v
retrieving revision 1.141
diff -u -p -r1.141 elf32-m68k.c
--- bfd/elf32-m68k.c	27 Mar 2013 13:37:51 -0000	1.141
+++ bfd/elf32-m68k.c	30 Mar 2013 08:39:09 -0000
@@ -2584,6 +2584,10 @@ elf_m68k_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       switch (ELF32_R_TYPE (rel->r_info))
Index: bfd/elf32-mcore.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-mcore.c,v
retrieving revision 1.57
diff -u -p -r1.57 elf32-mcore.c
--- bfd/elf32-mcore.c	13 Jul 2012 14:22:47 -0000	1.57
+++ bfd/elf32-mcore.c	30 Mar 2013 08:39:09 -0000
@@ -613,6 +613,10 @@ mcore_elf_check_relocs (bfd * abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       switch (ELF32_R_TYPE (rel->r_info))
Index: bfd/elf32-metag.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-metag.c,v
retrieving revision 1.7
diff -u -p -r1.7 elf32-metag.c
--- bfd/elf32-metag.c	27 Mar 2013 13:37:51 -0000	1.7
+++ bfd/elf32-metag.c	30 Mar 2013 08:39:09 -0000
@@ -2141,6 +2141,10 @@ elf_metag_check_relocs (bfd *abfd,
 	  while (hh->eh.root.type == bfd_link_hash_indirect
 		 || hh->eh.root.type == bfd_link_hash_warning)
 	    hh = (struct elf_metag_link_hash_entry *) hh->eh.root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  hh->eh.root.non_ir_ref = 1;
 	}
 
       /* Some relocs require a global offset table.  */
Index: bfd/elf32-microblaze.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-microblaze.c,v
retrieving revision 1.19
diff -u -p -r1.19 elf32-microblaze.c
--- bfd/elf32-microblaze.c	18 Dec 2012 16:01:01 -0000	1.19
+++ bfd/elf32-microblaze.c	30 Mar 2013 08:39:10 -0000
@@ -2348,7 +2348,13 @@ microblaze_elf_check_relocs (bfd * abfd,
       if (r_symndx < symtab_hdr->sh_info)
         h = NULL;
       else
-        h = sym_hashes [r_symndx - symtab_hdr->sh_info];
+	{
+	  h = sym_hashes [r_symndx - symtab_hdr->sh_info];
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
+	}
 
       switch (r_type)
         {
Index: bfd/elf32-moxie.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-moxie.c,v
retrieving revision 1.7
diff -u -p -r1.7 elf32-moxie.c
--- bfd/elf32-moxie.c	13 Sep 2012 22:24:49 -0000	1.7
+++ bfd/elf32-moxie.c	30 Mar 2013 08:39:10 -0000
@@ -356,6 +356,10 @@ moxie_elf_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
     }
 
Index: bfd/elf32-msp430.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-msp430.c,v
retrieving revision 1.26
diff -u -p -r1.26 elf32-msp430.c
--- bfd/elf32-msp430.c	15 Jan 2013 08:35:39 -0000	1.26
+++ bfd/elf32-msp430.c	30 Mar 2013 08:39:10 -0000
@@ -266,6 +266,10 @@ elf32_msp430_check_relocs (bfd * abfd, s
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
     }
 
Index: bfd/elf32-mt.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-mt.c,v
retrieving revision 1.17
diff -u -p -r1.17 elf32-mt.c
--- bfd/elf32-mt.c	10 Jan 2013 20:03:53 -0000	1.17
+++ bfd/elf32-mt.c	30 Mar 2013 08:39:10 -0000
@@ -453,6 +453,10 @@ mt_elf_check_relocs
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
     }
 
Index: bfd/elf32-nios2.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-nios2.c,v
retrieving revision 1.4
diff -u -p -r1.4 elf32-nios2.c
--- bfd/elf32-nios2.c	27 Mar 2013 13:37:51 -0000	1.4
+++ bfd/elf32-nios2.c	30 Mar 2013 08:39:10 -0000
@@ -2601,6 +2601,10 @@ nios2_elf32_check_relocs (bfd *abfd, str
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       r_type = ELF32_R_TYPE (rel->r_info);
Index: bfd/elf32-openrisc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-openrisc.c,v
retrieving revision 1.33
diff -u -p -r1.33 elf32-openrisc.c
--- bfd/elf32-openrisc.c	7 May 2012 03:27:50 -0000	1.33
+++ bfd/elf32-openrisc.c	30 Mar 2013 08:39:10 -0000
@@ -486,6 +486,10 @@ openrisc_elf_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       switch (ELF32_R_TYPE (rel->r_info))
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.330
diff -u -p -r1.330 elf32-ppc.c
--- bfd/elf32-ppc.c	28 Mar 2013 07:07:25 -0000	1.330
+++ bfd/elf32-ppc.c	30 Mar 2013 08:39:10 -0000
@@ -3911,6 +3911,10 @@ ppc_elf_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       /* If a relocation refers to _GLOBAL_OFFSET_TABLE_, create the .got.
Index: bfd/elf32-rl78.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-rl78.c,v
retrieving revision 1.12
diff -u -p -r1.12 elf32-rl78.c
--- bfd/elf32-rl78.c	27 Feb 2013 21:39:18 -0000	1.12
+++ bfd/elf32-rl78.c	30 Mar 2013 08:39:10 -0000
@@ -1198,6 +1198,10 @@ rl78_elf_check_relocs
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       switch (ELF32_R_TYPE (rel->r_info))
Index: bfd/elf32-s390.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-s390.c,v
retrieving revision 1.129
diff -u -p -r1.129 elf32-s390.c
--- bfd/elf32-s390.c	27 Mar 2013 13:37:51 -0000	1.129
+++ bfd/elf32-s390.c	30 Mar 2013 08:39:10 -0000
@@ -1026,6 +1026,10 @@ elf_s390_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       /* Create got section and local_got_refcounts array if they
Index: bfd/elf32-score.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-score.c,v
retrieving revision 1.28
diff -u -p -r1.28 elf32-score.c
--- bfd/elf32-score.c	21 Feb 2013 03:02:29 -0000	1.28
+++ bfd/elf32-score.c	30 Mar 2013 08:39:10 -0000
@@ -2837,6 +2837,10 @@ s3_bfd_score_elf_check_relocs (bfd *abfd
             {
               while (h->root.type == bfd_link_hash_indirect)
                 h = (struct elf_link_hash_entry *)h->root.u.i.link;
+
+	      /* PR15323, ref flags aren't set for references in the
+		 same object.  */
+	      h->root.non_ir_ref = 1;
             }
         }
 
Index: bfd/elf32-score7.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-score7.c,v
retrieving revision 1.15
diff -u -p -r1.15 elf32-score7.c
--- bfd/elf32-score7.c	21 Feb 2013 03:02:29 -0000	1.15
+++ bfd/elf32-score7.c	30 Mar 2013 08:39:10 -0000
@@ -2641,6 +2641,10 @@ s7_bfd_score_elf_check_relocs (bfd *abfd
             {
               while (h->root.type == bfd_link_hash_indirect)
                 h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	      /* PR15323, ref flags aren't set for references in the
+		 same object.  */
+	      h->root.non_ir_ref = 1;
             }
         }
 
Index: bfd/elf32-sh.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sh.c,v
retrieving revision 1.188
diff -u -p -r1.188 elf32-sh.c
--- bfd/elf32-sh.c	28 Mar 2013 23:52:44 -0000	1.188
+++ bfd/elf32-sh.c	30 Mar 2013 08:39:11 -0000
@@ -6031,6 +6031,10 @@ sh_elf_check_relocs (bfd *abfd, struct b
 #endif
 	      h = (struct elf_link_hash_entry *) h->root.u.i.link;
 	    }
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       r_type = sh_elf_optimized_tls_reloc (info, r_type, h == NULL);
Index: bfd/elf32-tic6x.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-tic6x.c,v
retrieving revision 1.37
diff -u -p -r1.37 elf32-tic6x.c
--- bfd/elf32-tic6x.c	11 Feb 2013 05:30:54 -0000	1.37
+++ bfd/elf32-tic6x.c	30 Mar 2013 08:39:11 -0000
@@ -2832,6 +2832,10 @@ elf32_tic6x_check_relocs (bfd *abfd, str
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       switch (r_type)
Index: bfd/elf32-tilepro.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-tilepro.c,v
retrieving revision 1.19
diff -u -p -r1.19 elf32-tilepro.c
--- bfd/elf32-tilepro.c	27 Mar 2013 13:37:51 -0000	1.19
+++ bfd/elf32-tilepro.c	30 Mar 2013 08:39:11 -0000
@@ -1521,6 +1521,10 @@ tilepro_elf_check_relocs (bfd *abfd, str
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       r_type = tilepro_elf_tls_transition (info, r_type, h == NULL);
Index: bfd/elf32-v850.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-v850.c,v
retrieving revision 1.87
diff -u -p -r1.87 elf32-v850.c
--- bfd/elf32-v850.c	24 Jan 2013 11:13:59 -0000	1.87
+++ bfd/elf32-v850.c	30 Mar 2013 08:39:11 -0000
@@ -83,6 +83,10 @@ v850_elf_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       r_type = ELF32_R_TYPE (rel->r_info);
Index: bfd/elf32-vax.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-vax.c,v
retrieving revision 1.75
diff -u -p -r1.75 elf32-vax.c
--- bfd/elf32-vax.c	27 Mar 2013 13:37:51 -0000	1.75
+++ bfd/elf32-vax.c	30 Mar 2013 08:39:11 -0000
@@ -585,6 +585,10 @@ elf_vax_check_relocs (bfd *abfd, struct 
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       switch (ELF32_R_TYPE (rel->r_info))
Index: bfd/elf32-xstormy16.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-xstormy16.c,v
retrieving revision 1.46
diff -u -p -r1.46 elf32-xstormy16.c
--- bfd/elf32-xstormy16.c	29 Jun 2012 14:46:01 -0000	1.46
+++ bfd/elf32-xstormy16.c	30 Mar 2013 08:39:11 -0000
@@ -437,6 +437,10 @@ xstormy16_elf_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       switch (ELF32_R_TYPE (rel->r_info))
Index: bfd/elf32-xtensa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-xtensa.c,v
retrieving revision 1.140
diff -u -p -r1.140 elf32-xtensa.c
--- bfd/elf32-xtensa.c	27 Mar 2013 13:37:51 -0000	1.140
+++ bfd/elf32-xtensa.c	30 Mar 2013 08:39:11 -0000
@@ -1007,6 +1007,10 @@ elf_xtensa_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
       eh = elf_xtensa_hash_entry (h);
 
Index: bfd/elf64-aarch64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-aarch64.c,v
retrieving revision 1.11
diff -u -p -r1.11 elf64-aarch64.c
--- bfd/elf64-aarch64.c	27 Mar 2013 13:37:51 -0000	1.11
+++ bfd/elf64-aarch64.c	30 Mar 2013 08:39:11 -0000
@@ -5192,6 +5192,10 @@ elf64_aarch64_check_relocs (bfd *abfd, s
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       /* Could be done earlier, if h were already available.  */
Index: bfd/elf64-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-alpha.c,v
retrieving revision 1.191
diff -u -p -r1.191 elf64-alpha.c
--- bfd/elf64-alpha.c	27 Mar 2013 13:37:51 -0000	1.191
+++ bfd/elf64-alpha.c	30 Mar 2013 08:39:12 -0000
@@ -1812,6 +1812,9 @@ elf64_alpha_check_relocs (bfd *abfd, str
 		 || h->root.root.type == bfd_link_hash_warning)
 	    h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link;
 
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.root.non_ir_ref = 1;
 	  h->root.ref_regular = 1;
 	}
 
Index: bfd/elf64-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-hppa.c,v
retrieving revision 1.115
diff -u -p -r1.115 elf64-hppa.c
--- bfd/elf64-hppa.c	27 Mar 2013 13:37:51 -0000	1.115
+++ bfd/elf64-hppa.c	30 Mar 2013 08:39:12 -0000
@@ -644,6 +644,9 @@ elf64_hppa_check_relocs (bfd *abfd,
 		 || hh->eh.root.type == bfd_link_hash_warning)
 	    hh = hppa_elf_hash_entry (hh->eh.root.u.i.link);
 
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  hh->eh.root.non_ir_ref = 1;
 	  hh->eh.ref_regular = 1;
 	}
       else
Index: bfd/elf64-ia64-vms.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ia64-vms.c,v
retrieving revision 1.9
diff -u -p -r1.9 elf64-ia64-vms.c
--- bfd/elf64-ia64-vms.c	27 Mar 2013 13:37:51 -0000	1.9
+++ bfd/elf64-ia64-vms.c	30 Mar 2013 08:39:12 -0000
@@ -2095,6 +2095,9 @@ elf64_ia64_check_relocs (bfd *abfd, stru
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	  h->ref_regular = 1;
 	}
       else
Index: bfd/elf64-mmix.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-mmix.c,v
retrieving revision 1.68
diff -u -p -r1.68 elf64-mmix.c
--- bfd/elf64-mmix.c	13 Jul 2012 14:22:47 -0000	1.68
+++ bfd/elf64-mmix.c	30 Mar 2013 08:39:12 -0000
@@ -2009,6 +2009,10 @@ mmix_elf_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       switch (ELF64_R_TYPE (rel->r_info))
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.407
diff -u -p -r1.407 elf64-ppc.c
--- bfd/elf64-ppc.c	28 Mar 2013 13:36:32 -0000	1.407
+++ bfd/elf64-ppc.c	30 Mar 2013 08:39:12 -0000
@@ -5004,6 +5004,10 @@ ppc64_elf_check_relocs (bfd *abfd, struc
 	{
 	  h = sym_hashes[r_symndx - symtab_hdr->sh_info];
 	  h = elf_follow_link (h);
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       tls_type = 0;
Index: bfd/elf64-s390.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-s390.c,v
retrieving revision 1.127
diff -u -p -r1.127 elf64-s390.c
--- bfd/elf64-s390.c	27 Mar 2013 13:37:51 -0000	1.127
+++ bfd/elf64-s390.c	30 Mar 2013 08:39:12 -0000
@@ -950,6 +950,10 @@ elf_s390_check_relocs (bfd *abfd,
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       /* Create got section and local_got_refcounts array if they
Index: bfd/elf64-sh64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-sh64.c,v
retrieving revision 1.95
diff -u -p -r1.95 elf64-sh64.c
--- bfd/elf64-sh64.c	10 Feb 2013 04:36:32 -0000	1.95
+++ bfd/elf64-sh64.c	30 Mar 2013 08:39:12 -0000
@@ -2424,6 +2424,10 @@ sh_elf64_check_relocs (bfd *abfd, struct
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       /* Some relocs require a global offset table.  */
Index: bfd/elfnn-ia64.c
===================================================================
RCS file: /cvs/src/src/bfd/elfnn-ia64.c,v
retrieving revision 1.15
diff -u -p -r1.15 elfnn-ia64.c
--- bfd/elfnn-ia64.c	27 Mar 2013 13:37:51 -0000	1.15
+++ bfd/elfnn-ia64.c	30 Mar 2013 08:39:12 -0000
@@ -2352,6 +2352,9 @@ elfNN_ia64_check_relocs (bfd *abfd, stru
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	  h->ref_regular = 1;
 	}
       else
Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.351
diff -u -p -r1.351 elfxx-mips.c
--- bfd/elfxx-mips.c	8 Mar 2013 11:50:27 -0000	1.351
+++ bfd/elfxx-mips.c	30 Mar 2013 08:39:13 -0000
@@ -7814,10 +7814,16 @@ _bfd_mips_elf_check_relocs (bfd *abfd, s
       else
 	{
 	  h = sym_hashes[r_symndx - extsymoff];
-	  while (h != NULL
-		 && (h->root.type == bfd_link_hash_indirect
-		     || h->root.type == bfd_link_hash_warning))
-	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+	  if (h != NULL)
+	    {
+	      while (h->root.type == bfd_link_hash_indirect
+		     || h->root.type == bfd_link_hash_warning)
+		h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	      /* PR15323, ref flags aren't set for references in the
+		 same object.  */
+	      h->root.non_ir_ref = 1;
+	    }
 	}
 
       /* Set CAN_MAKE_DYNAMIC_P to true if we can convert this
Index: bfd/elfxx-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-sparc.c,v
retrieving revision 1.73
diff -u -p -r1.73 elfxx-sparc.c
--- bfd/elfxx-sparc.c	22 Mar 2013 15:54:21 -0000	1.73
+++ bfd/elfxx-sparc.c	30 Mar 2013 08:39:13 -0000
@@ -1450,6 +1450,10 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, 
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       if (h && h->type == STT_GNU_IFUNC)
Index: bfd/elfxx-tilegx.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-tilegx.c,v
retrieving revision 1.20
diff -u -p -r1.20 elfxx-tilegx.c
--- bfd/elfxx-tilegx.c	27 Mar 2013 13:37:51 -0000	1.20
+++ bfd/elfxx-tilegx.c	30 Mar 2013 08:39:13 -0000
@@ -1738,6 +1738,10 @@ tilegx_elf_check_relocs (bfd *abfd, stru
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+	  /* PR15323, ref flags aren't set for references in the same
+	     object.  */
+	  h->root.non_ir_ref = 1;
 	}
 
       r_type = tilegx_elf_tls_transition (info, r_type, h == NULL,
Index: ld/testsuite/ld-plugin/lto.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-plugin/lto.exp,v
retrieving revision 1.6
diff -u -p -r1.6 lto.exp
--- ld/testsuite/ld-plugin/lto.exp	30 Mar 2013 00:38:39 -0000	1.6
+++ ld/testsuite/ld-plugin/lto.exp	30 Mar 2013 08:39:15 -0000
@@ -144,8 +144,8 @@ set lto_link_tests {
    "-flto -fuse-linker-plugin -Wl,--as-needed" "-flto"
    {pr13287.cc} {} "pr13287.exe" "c++"}
   {"PR ld/15323"
-   "-O2 -flto -fuse-linker-plugin -r -nostdlib" "-O2 -flto"
-   {pr15323a.c} {} "pr15323a-r.o" "c"}
+   "" "-O2"
+   {pr15323a.c} {} "libdummy.a" "c"}
 }
 
 # Generate input files for complex LTO tests for ELF.
@@ -270,7 +270,7 @@ set lto_run_tests {
    "-O2 -flto -fuse-linker-plugin -Wl,--as-needed tmpdir/pr13201.o -lm" ""
    {dummy.c} "pr13201.exe" "pr13201.out" "" "c"}
   {"PR ld/15323"
-   "-O2 -flto -fuse-linker-plugin -Wl,--as-needed tmpdir/pr15323a-r.o" ""
+   "-O2 -flto -fuse-linker-plugin tmpdir/pr15323a.o" ""
    {pr15323b.c} "pr15323.exe" "pr15323.out" "-flto -O2" "c"}
 }
 

-- 
Alan Modra
Australia Development Lab, IBM


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