diff options
author | Steve Chamberlain <sac@cygnus> | 1995-08-22 06:54:07 +0000 |
---|---|---|
committer | Steve Chamberlain <sac@cygnus> | 1995-08-22 06:54:07 +0000 |
commit | 9162a94effd932637e786fa7a103ba01b57b5715 (patch) | |
tree | e727d0633eca70bed4cde8dbd46a86ba2acac48a /bfd/coffcode.h | |
parent | bed1eef3b64270b0f1463a4d206c7742259ac4a2 (diff) | |
download | gdb-9162a94effd932637e786fa7a103ba01b57b5715.zip gdb-9162a94effd932637e786fa7a103ba01b57b5715.tar.gz gdb-9162a94effd932637e786fa7a103ba01b57b5715.tar.bz2 |
(coff_write_object_contents): Initialze link_data if not set.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r-- | bfd/coffcode.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 08964fc..f155ce2 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1879,16 +1879,26 @@ coff_write_object_contents (abfd) #ifdef COFF_IMAGE_WITH_PE struct internal_extra_pe_aouthdr extra_a; struct internal_extra_pe_filehdr extra_f; - - bfd_link_pe_info *pe_info = coff_data (abfd)->link_info->pe_info; bfd_link_pe_info defs; + struct bfd_link_info dummy_info; + struct bfd_link_info *info ; + struct bfd_link_pe_info *pe_info; + + if (coff_data (abfd)->link_info) + info =coff_data (abfd)->link_info; + else + { + coff_data (abfd)->link_info = info = &dummy_info; + info->pe_info = 0; + } + pe_info = info->pe_info; + if (!pe_info) { /* Just use sensible defaults */ memset (&defs, 0, sizeof (defs)); coff_data (abfd)->link_info->pe_info = &defs; } - #endif bfd_set_error (bfd_error_system_call); |