]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Relax ppc64_elf_tls_optimize assertion
authorAlan Modra <amodra@gmail.com>
Tue, 21 Oct 2014 10:14:38 +0000 (20:44 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 28 Oct 2014 06:25:35 +0000 (16:55 +1030)
The code in ppc64_elf_tls_optimize looking at the .toc is only
interested in .toc entries that are addresses.  .toc can contain more
than just an array of addresses, so if we have items that aren't
8-byte aligned, ignore them.

* elf64-ppc.c (ppc64_elf_tls_optimize): Ignore relocs against toc
entries that aren't a multiple of 8 rather than failing assertion.

bfd/ChangeLog
bfd/elf64-ppc.c

index 35cc99142c30265b400b557c613c6d127bb2ac83..518e77ac163edef6242a6bfd7beb69bfa2581dca 100644 (file)
@@ -1,6 +1,10 @@
 2014-10-28  Alan Modra  <amodra@gmail.com>
 
        Apply trunk patches
+       2014-10-21  Alan Modra  <amodra@gmail.com>
+       * elf64-ppc.c (ppc64_elf_tls_optimize): Ignore relocs against toc
+       entries that aren't a multiple of 8 rather than failing assertion.
+
        2014-10-21  Alan Modra  <amodra@gmail.com>
        * elf64-ppc.c (ppc64_elf_size_stubs): Add gcc-4.9 libgomp functions
        to thread_starter.
index e3c06eb00b4b2c16dfee363d21eefed3f68545c4..0b65ab19cbaaa64566bb07190f649310b0d2e427 100644 (file)
@@ -8343,7 +8343,10 @@ ppc64_elf_tls_optimize (struct bfd_link_info *info)
                      else
                        value = sym->st_value;
                      value += rel->r_addend;
-                     BFD_ASSERT (value < toc->size && value % 8 == 0);
+                     if (value % 8 != 0)
+                       continue;
+                     BFD_ASSERT (value < toc->size
+                                 && toc->output_offset % 8 == 0);
                      toc_ref_index = (value + toc->output_offset) / 8;
                      if (r_type == R_PPC64_TLS
                          || r_type == R_PPC64_TLSGD