]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* elf32-ppc.c (ppc_elf_relocate_section): Assert that dynindx is
authorMaciej W. Rozycki <macro@linux-mips.org>
Tue, 28 Aug 2012 20:17:56 +0000 (20:17 +0000)
committerMaciej W. Rozycki <macro@linux-mips.org>
Tue, 28 Aug 2012 20:17:56 +0000 (20:17 +0000)
not minus one.
* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.

bfd/ChangeLog
bfd/elf32-ppc.c
bfd/elf64-ppc.c

index e3ddd6ffdbbf9be461d891bfe2e04402644a8cac..3ec6b2f197ebbcd62bcbad4ebd28012b9bebd122 100644 (file)
@@ -1,3 +1,9 @@
+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
index 779ca6d25b41ba2f3237b48a669667f855836bd7..3d55ac42d9393a3fe26d9862e6e3e23812e92734 100644 (file)
@@ -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;
index 50dad3b10e64ffe9d1abae32a252fbbbd7fd1a3f..71403c36f1297f81095172060b148b5ebc7a89e8 100644 (file)
@@ -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,