diff options
author | Nick Clifton <nickc@redhat.com> | 2019-03-06 09:43:15 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2019-03-06 09:43:54 +0000 |
commit | 219d6836e939d2cd1a8c5574bfa3a101daa31cbb (patch) | |
tree | fcb558dbeef3a07afaa31f7b5ea54561d7e37e3c /bfd/coffgen.c | |
parent | aa3cfbda2f2af71044949b5692ce51cafb023d13 (diff) | |
download | gdb-219d6836e939d2cd1a8c5574bfa3a101daa31cbb.zip gdb-219d6836e939d2cd1a8c5574bfa3a101daa31cbb.tar.gz gdb-219d6836e939d2cd1a8c5574bfa3a101daa31cbb.tar.bz2 |
Fix a segmentation fault triggered by disassembling an EFi file with source included.
* dwarf2.c (_bfd_dwarf2_find_symbol_bias): Check for a NULL symbol
table pointer.
* coffgen.c (coff_find_nearest_line_with_names): Do not call
_bfd_dwarf2_find_symbol_bias if there is no symbol table available.
https://bugzilla.redhat.com/show_bug.cgi?id=1685727
Diffstat (limited to 'bfd/coffgen.c')
-rw-r--r-- | bfd/coffgen.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c index 309e124..5f5c5f6 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -2294,7 +2294,7 @@ coff_find_nearest_line_with_names (bfd *abfd, information. So try again, using a bias against the address sought. */ if (coff_data (abfd)->dwarf2_find_line_info != NULL) { - bfd_signed_vma bias; + bfd_signed_vma bias = 0; /* Create a cache of the result for the next call. */ if (sec_data == NULL && section->owner == abfd) @@ -2306,10 +2306,11 @@ coff_find_nearest_line_with_names (bfd *abfd, if (sec_data != NULL && sec_data->saved_bias) bias = sec_data->saved_bias; - else + else if (symbols) { bias = _bfd_dwarf2_find_symbol_bias (symbols, & coff_data (abfd)->dwarf2_find_line_info); + if (sec_data) { sec_data->saved_bias = TRUE; |