aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-06-27 08:37:22 +0000
committerAlan Modra <amodra@gmail.com>2010-06-27 08:37:22 +0000
commit6bee8834bf2941010b7587b7d76a7f162cef1e37 (patch)
treea3ee9424c522453eb3912a07c7fd2271839d1a8c /bfd
parente5ca47baff1a8d8e3113d0a41d1340357c91e4c3 (diff)
downloadfsf-binutils-gdb-6bee8834bf2941010b7587b7d76a7f162cef1e37.zip
fsf-binutils-gdb-6bee8834bf2941010b7587b7d76a7f162cef1e37.tar.gz
fsf-binutils-gdb-6bee8834bf2941010b7587b7d76a7f162cef1e37.tar.bz2
* elf64-ppc.c (get_tls_mask): Don't segfault on NULL elf_section_data.
(group_sections): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf64-ppc.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2369ad2..631aa4b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2010-06-27 Alan Modra <amodra@gmail.com>
+ * elf64-ppc.c (get_tls_mask): Don't segfault on NULL elf_section_data.
+ (group_sections): Likewise.
+
+2010-06-27 Alan Modra <amodra@gmail.com>
+
* bout.c (aligncode): Delete set but unused variables.
* coff-mcore.c (coff_mcore_relocate_section): Likewise.
* coff-ppc.c (ppc_record_toc_entry): Likewise.
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 90a2518..97d607b 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -6689,6 +6689,7 @@ get_tls_mask (unsigned char **tls_maskp,
if ((*tls_maskp != NULL && **tls_maskp != 0)
|| sec == NULL
+ || ppc64_elf_section_data (sec) == NULL
|| ppc64_elf_section_data (sec)->sec_type != sec_toc)
return 1;
@@ -10666,7 +10667,8 @@ group_sections (struct ppc_link_hash_table *htab,
curr = tail;
total = tail->size;
- big_sec = total > (ppc64_elf_section_data (tail)->has_14bit_branch
+ big_sec = total > (ppc64_elf_section_data (tail) != NULL
+ && ppc64_elf_section_data (tail)->has_14bit_branch
? stub14_group_size : stub_group_size);
if (big_sec && !suppress_size_errors)
(*_bfd_error_handler) (_("%B section %A exceeds stub group size"),
@@ -10675,7 +10677,8 @@ group_sections (struct ppc_link_hash_table *htab,
while ((prev = PREV_SEC (curr)) != NULL
&& ((total += curr->output_offset - prev->output_offset)
- < (ppc64_elf_section_data (prev)->has_14bit_branch
+ < (ppc64_elf_section_data (prev) != NULL
+ && ppc64_elf_section_data (prev)->has_14bit_branch
? stub14_group_size : stub_group_size))
&& htab->stub_group[prev->id].toc_off == curr_toc)
curr = prev;
@@ -10708,7 +10711,8 @@ group_sections (struct ppc_link_hash_table *htab,
total = 0;
while (prev != NULL
&& ((total += tail->output_offset - prev->output_offset)
- < (ppc64_elf_section_data (prev)->has_14bit_branch
+ < (ppc64_elf_section_data (prev) != NULL
+ && ppc64_elf_section_data (prev)->has_14bit_branch
? stub14_group_size : stub_group_size))
&& htab->stub_group[prev->id].toc_off == curr_toc)
{