* 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.
This commit is contained in:
@@ -49,7 +49,11 @@ extern "C"
|
||||
{
|
||||
char **environ;
|
||||
int _fmode;
|
||||
void _pei386_runtime_relocator ();
|
||||
void _pei386_runtime_relocator (void);
|
||||
|
||||
extern char __RUNTIME_PSEUDO_RELOC_LIST__;
|
||||
extern char __RUNTIME_PSEUDO_RELOC_LIST_END__;
|
||||
extern char _image_base__;
|
||||
|
||||
struct per_process_cxx_malloc __cygwin_cxx_malloc =
|
||||
{
|
||||
@@ -146,7 +150,11 @@ _cygwin_crt0_common (MainFunc f, per_process *u)
|
||||
u->data_end = &_data_end__;
|
||||
u->bss_start = &_bss_start__;
|
||||
u->bss_end = &_bss_end__;
|
||||
|
||||
u->pseudo_reloc_start = &__RUNTIME_PSEUDO_RELOC_LIST__;
|
||||
u->pseudo_reloc_end = &__RUNTIME_PSEUDO_RELOC_LIST_END__;
|
||||
u->image_base = &_image_base__;
|
||||
/* This is actually a dummy call to force the linker to load this
|
||||
symbol for older apps which need it. */
|
||||
_pei386_runtime_relocator ();
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user