PR ld/15323

bfd/
	* 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.
This commit is contained in:
Alan Modra 2013-03-30 10:14:15 +00:00
parent 9993ba115b
commit 81fbe831fe
52 changed files with 269 additions and 10 deletions

View File

@ -1,8 +1,63 @@
2013-03-30 Alan Modra <amodra@gmail.com>
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.
2013-03-29 H.J. Lu <hongjiu.lu@intel.com>
PR ld/15323
* elf32-i386.c (elf_i386_check_relocs): Set non_ir_ref if a
symbol is referenced by a non-shared object.
symbol is referenced by a non-shared object.
* elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2013-03-28 Joe Seymour <jseymour@codesourcery.com>

View File

@ -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);

View File

@ -12465,6 +12465,10 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
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;
}
}

View File

@ -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))
{

View File

@ -725,6 +725,10 @@ cr16_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
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. */

View File

@ -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);

View File

@ -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))

View File

@ -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))

View File

@ -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))

View File

@ -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))

View File

@ -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);

View File

@ -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)

View File

@ -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))

View File

@ -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. */

View File

@ -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))

View File

@ -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. */

View File

@ -871,6 +871,10 @@ elf32_m68hc11_check_relocs (bfd *abfd, struct bfd_link_info *info,
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))

View File

@ -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))

View File

@ -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))

View File

@ -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. */

View File

@ -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)
{

View File

@ -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;
}
}

View File

@ -266,6 +266,10 @@ elf32_msp430_check_relocs (bfd * abfd, struct bfd_link_info * info,
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;
}
}

View File

@ -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;
}
}

View File

@ -2601,6 +2601,10 @@ nios2_elf32_check_relocs (bfd *abfd, struct bfd_link_info *info,
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);

View File

@ -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))

View File

@ -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.

View File

@ -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))

View File

@ -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

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -6031,6 +6031,10 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
#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);

View File

@ -2832,6 +2832,10 @@ elf32_tic6x_check_relocs (bfd *abfd, struct bfd_link_info *info,
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)

View File

@ -1521,6 +1521,10 @@ tilepro_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
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);

View File

@ -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);

View File

@ -585,6 +585,10 @@ elf_vax_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
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))

View File

@ -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))

View File

@ -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);

View File

@ -5192,6 +5192,10 @@ elf64_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
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. */

View File

@ -1812,6 +1812,9 @@ elf64_alpha_check_relocs (bfd *abfd, struct bfd_link_info *info,
|| 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;
}

View File

@ -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

View File

@ -2095,6 +2095,9 @@ elf64_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
|| 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

View File

@ -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))

View File

@ -5004,6 +5004,10 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
{
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;

View File

@ -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

View File

@ -2424,6 +2424,10 @@ sh_elf64_check_relocs (bfd *abfd, struct bfd_link_info *info,
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. */

View File

@ -2352,6 +2352,9 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
|| 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

View File

@ -7814,10 +7814,16 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
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

View File

@ -1450,6 +1450,10 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
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)

View File

@ -1738,6 +1738,10 @@ tilegx_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
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,

View File

@ -1,3 +1,9 @@
2013-03-30 Alan Modra <amodra@gmail.com>
PR ld/15323
* ld-plugin/lto.exp (pr15323a.c): Compile without -flto rather
than using -r to effectively strip out lto info.
2013-03-29 H.J. Lu <hongjiu.lu@intel.com>
PR ld/15323

View File

@ -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"}
}