summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2012-08-28 20:17:56 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2012-08-28 20:17:56 +0000
commit14acf4dcaee3b0cee94b481b220d38fc4ff6ae5c (patch)
treec7cf539df9d8e22192c8c487872ca8681eb1f990
parentaed81c4e9cc4f24eba4da3564f0e99bd667188c7 (diff)
downloadppe42-binutils-14acf4dcaee3b0cee94b481b220d38fc4ff6ae5c.tar.gz
ppe42-binutils-14acf4dcaee3b0cee94b481b220d38fc4ff6ae5c.zip
* elf32-ppc.c (ppc_elf_relocate_section): Assert that dynindx is
not minus one. * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-ppc.c2
-rw-r--r--bfd/elf64-ppc.c6
3 files changed, 13 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e3ddd6ffdb..3ec6b2f197 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
2012-08-28 Maciej W. Rozycki <macro@codesourcery.com>
+ * elf32-ppc.c (ppc_elf_relocate_section): Assert that dynindx is
+ not minus one.
+ * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
+
+2012-08-28 Maciej W. Rozycki <macro@codesourcery.com>
+
* elflink.c (_bfd_elf_merge_symbol): Also override the version
a dynamic symbol defaulted to if preempted with a hidden or
internal definition.
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 779ca6d25b..3d55ac42d9 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -7826,6 +7826,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
;
else
{
+ BFD_ASSERT (h->dynindx != -1);
indx = h->dynindx;
unresolved_reloc = FALSE;
}
@@ -8176,6 +8177,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
|| h->root.type == bfd_link_hash_undefweak))
|| !SYMBOL_REFERENCES_LOCAL (info, h))
{
+ BFD_ASSERT (h->dynindx != -1);
unresolved_reloc = FALSE;
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
outrel.r_addend = rel->r_addend;
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 50dad3b10e..71403c36f1 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -13118,6 +13118,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
;
else
{
+ BFD_ASSERT (h->elf.dynindx != -1);
indx = h->elf.dynindx;
unresolved_reloc = FALSE;
}
@@ -13490,7 +13491,10 @@ ppc64_elf_relocate_section (bfd *output_bfd,
else if (!SYMBOL_CALLS_LOCAL (info, &h->elf)
&& !is_opd
&& r_type != R_PPC64_TOC)
- outrel.r_info = ELF64_R_INFO (h->elf.dynindx, r_type);
+ {
+ BFD_ASSERT (h->elf.dynindx != -1);
+ outrel.r_info = ELF64_R_INFO (h->elf.dynindx, r_type);
+ }
else
{
/* This symbol is local, or marked to become local,
OpenPOWER on IntegriCloud