From f2d3750dc9a4ea6556b6d945d4a3d043a8843572 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 28 Sep 2004 15:00:45 +0000 Subject: [PATCH] * emultempl/pe.em (gld_${EMULATION_NAME}_unrecognized_file): Allow def_file_parse to handle pe_def_file if NULL and prevent crash with invalid .def files. --- ld/ChangeLog | 6 ++++++ ld/emultempl/pe.em | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 698b3ad12d8..68f359de5b0 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2004-09-27 Filip Navara + + * emultempl/pe.em (gld_${EMULATION_NAME}_unrecognized_file): Allow + def_file_parse to handle pe_def_file if NULL and prevent crash with + invalid .def files. + 2004-09-27 Alan Modra * emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Enable diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 318eb7c2bf9..9ff5c9c9b82 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -1293,10 +1293,7 @@ gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIB if (strcmp (ext, ".def") == 0 || strcmp (ext, ".DEF") == 0) { - if (pe_def_file == 0) - pe_def_file = def_file_empty (); - - def_file_parse (entry->filename, pe_def_file); + pe_def_file = def_file_parse (entry->filename, pe_def_file); if (pe_def_file) {