diff options
author | Christopher Faylor <me@cgf.cx> | 2011-05-29 00:17:09 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-05-29 00:17:09 +0400 |
commit | a92339ab635febf6ce9873fecca6f3d113dbb3b5 (patch) | |
tree | d0fba808521f5ad5806afdaa0f1660a2407e6768 /winsup/cygwin/fork.cc | |
parent | 855108782321cee83378b069fe89343f191ba28c (diff) |
* dll_init.cc (dll_list::find_by_modname): New function to search the dll list
for a module name only (no path).
(dll_list::alloc): Initialize newly-added members of struct dll.
(dll_list::append): New function to factor out the append operation
(used by dll_list::topsort).
(dll_list::populate_deps): New function to identify dll dependencies.
(dll_list::topsort): New function to sort the dll list topologically by
dependencies.
(dll_list::topsort_visit): New helper function for the above.
* dll_init.h (dll::ndeps): New class member.
(dll::deps): Ditto.
(dll::modname): Ditto.
(dll_list::find_by_modname): New function related to topsort.
(dll_list::populate_all_deps): Ditto.
(dll_list::populate_deps): Ditto.
(dll_list::topsort): Ditto.
(dll_list::topsort_visit): Ditto.
(dll_list::append): Ditto.
(pefile): New struct allowing simple introspection of dll images.
* fork.cc (fork): Topologically sort the dll list before forking.
Diffstat (limited to 'winsup/cygwin/fork.cc')
-rw-r--r-- | winsup/cygwin/fork.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index 3ec7fa8c5..1ac2b8a45 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -625,7 +625,7 @@ fork () the thread-local storage. A process forking too deeply will run into the problem to be out of temporary TLS path buffers. */ tmp_pathbuf tp; - + if (!held_everything) { if (exit_state) @@ -634,6 +634,12 @@ fork () return -1; } + /* Put the dll list in topological dependency ordering, in + hopes that the child will have a better shot at loading dlls + properly if it only has to deal with one at a time. + */ + dlls.topsort (); + ischild = !!setjmp (grouped.ch.jmp); volatile char * volatile esp; |