diff options
author | Christopher Faylor <me@cgf.cx> | 2010-05-07 21:25:19 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2010-05-07 21:25:19 +0000 |
commit | 27f564e9a3c8c81e95d8bfa195c0a3edadb35127 (patch) | |
tree | 5663c2caa484f99bd905192e69b634cc45c45454 /winsup/cygwin/dll_init.cc | |
parent | 186bcf2a17b1b9566853e1d3ce221109f9335ad6 (diff) | |
download | cygnal-27f564e9a3c8c81e95d8bfa195c0a3edadb35127.tar.gz cygnal-27f564e9a3c8c81e95d8bfa195c0a3edadb35127.tar.bz2 cygnal-27f564e9a3c8c81e95d8bfa195c0a3edadb35127.zip |
* Makefile.in (DLL_OFILES): Add pseudo-reloc.o.
* dcrt0.cc (child_info_fork::handle_fork): Call _pei386_runtime_relocator here.
(dll_crt0_1): Ditto for non-fork case.
* dll_init.cc (dll::init): Complain more in comment. Clean up slightly.
(dll_dllcrt0_1): Call _pei386_runtime_relocator when we know we have a
filled-in per_process structure.
* globals.cc (__cygwin_user_data): Accommodate new fields for
_pei386_runtime_relocator.
* pseudo-reloc.cc: New file adapted from old lib/pseudo-reloc.c. Include
winsup.h directly. Collapse #ifdef __CYGWIN__ into one block. Perform minor
whitespace code reformatting.
(__report_error): Use small_printf to output error.
(_pei386_runtime_relocator): Conditionalize for cygwin to take per_process
pointer parameter.
* winsup.h (_pei386_runtime_relocator): Declare.
* include/cygwin/version.h
(CYGWIN_VERSION_PER_PROCESS_API_VERSION_COMBINED): New macro.
(CYGWIN_VERSION_USER_API_VERSION_COMBINED): Use above macro.
(CYGWIN_VERSION_USE_PSEUDO_RELOC_IN_DLL): New macro.
(CYGWIN_VERSION_API_MINOR): Bump to 227.
* include/sys/cygwin.h: Remove obsolete comment.
(per_process::unused2): Shorten.
(per_process::pseudo_reloc_start): New field.
(per_process::pseudo_reloc_end): Ditto.
(per_process::image_base): Ditto.
* lib/_cygwin_crt0_common.cc: Declare pseudo runtime externs needed for
per_process structure.
(_cygwin_crt0_common): Fill in pseudo_reloc runtime constants.
* lib/pseudo-reloc-dummy.c: New file. Dummy function to satisify ld.
* lib/pseudo-reloc.c: Delete.
Diffstat (limited to 'winsup/cygwin/dll_init.cc')
-rw-r--r-- | winsup/cygwin/dll_init.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index c2b141362..ec1132434 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -75,7 +75,7 @@ dll::init () { int ret = 1; - /* Why didn't we just import this variable? */ + /* This should be a no-op. Why didn't we just import this variable? */ *(p.envptr) = __cygwin_environ; /* Don't run constructors or the "main" if we've forked. */ @@ -86,7 +86,7 @@ dll::init () /* entry point of dll (use main of per_process with null args...) */ if (p.main) - ret = (*(p.main)) (0, 0, 0); + ret = p.main (0, 0, 0); } return ret; @@ -333,7 +333,10 @@ dll_dllcrt0_1 (VOID *x) if (p == NULL) p = &__cygwin_user_data; else - *(p->impure_ptr_ptr) = __cygwin_user_data.impure_ptr; + { + *(p->impure_ptr_ptr) = __cygwin_user_data.impure_ptr; + _pei386_runtime_relocator (p); + } bool linked = !in_forkee && !cygwin_finished_initializing; |