Index: cygwin.din =================================================================== RCS file: /cvs/uberbaum/winsup/cygwin/cygwin.din,v retrieving revision 1.53 diff -u -p -2 -r1.53 cygwin.din --- cygwin.din 2 Jul 2002 08:44:54 -0000 1.53 +++ cygwin.din 3 Jul 2002 06:23:47 -0000 @@ -148,4 +148,5 @@ dll_noncygwin_dllcrt0 cygwin_detach_dll cygwin32_detach_dll = cygwin_detach_dll +_pei386_runtime_relocator @DEF_DLL_ENTRY@ drem Index: dcrt0.cc =================================================================== RCS file: /cvs/uberbaum/winsup/cygwin/dcrt0.cc,v retrieving revision 1.135 diff -u -p -2 -r1.135 dcrt0.cc --- dcrt0.cc 27 Jun 2002 20:44:27 -0000 1.135 +++ dcrt0.cc 3 Jul 2002 06:23:47 -0000 @@ -124,4 +124,25 @@ char *old_title; char title_buf[TITLESIZE + 1]; +typedef struct + { + DWORD addend; + DWORD target; + } +runtime_pseudo_reloc; + +extern "C" void _pei386_runtime_relocator (void*, void*, void*); + +void +_pei386_runtime_relocator (void* start, void* end, void* base) +{ + DWORD reloc_target; + runtime_pseudo_reloc* r; + for (r = (runtime_pseudo_reloc*) start; r < (runtime_pseudo_reloc*) end; r++) + { + reloc_target = (DWORD) base + r->target; + *((DWORD*) reloc_target) += r->addend; + } +} + static void do_global_dtors (void) Index: include/cygwin/version.h =================================================================== RCS file: /cvs/uberbaum/winsup/cygwin/include/cygwin/version.h,v retrieving revision 1.66 diff -u -p -2 -r1.66 version.h --- include/cygwin/version.h 2 Jul 2002 09:40:07 -0000 1.66 +++ include/cygwin/version.h 3 Jul 2002 06:23:49 -0000 @@ -153,4 +153,5 @@ details. */ 53: Export strlcat, strlcpy. 54: Export __fpclassifyd, __fpclassifyf, __signbitd, __signbitf. + 55: Export _pei386_runtime_relocator. */ @@ -158,5 +159,5 @@ details. */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 54 +#define CYGWIN_VERSION_API_MINOR 55 /* There is also a compatibity version number associated with the Index: lib/crt0.h =================================================================== RCS file: /cvs/uberbaum/winsup/cygwin/lib/crt0.h,v retrieving revision 1.3 diff -u -p -2 -r1.3 crt0.h --- lib/crt0.h 11 Sep 2001 20:01:02 -0000 1.3 +++ lib/crt0.h 3 Jul 2002 06:23:49 -0000 @@ -13,4 +13,6 @@ extern "C" { #endif +void _pei386_runtime_relocator (void*, void*, void *); + struct per_process; typedef int (*MainFunc) (int argc, char *argv[], char **env); Index: lib/cygwin_crt0.c =================================================================== RCS file: /cvs/uberbaum/winsup/cygwin/lib/cygwin_crt0.c,v retrieving revision 1.8 diff -u -p -2 -r1.8 cygwin_crt0.c --- lib/cygwin_crt0.c 14 Nov 2001 10:47:54 -0000 1.8 +++ lib/cygwin_crt0.c 3 Jul 2002 06:23:49 -0000 @@ -17,4 +17,8 @@ details. */ extern void dll_crt0__FP11per_process (struct per_process *) __declspec (dllimport) __attribute ((noreturn)); +extern char __RUNTIME_PSEUDO_RELOC_LIST__; +extern char __RUNTIME_PSEUDO_RELOC_LIST_END__; +extern char _image_base__; + /* for main module */ void @@ -22,4 +26,7 @@ cygwin_crt0 (MainFunc f) { struct per_process *u; + _pei386_runtime_relocator (&__RUNTIME_PSEUDO_RELOC_LIST__, + &__RUNTIME_PSEUDO_RELOC_LIST_END__, + &_image_base__); if (_cygwin_crt0_common (f, NULL)) u = NULL; /* Newer DLL. Use DLL internal per_process. */