summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2007-09-26 13:45:32 +0000
committerJan Beulich <jbeulich@novell.com>2007-09-26 13:45:32 +0000
commit66f4923e7d7ff15b8d480814f628aff194c74d29 (patch)
treed71eb84cd0ccb6696b817bc9bee2f72e09102af9 /bfd
parent959175c5f0277ffff0e1d64d9e41fa0dfbd80159 (diff)
downloadgdb-66f4923e7d7ff15b8d480814f628aff194c74d29.tar.gz
bfd/
2007-09-26 Jan Beulich <jbeulich@novell.com> * elf32-i386.c (elf_i386_check_relocs): Revert NULL pointer check for R_386_GNU_VTINHERIT. * elf-m10300.c (mn10300_elf_check_relocs): Check for NULL pointer for R_xxx_GNU_VTENTRY. * elf32-arm.c (elf32_arm_check_relocs): Likewise. * elf32-bfin.c (bfin_check_relocs): Likewise. (bfinfdpic_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-iq2000.c (iq2000_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-openrisc.c (openrisc_elf_check_relocs): Likewise. * elf32-ppc.c (ppc_elf_check_relocs): Likewise. * elf32-s390.c (elf_s390_check_relocs): Likewise. * elf32-score.c (_bfd_score_elf_check_relocs): Likewise. * elf32-sh.c (sh_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-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. * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog37
-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-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-i386.c4
-rw-r--r--bfd/elf32-iq2000.c4
-rw-r--r--bfd/elf32-m32r.c8
-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-openrisc.c4
-rw-r--r--bfd/elf32-ppc.c4
-rw-r--r--bfd/elf32-s390.c4
-rw-r--r--bfd/elf32-score.c4
-rw-r--r--bfd/elf32-sh.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-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/elf64-x86-64.c4
-rw-r--r--bfd/elfxx-mips.c4
-rw-r--r--bfd/elfxx-sparc.c4
32 files changed, 134 insertions, 35 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index afbd748ebc3..1cfdec4c358 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,40 @@
+2007-09-26 Jan Beulich <jbeulich@novell.com>
+
+ * elf32-i386.c (elf_i386_check_relocs): Revert NULL pointer
+ check for R_386_GNU_VTINHERIT.
+ * elf-m10300.c (mn10300_elf_check_relocs): Check for NULL
+ pointer for R_xxx_GNU_VTENTRY.
+ * elf32-arm.c (elf32_arm_check_relocs): Likewise.
+ * elf32-bfin.c (bfin_check_relocs): Likewise.
+ (bfinfdpic_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-iq2000.c (iq2000_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-openrisc.c (openrisc_elf_check_relocs): Likewise.
+ * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
+ * elf32-s390.c (elf_s390_check_relocs): Likewise.
+ * elf32-score.c (_bfd_score_elf_check_relocs): Likewise.
+ * elf32-sh.c (sh_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-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.
+ * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
+ * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
+ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
+
2007-09-26 Alan Modra <amodra@bigpond.net.au>
* elflink.c (set_symbol_value): Add isymbuf and locsymcount
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index 2b309e5af98..39cbf4d79f6 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -758,7 +758,9 @@ mn10300_elf_check_relocs (abfd, info, sec, relocs)
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_MN10300_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
case R_MN10300_GOT32:
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 9c6130f6cc1..53692e67d11 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -7795,7 +7795,9 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_ARM_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
return FALSE;
break;
}
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index 68f3712f647..f13a557631e 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -1979,7 +1979,9 @@ bfin_check_relocs (bfd * abfd,
/* This relocation describes which C++ vtable entries
are actually used. Record for later use during GC. */
case R_BFIN_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
@@ -4671,7 +4673,9 @@ bfinfdpic_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_BFIN_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index dcff1ebcd17..104411a4a48 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -2853,7 +2853,9 @@ cris_elf_check_relocs (abfd, info, sec, relocs)
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_CRIS_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c
index 32c4b747440..57b2d3b0a24 100644
--- a/bfd/elf32-d10v.c
+++ b/bfd/elf32-d10v.c
@@ -304,7 +304,9 @@ elf32_d10v_check_relocs (bfd *abfd,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_D10V_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
return FALSE;
break;
}
diff --git a/bfd/elf32-dlx.c b/bfd/elf32-dlx.c
index eebacebe865..3bb1765675e 100644
--- a/bfd/elf32-dlx.c
+++ b/bfd/elf32-dlx.c
@@ -470,7 +470,9 @@ elf32_dlx_check_relocs (bfd *abfd,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_DLX_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
}
diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c
index 777a41c8a11..d9051bce6d0 100644
--- a/bfd/elf32-fr30.c
+++ b/bfd/elf32-fr30.c
@@ -716,7 +716,9 @@ fr30_elf_check_relocs (abfd, info, sec, relocs)
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_FR30_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
}
diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
index 2aff005066b..9aba5c3df00 100644
--- a/bfd/elf32-frv.c
+++ b/bfd/elf32-frv.c
@@ -6400,7 +6400,9 @@ elf32_frv_check_relocs (abfd, info, sec, relocs)
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_FRV_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index a99cf0a02ef..0da7e6d06d1 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -1278,7 +1278,9 @@ elf32_hppa_check_relocs (bfd *abfd,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_PARISC_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, &hh->eh, rela->r_addend))
+ BFD_ASSERT (hh != NULL);
+ if (hh != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, &hh->eh, rela->r_addend))
return FALSE;
continue;
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 543ea21b7ad..62c4eb76bac 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1544,9 +1544,7 @@ elf_i386_check_relocs (bfd *abfd,
/* This relocation describes the C++ object vtable hierarchy.
Reconstruct it for later use during GC. */
case R_386_GNU_VTINHERIT:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
return FALSE;
break;
diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c
index 566bebded9c..c162ddc211d 100644
--- a/bfd/elf32-iq2000.c
+++ b/bfd/elf32-iq2000.c
@@ -467,7 +467,9 @@ iq2000_elf_check_relocs (bfd *abfd,
/* This relocation describes which C++ vtable entries
are actually used. Record for later use during GC. */
case R_IQ2000_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index 6a4fd1834e7..38296904376 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -4036,11 +4036,15 @@ m32r_elf_check_relocs (bfd *abfd,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_M32R_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
return FALSE;
break;
case R_M32R_RELA_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
}
diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c
index 5a980df34e8..c7ee78d60a0 100644
--- a/bfd/elf32-m68hc1x.c
+++ b/bfd/elf32-m68hc1x.c
@@ -865,7 +865,9 @@ elf32_m68hc11_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_M68HC11_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
}
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index b48c09cb8d7..57431c99122 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -1042,7 +1042,9 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_68K_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c
index 2eef4b4c45b..32ef86a8702 100644
--- a/bfd/elf32-mcore.c
+++ b/bfd/elf32-mcore.c
@@ -638,7 +638,9 @@ mcore_elf_check_relocs (bfd * abfd,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_MCORE_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
}
diff --git a/bfd/elf32-openrisc.c b/bfd/elf32-openrisc.c
index 874f9226542..510769fec60 100644
--- a/bfd/elf32-openrisc.c
+++ b/bfd/elf32-openrisc.c
@@ -511,7 +511,9 @@ openrisc_elf_check_relocs (bfd *abfd,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_OPENRISC_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
}
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index f876897aa88..68804ad806c 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -3376,7 +3376,9 @@ ppc_elf_check_relocs (bfd *abfd,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_PPC_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 67cc059c559..33aad35c1fe 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -1376,7 +1376,9 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_390_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c
index c10eee62a3e..7d24de054a3 100644
--- a/bfd/elf32-score.c
+++ b/bfd/elf32-score.c
@@ -2683,7 +2683,9 @@ _bfd_score_elf_check_relocs (bfd *abfd,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_SCORE_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
return FALSE;
break;
default:
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index c71354e0b81..a595c02c5c8 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -4959,7 +4959,9 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_SH_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index a5bdc0c8734..422e34ba3ce 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -116,7 +116,9 @@ v850_elf_check_relocs (bfd *abfd,
/* This relocation describes which C++ vtable entries
are actually used. Record for later use during GC. */
case R_V850_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c
index 5f3fffa4cc9..69dbdcda64c 100644
--- a/bfd/elf32-vax.c
+++ b/bfd/elf32-vax.c
@@ -821,7 +821,9 @@ elf_vax_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_VAX_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c
index f9969020784..53c40ad4540 100644
--- a/bfd/elf32-xstormy16.c
+++ b/bfd/elf32-xstormy16.c
@@ -512,7 +512,9 @@ xstormy16_elf_check_relocs (bfd *abfd,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_XSTORMY16_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
}
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index 2ade49f0dd5..ce553d058c7 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -944,7 +944,9 @@ elf_xtensa_check_relocs (bfd *abfd,
case R_XTENSA_GNU_VTENTRY:
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c
index c1d9a30c64b..60d598646d3 100644
--- a/bfd/elf64-mmix.c
+++ b/bfd/elf64-mmix.c
@@ -2029,7 +2029,9 @@ mmix_elf_check_relocs (abfd, info, sec, relocs)
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_MMIX_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
}
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 71c77b5bb27..a1c7d9b20a8 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -4619,7 +4619,9 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_PPC64_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 02dbdececf2..6af39db96ae 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -1344,7 +1344,9 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_390_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c
index bf35ea6c274..0b677349504 100644
--- a/bfd/elf64-sh64.c
+++ b/bfd/elf64-sh64.c
@@ -2508,7 +2508,9 @@ sh_elf64_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_SH_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index c95e2c9a5cf..c0389c63af2 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -1378,7 +1378,9 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_X86_64_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index a4c96e34dbb..b2fcc9c5067 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -6709,7 +6709,9 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_MIPS_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
return FALSE;
break;
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index 1adbc8de113..736f044ab7d 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -1516,7 +1516,9 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
break;
case R_SPARC_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;