diff options
author | Jeremy Drake <sourceware-bugzilla@jdrake.com> | 2020-09-30 10:50:46 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-09-30 10:50:46 +0100 |
commit | 51dee44b37c4254e6b6a016b062c23b8e1f9ca33 (patch) | |
tree | 9b30407380ff7a8dcd8be4061b67a71b8b8428ea /ld | |
parent | e37c930f9e4ad20901493608f276011999efdf8f (diff) | |
download | gdb-51dee44b37c4254e6b6a016b062c23b8e1f9ca33.zip gdb-51dee44b37c4254e6b6a016b062c23b8e1f9ca33.tar.gz gdb-51dee44b37c4254e6b6a016b062c23b8e1f9ca33.tar.bz2 |
After preventing creating an import library for an exe when there are no exports, to avoid a crash, it turned out that some projects expected to be able to create an import library for a dll with no exports, so more closely match the condition to the condition around initializing the dll name.
PR 26588
* emultempl/pe.em (_finish): Generate an import library for DLLs,
even if they have no exports.
* emultempl/pep.em (_finish): Likewise.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 7 | ||||
-rw-r--r-- | ld/emultempl/pe.em | 3 | ||||
-rw-r--r-- | ld/emultempl/pep.em | 3 |
3 files changed, 11 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 5cf876a..3692527 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2020-09-30 Jeremy Drake <sourceware-bugzilla@jdrake.com> + + PR 26588 + * emultempl/pe.em (_finish): Generate an import library for DLLs, + even if they have no exports. + * emultempl/pep.em (_finish): Likewise. + 2020-09-28 Alan Modra <amodra@gmail.com> * testsuite/ld-powerpc/tlsget.d, diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 22993c5..00db3d0 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -1997,7 +1997,8 @@ gld_${EMULATION_NAME}_finish (void) { pe_dll_fill_sections (link_info.output_bfd, &link_info); if (command_line.out_implib_filename - && pe_def_file->num_exports != 0) + && (pe_def_file->num_exports != 0 + || bfd_link_pic (&link_info))) pe_dll_generate_implib (pe_def_file, command_line.out_implib_filename, &link_info); } diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index b0a0471..2f4bdfb 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -1824,7 +1824,8 @@ gld_${EMULATION_NAME}_finish (void) { pep_dll_fill_sections (link_info.output_bfd, &link_info); if (command_line.out_implib_filename - && pep_def_file->num_exports != 0) + && (pep_def_file->num_exports != 0 + || bfd_link_pic (&link_info))) pep_dll_generate_implib (pep_def_file, command_line.out_implib_filename, &link_info); } |