summaryrefslogtreecommitdiff
path: root/bfd/elf-eh-frame.c
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2007-05-25 23:06:11 +0000
committerEric Christopher <echristo@apple.com>2007-05-25 23:06:11 +0000
commitf6bafc9b1f0d7ff5b33d60d1747edf9a43a61e64 (patch)
tree2d3fb8ea7a7157b79f6051544826f918b60ac5d6 /bfd/elf-eh-frame.c
parent485c43b633ba1b9e6428e92d15aa11206fc866b1 (diff)
downloadbinutils-redhat-f6bafc9b1f0d7ff5b33d60d1747edf9a43a61e64.tar.gz
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 c7cb1d754e..4fc91d2c77 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)