aboutsummaryrefslogtreecommitdiff
path: root/ld/deffile.h
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2018-04-04 12:13:05 +0200
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-04-04 12:13:05 +0200
commit9d8e8f445c1a021a1e381f4bd0bbc756b4258038 (patch)
tree9c525142c2dce2687d24bda075f470a82f245d44 /ld/deffile.h
parent317ff0084bc68bfae2eabd82015e9239a68b5195 (diff)
downloadgdb-9d8e8f445c1a021a1e381f4bd0bbc756b4258038.zip
gdb-9d8e8f445c1a021a1e381f4bd0bbc756b4258038.tar.gz
gdb-9d8e8f445c1a021a1e381f4bd0bbc756b4258038.tar.bz2
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.
Diffstat (limited to 'ld/deffile.h')
-rw-r--r--ld/deffile.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/ld/deffile.h b/ld/deffile.h
index 9a1e539..4275e71 100644
--- a/ld/deffile.h
+++ b/ld/deffile.h
@@ -108,6 +108,16 @@ extern def_file_export *def_file_add_export (def_file *, const char *,
extern def_file_import *def_file_add_import (def_file *, const char *,
const char *, int, const char *,
const char *, int *);
+extern int def_file_add_import_from (def_file *fdef,
+ int num_imports,
+ const char *name,
+ const char *module,
+ int ordinal,
+ const char *internal_name,
+ const char *its_name);
+extern def_file_import *def_file_add_import_at (def_file *, int, const char *,
+ const char *, int, const char *,
+ const char *);
extern void def_file_add_directive (def_file *, const char *, int);
extern def_file_module *def_get_module (def_file *, const char *);
#ifdef DEF_FILE_PRINT