aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-eh-frame.c
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2007-05-25 23:06:11 +0000
committerEric Christopher <echristo@gmail.com>2007-05-25 23:06:11 +0000
commit4e591bc17f3673b8ce16210891aa9557e2bd5a9f (patch)
tree5babb42d5c1b5503d315de6015166d80501e8b35 /bfd/elf-eh-frame.c
parent0e7ef45cfb258a0293685126f10fdaa112b7abfc (diff)
downloadfsf-binutils-gdb-4e591bc17f3673b8ce16210891aa9557e2bd5a9f.zip
fsf-binutils-gdb-4e591bc17f3673b8ce16210891aa9557e2bd5a9f.tar.gz
fsf-binutils-gdb-4e591bc17f3673b8ce16210891aa9557e2bd5a9f.tar.bz2
2007-05-25 Eric Christopher <echristo@apple.com>
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Check that sym_sec isn't NULL before accessing.
Diffstat (limited to 'bfd/elf-eh-frame.c')
-rw-r--r--bfd/elf-eh-frame.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index c7cb1d7..4fc91d2 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)