From 4e591bc17f3673b8ce16210891aa9557e2bd5a9f Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Fri, 25 May 2007 23:06:11 +0000 Subject: [PATCH] 2007-05-25 Eric Christopher * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Check that sym_sec isn't NULL before accessing. --- bfd/ChangeLog | 17 +++++++++++------ bfd/elf-eh-frame.c | 5 +++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d0f11413cf1..37c21ddd6e7 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2007-05-25 Eric Christopher + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): + Check that sym_sec isn't NULL before accessing. + 2007-05-24 Steve Ellcey * Makefile.in: Regnerate. @@ -270,7 +275,7 @@ * elf32-xtensa.c (xtensa_read_table_entries): Step through table contents and relocs in parallel. - + 2007-04-27 Bob Wilson * elf32-xtensa.c (relax_property_section): Remove extra irel increment. @@ -416,12 +421,12 @@ duplicating section name comparisons. (xtensa_is_littable_section): Use CONST_STRNEQ for ".gnu.linkonce.p.". (xtensa_get_property_predef_flags): Use xtensa_is_insntable_section. - + 2007-04-12 Bob Wilson - + * elf32-xtensa.c (elf_xtensa_gc_mark_hook): Don't follow references from Xtensa property sections. - + 2007-04-12 Alan Modra * elf32-spu.c (needs_ovl_stub): Test that spu_elf_section_data @@ -438,7 +443,7 @@ (elf64_alpha_size_got_sections): Remove unused something_changed local. (elf64_alpha_size_plt_section): Return void. (elf64_alpha_size_rela_got_section): Likewise. - (elf64_alpha_relax_section): Only regenerate got+plt if the + (elf64_alpha_relax_section): Only regenerate got+plt if the relax_trip counter has changed. 2007-04-09 Daniel Jacobowitz @@ -450,7 +455,7 @@ 2007-04-03 Matt Thomas - * elf32-vax.c (elf_vax_relocate_section): Do not emit a PCREL reloc + * elf32-vax.c (elf_vax_relocate_section): Do not emit a PCREL reloc in a shared object if it is not in a CODE section or if it is against a section symbol. This allows DWARF2 to use pcrel format. diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index c7cb1d754eb..4fc91d2c776 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -712,7 +712,8 @@ _bfd_elf_discard_section_eh_frame sym = &cookie->locsyms[r_symndx]; sym_sec = (bfd_section_from_elf_index (abfd, sym->st_shndx)); - if (sym_sec->kept_section != NULL) + if (sym_sec != NULL + && sym_sec->kept_section != NULL) sym_sec = sym_sec->kept_section; if (sym_sec != NULL && sym_sec->output_section != NULL) @@ -1476,7 +1477,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, /* We don't align the section to its section alignment since the runtime library only expects all CIE/FDE records aligned at - the pointer size. _bfd_elf_discard_section_eh_frame should + the pointer size. _bfd_elf_discard_section_eh_frame should have padded CIE/FDE records to multiple of pointer size with size_of_output_cie_fde. */ if ((sec->size % ptr_size) != 0) -- 2.30.2