diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2003-01-01 13:00:39 +0300 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2003-01-01 13:00:39 +0300 |
commit | 353549d7441a2a8fddb4467ee796445e9db30abc (patch) | |
tree | 4c2254b36f5ec6fc0e890f471027fc0be694d6be /winsup/mingw/dllcrt1.c | |
parent | 4f66b246ba438eae815dc0e8ec0887f064b09aab (diff) |
2003-01-01 Danny Smith <dannysmith@users.sourceforge.net>
* pseudo-reloc.c (do_pseudo_reloc): Make static.
* pseudo-reloc-list.c: New file.
* crt1.c (_pei386_runtime_relocator): Declare.
(__mingw_CRTStartup): Call it.
* dllcrt1.c (_pei386_runtime_relocator): Declare.
(DllMainCRTStartup): Call it.
* Makefile.in: Add pseudo-reloc.o pseude-reloc-list.o to
libmingw32.a.
2003-01-01 Egor Duda <deo@logos-m.ru>
* pseudo-reloc.c: New file.
Diffstat (limited to 'winsup/mingw/dllcrt1.c')
-rw-r--r-- | winsup/mingw/dllcrt1.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/winsup/mingw/dllcrt1.c b/winsup/mingw/dllcrt1.c index fe351eb10..4538cf793 100644 --- a/winsup/mingw/dllcrt1.c +++ b/winsup/mingw/dllcrt1.c @@ -54,6 +54,7 @@ p_atexit_fn __dllonexit (p_atexit_fn, p_atexit_fn**, p_atexit_fn**); extern BOOL WINAPI DllMain (HANDLE, DWORD, LPVOID); +extern void _pei386_runtime_relocator (void); BOOL WINAPI DllMainCRTStartup (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) @@ -62,6 +63,11 @@ DllMainCRTStartup (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) if (dwReason == DLL_PROCESS_ATTACH) { + +#ifdef DEBUG + printf ("%s: DLL_PROCESS_ATTACH (%d)\n", __FUNCTION__); +#endif + /* Initialize private atexit table for this dll. 32 is min size required by ANSI */ @@ -74,11 +80,10 @@ DllMainCRTStartup (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) *first_atexit = NULL; next_atexit = first_atexit; -#ifdef DEBUG - printf ("%s: DLL_PROCESS_ATTACH (%d)\n", __FUNCTION__); -#endif + /* Adust references to dllimported data (from other DLL's) + that have non-zero offsets. */ + _pei386_runtime_relocator (); - #ifdef __GNUC__ /* From libgcc.a, __main calls global class constructors, __do_global_ctors, which registers __do_global_dtors |