summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2013-03-30 10:14:14 +0000
committerAlan Modra <amodra@bigpond.net.au>2013-03-30 10:14:14 +0000
commite8c9d323e042eaf76e820d179cf5e04dea96c72c (patch)
treeccf481979f6ad29bd48ac5d0dc41d4471246c640
parentda09b6d00e18aec306d8d44f707829d44ad77c39 (diff)
downloadbinutils-redhat-e8c9d323e042eaf76e820d179cf5e04dea96c72c.tar.gz
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.
-rw-r--r--bfd/ChangeLog57
-rw-r--r--bfd/elf-m10300.c4
-rw-r--r--bfd/elf32-arm.c4
-rw-r--r--bfd/elf32-bfin.c8
-rw-r--r--bfd/elf32-cr16.c4
-rw-r--r--bfd/elf32-cris.c4
-rw-r--r--bfd/elf32-d10v.c4
-rw-r--r--bfd/elf32-dlx.c4
-rw-r--r--bfd/elf32-fr30.c4
-rw-r--r--bfd/elf32-frv.c4
-rw-r--r--bfd/elf32-hppa.c4
-rw-r--r--bfd/elf32-i370.c4
-rw-r--r--bfd/elf32-iq2000.c4
-rw-r--r--bfd/elf32-lm32.c4
-rw-r--r--bfd/elf32-m32c.c4
-rw-r--r--bfd/elf32-m32r.c4
-rw-r--r--bfd/elf32-m68hc1x.c4
-rw-r--r--bfd/elf32-m68k.c4
-rw-r--r--bfd/elf32-mcore.c4
-rw-r--r--bfd/elf32-metag.c4
-rw-r--r--bfd/elf32-microblaze.c8
-rw-r--r--bfd/elf32-moxie.c4
-rw-r--r--bfd/elf32-msp430.c4
-rw-r--r--bfd/elf32-mt.c4
-rw-r--r--bfd/elf32-nios2.c4
-rw-r--r--bfd/elf32-openrisc.c4
-rw-r--r--bfd/elf32-ppc.c4
-rw-r--r--bfd/elf32-rl78.c4
-rw-r--r--bfd/elf32-s390.c4
-rw-r--r--bfd/elf32-score.c4
-rw-r--r--bfd/elf32-score7.c4
-rw-r--r--bfd/elf32-sh.c4
-rw-r--r--bfd/elf32-tic6x.c4
-rw-r--r--bfd/elf32-tilepro.c4
-rw-r--r--bfd/elf32-v850.c4
-rw-r--r--bfd/elf32-vax.c4
-rw-r--r--bfd/elf32-xstormy16.c4
-rw-r--r--bfd/elf32-xtensa.c4
-rw-r--r--bfd/elf64-aarch64.c4
-rw-r--r--bfd/elf64-alpha.c3
-rw-r--r--bfd/elf64-hppa.c3
-rw-r--r--bfd/elf64-ia64-vms.c3
-rw-r--r--bfd/elf64-mmix.c4
-rw-r--r--bfd/elf64-ppc.c4
-rw-r--r--bfd/elf64-s390.c4
-rw-r--r--bfd/elf64-sh64.c4
-rw-r--r--bfd/elfnn-ia64.c3
-rw-r--r--bfd/elfxx-mips.c14
-rw-r--r--bfd/elfxx-sparc.c4
-rw-r--r--bfd/elfxx-tilegx.c4
-rw-r--r--ld/testsuite/ChangeLog6
-rw-r--r--ld/testsuite/ld-plugin/lto.exp6
52 files changed, 269 insertions, 10 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ec62d9128d..ddb4577872 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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>
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index ffd873d7b3..c0a9309b7f 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -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);
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 8e335e745b..9fff630d6b 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -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;
}
}
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index d956da65a5..d3d0f1c86d 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -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))
{
diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c
index 656caffb33..8ed5af1c1b 100644
--- a/bfd/elf32-cr16.c
+++ b/bfd/elf32-cr16.c
@@ -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. */
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index ff2dfe3368..f40a07963b 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -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);
diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c
index 246e5f5165..f75c16ae7e 100644
--- a/bfd/elf32-d10v.c
+++ b/bfd/elf32-d10v.c
@@ -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))
diff --git a/bfd/elf32-dlx.c b/bfd/elf32-dlx.c
index 29b89104e9..1379d3d788 100644
--- a/bfd/elf32-dlx.c
+++ b/bfd/elf32-dlx.c
@@ -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))
diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c
index fe7cf92152..3aed435dd9 100644
--- a/bfd/elf32-fr30.c
+++ b/bfd/elf32-fr30.c
@@ -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))
diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
index efe731c3f3..788c2997e8 100644
--- a/bfd/elf32-frv.c
+++ b/bfd/elf32-frv.c
@@ -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))
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 8d21cee53d..4ffa3d2a78 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -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);
diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c
index 5998db755a..48e25f228a 100644
--- a/bfd/elf32-i370.c
+++ b/bfd/elf32-i370.c
@@ -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)
diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c
index 8cf47758e3..3a90a99698 100644
--- a/bfd/elf32-iq2000.c
+++ b/bfd/elf32-iq2000.c
@@ -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))
diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c
index 6bbbec8a81..df6f346467 100644
--- a/bfd/elf32-lm32.c
+++ b/bfd/elf32-lm32.c
@@ -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. */
diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c
index 88b8dacac1..5205b7b7ce 100644
--- a/bfd/elf32-m32c.c
+++ b/bfd/elf32-m32c.c
@@ -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))
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index 385f4cc87b..789a456ff1 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -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. */
diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c
index 98c2994462..427e3cd2d9 100644
--- a/bfd/elf32-m68hc1x.c
+++ b/bfd/elf32-m68hc1x.c
@@ -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))
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 01b5d67d68..b72bc83cd6 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -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))
diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c
index 288394f783..28ee2c49cf 100644
--- a/bfd/elf32-mcore.c
+++ b/bfd/elf32-mcore.c
@@ -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))
diff --git a/bfd/elf32-metag.c b/bfd/elf32-metag.c
index 8f08bf6cf9..8851845384 100644
--- a/bfd/elf32-metag.c
+++ b/bfd/elf32-metag.c
@@ -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. */
diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
index 8aafe72da2..4a5e80dd86 100644
--- a/bfd/elf32-microblaze.c
+++ b/bfd/elf32-microblaze.c
@@ -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)
{
diff --git a/bfd/elf32-moxie.c b/bfd/elf32-moxie.c
index 9a031b498f..d0cbb0fab4 100644
--- a/bfd/elf32-moxie.c
+++ b/bfd/elf32-moxie.c
@@ -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;
}
}
diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c
index c08f596d1a..b46e72ce05 100644
--- a/bfd/elf32-msp430.c
+++ b/bfd/elf32-msp430.c
@@ -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;
}
}
diff --git a/bfd/elf32-mt.c b/bfd/elf32-mt.c
index ded95c94df..ea05c9117e 100644
--- a/bfd/elf32-mt.c
+++ b/bfd/elf32-mt.c
@@ -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;
}
}
diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
index 91cbce43e8..eb472c16dc 100644
--- a/bfd/elf32-nios2.c
+++ b/bfd/elf32-nios2.c
@@ -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);
diff --git a/bfd/elf32-openrisc.c b/bfd/elf32-openrisc.c
index 2b002abcc7..7abc938bc9 100644
--- a/bfd/elf32-openrisc.c
+++ b/bfd/elf32-openrisc.c
@@ -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))
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index c1b53146a3..f356c959fd 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -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.
diff --git a/bfd/elf32-rl78.c b/bfd/elf32-rl78.c
index ea9a0760d5..2130311059 100644
--- a/bfd/elf32-rl78.c
+++ b/bfd/elf32-rl78.c
@@ -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))
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index fae222eefd..52d4abcca5 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -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
diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c
index dae7f69b3a..47cc98733a 100644
--- a/bfd/elf32-score.c
+++ b/bfd/elf32-score.c
@@ -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;
}
}
diff --git a/bfd/elf32-score7.c b/bfd/elf32-score7.c
index b9b9f30c7f..c75c703848 100644
--- a/bfd/elf32-score7.c
+++ b/bfd/elf32-score7.c
@@ -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;
}
}
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index a4c987ff45..86fe1b3377 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -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);
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
index 8f03003e2f..04ef708b76 100644
--- a/bfd/elf32-tic6x.c
+++ b/bfd/elf32-tic6x.c
@@ -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)
diff --git a/bfd/elf32-tilepro.c b/bfd/elf32-tilepro.c
index 4f13241138..62b9553647 100644
--- a/bfd/elf32-tilepro.c
+++ b/bfd/elf32-tilepro.c
@@ -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);
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index 4590c61755..c0c649874d 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -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);
diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c
index 1208d431e5..f13ec1b78a 100644
--- a/bfd/elf32-vax.c
+++ b/bfd/elf32-vax.c
@@ -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))
diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c
index c657b84a46..851ebbc631 100644
--- a/bfd/elf32-xstormy16.c
+++ b/bfd/elf32-xstormy16.c
@@ -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))
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index b397422994..28ed9aa907 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -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);
diff --git a/bfd/elf64-aarch64.c b/bfd/elf64-aarch64.c
index feb1a006ff..c3b9fc855c 100644
--- a/bfd/elf64-aarch64.c
+++ b/bfd/elf64-aarch64.c
@@ -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. */
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index 81fe6c18b4..b70505040f 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -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;
}
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index b2f0ed150a..aff87f0d17 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -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
diff --git a/bfd/elf64-ia64-vms.c b/bfd/elf64-ia64-vms.c
index 20b456e7f0..102cdff8d9 100644
--- a/bfd/elf64-ia64-vms.c
+++ b/bfd/elf64-ia64-vms.c
@@ -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
diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c
index 3195075f00..499bcd609a 100644
--- a/bfd/elf64-mmix.c
+++ b/bfd/elf64-mmix.c
@@ -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))
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 2826d83f61..a4d483a9fa 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -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;
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index d939a3d68b..f2c396f5dd 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -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
diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c
index 7a9297cf32..e70887bdfc 100644
--- a/bfd/elf64-sh64.c
+++ b/bfd/elf64-sh64.c
@@ -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. */
diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c
index 8de94e4751..05c2f1b4db 100644
--- a/bfd/elfnn-ia64.c
+++ b/bfd/elfnn-ia64.c
@@ -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
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index a5ad454a79..317e7b254f 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -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
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index 596c8384bb..ba001056af 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -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)
diff --git a/bfd/elfxx-tilegx.c b/bfd/elfxx-tilegx.c
index accf34b33c..74afdf8774 100644
--- a/bfd/elfxx-tilegx.c
+++ b/bfd/elfxx-tilegx.c
@@ -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,
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index a4b272f330..869bb70c9b 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -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
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index cf1ddf3c3a..7ffe955409 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -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"}
}