From 9d8e8f445c1a021a1e381f4bd0bbc756b4258038 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 4 Apr 2018 12:13:05 +0200 Subject: Speed up direct linking with DLLs on Windows (2/2). This patch deals with the generation of the import library on the fly. The implementation is inefficient because the linker makes a lot of calls to realloc and memmove when importing the symbols in order to maintain a sorted list of symbols. This is fixable by relying on the fact that, for every linked DLL, the list of symbols it exports is already sorted so you can import them en masse once you have found the insertion point. ld/ * deffile.h (def_file_add_import_from): Declare. (def_file_add_import_at): Likewise. * deffilep.y (fill_in_import): New function extracted from... (def_file_add_import): ...here. Call it. (def_file_add_import_from): New function. (def_file_add_import_at): Likewise. * pe-dll.c (pe_implied_import_dll): Use an optimized version of the insertion loop for imported symbols if possible. --- ld/ChangeLog | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ld/ChangeLog') diff --git a/ld/ChangeLog b/ld/ChangeLog index b1a1dda..c6f85ff 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,16 @@ 2018-04-04 Eric Botcazou + * deffile.h (def_file_add_import_from): Declare. + (def_file_add_import_at): Likewise. + * deffilep.y (fill_in_import): New function extracted from... + (def_file_add_import): ...here. Call it. + (def_file_add_import_from): New function. + (def_file_add_import_at): Likewise. + * pe-dll.c (pe_implied_import_dll): Use an optimized version of the + insertion loop for imported symbols if possible. + +2018-04-04 Eric Botcazou + * emultempl/pe.em (U_SIZE): Delete. (pe_data_import_dll): Likewise. (make_import_fixup): Return void, take 4th parameter and pass it down -- cgit v1.1