summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-10-21 20:44:38 +1030
committerAlan Modra <amodra@gmail.com>2014-10-28 16:55:35 +1030
commita809b386e59dfcb3f4dedd8465975dabc55db5db (patch)
tree55b7e51039a7410fb87e07559aa97ed56cc2f40a /bfd
parent2609fe3d3f84ce62b373daa56ba615465c2d5293 (diff)
downloadbinutils-a809b386e59dfcb3f4dedd8465975dabc55db5db.tar.gz
binutils-a809b386e59dfcb3f4dedd8465975dabc55db5db.tar.bz2
binutils-a809b386e59dfcb3f4dedd8465975dabc55db5db.zip
Relax ppc64_elf_tls_optimize assertion
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/elf64-ppc.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 35cc99142c3..518e77ac163 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -2,6 +2,10 @@
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.
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index e3c06eb00b4..0b65ab19cba 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -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