diff options
Diffstat (limited to 'winsup/cygwin/lib')
-rw-r--r-- | winsup/cygwin/lib/_cygwin_crt0_common.cc | 161 | ||||
-rw-r--r-- | winsup/cygwin/lib/crt0.h | 23 | ||||
-rw-r--r-- | winsup/cygwin/lib/cygwin_attach_dll.c | 27 | ||||
-rw-r--r-- | winsup/cygwin/lib/cygwin_crt0.c | 23 | ||||
-rw-r--r-- | winsup/cygwin/lib/dll_entry.c | 17 | ||||
-rw-r--r-- | winsup/cygwin/lib/dll_main.cc | 37 | ||||
-rw-r--r-- | winsup/cygwin/lib/libcmain.c | 43 | ||||
-rw-r--r-- | winsup/cygwin/lib/premain0.c | 14 | ||||
-rw-r--r-- | winsup/cygwin/lib/premain1.c | 14 | ||||
-rw-r--r-- | winsup/cygwin/lib/premain2.c | 14 | ||||
-rw-r--r-- | winsup/cygwin/lib/premain3.c | 14 | ||||
-rw-r--r-- | winsup/cygwin/lib/pseudo-reloc-dummy.c | 10 |
12 files changed, 0 insertions, 397 deletions
diff --git a/winsup/cygwin/lib/_cygwin_crt0_common.cc b/winsup/cygwin/lib/_cygwin_crt0_common.cc deleted file mode 100644 index 222f159e1..000000000 --- a/winsup/cygwin/lib/_cygwin_crt0_common.cc +++ /dev/null @@ -1,161 +0,0 @@ -/* _cygwin_crt0_common.cc: common crt0 function for cygwin crt0's. - - Copyright 2000, 2001, 2002, 2003, 2004, 2009 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -#include "winsup.h" -#include "crt0.h" -#include "cygwin-cxx.h" - -/* Weaken these declarations so the references don't pull in C++ dependencies - unnecessarily. */ -#define WEAK __attribute__ ((weak)) - -/* Use asm names to bypass the --wrap that is being applied to redirect all other - references to these operators toward the redirectors in the Cygwin DLL; this - way we can record what definitions were visible at final link time but still - send all calls to the redirectors. */ -extern WEAK void *operator new(std::size_t sz) throw (std::bad_alloc) - __asm__ ("___real__Znwj"); -extern WEAK void *operator new[](std::size_t sz) throw (std::bad_alloc) - __asm__ ("___real__Znaj"); -extern WEAK void operator delete(void *p) throw() - __asm__ ("___real__ZdlPv "); -extern WEAK void operator delete[](void *p) throw() - __asm__ ("___real__ZdaPv"); -extern WEAK void *operator new(std::size_t sz, const std::nothrow_t &nt) throw() - __asm__ ("___real__ZnwjRKSt9nothrow_t"); -extern WEAK void *operator new[](std::size_t sz, const std::nothrow_t &nt) throw() - __asm__ ("___real__ZnajRKSt9nothrow_t"); -extern WEAK void operator delete(void *p, const std::nothrow_t &nt) throw() - __asm__ ("___real__ZdlPvRKSt9nothrow_t"); -extern WEAK void operator delete[](void *p, const std::nothrow_t &nt) throw() - __asm__ ("___real__ZdaPvRKSt9nothrow_t"); - -/* Avoid an info message from linker when linking applications. */ -extern __declspec(dllimport) struct _reent *_impure_ptr; - -/* Initialised in _cygwin_dll_entry. */ -extern int __dynamically_loaded; - -#undef environ - -extern "C" -{ -char **environ; -int _fmode; -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 = -{ - &(operator new), &(operator new[]), - &(operator delete), &(operator delete[]), - &(operator new), &(operator new[]), - &(operator delete), &(operator delete[]) -}; - -/* Set up pointers to various pieces so the dll can then use them, - and then jump to the dll. */ - -int __stdcall -_cygwin_crt0_common (MainFunc f, per_process *u) -{ - per_process *newu = (per_process *) cygwin_internal (CW_USER_DATA); - bool uwasnull; - - /* u is non-NULL if we are in a DLL, and NULL in the main exe. - newu is the Cygwin DLL's internal per_process and never NULL. */ - if (u != NULL) - uwasnull = false; /* Caller allocated space for per_process structure. */ - else - { - u = newu; /* Using DLL built-in per_process. */ - uwasnull = true; /* Remember for later. */ - } - - /* The version numbers are the main source of compatibility checking. - As a backup to them, we use the size of the per_process struct. */ - u->magic_biscuit = sizeof (per_process); - - /* cygwin.dll version number in effect at the time the app was created. */ - u->dll_major = CYGWIN_VERSION_DLL_MAJOR; - u->dll_minor = CYGWIN_VERSION_DLL_MINOR; - u->api_major = CYGWIN_VERSION_API_MAJOR; - u->api_minor = CYGWIN_VERSION_API_MINOR; - - u->ctors = &__CTOR_LIST__; - u->dtors = &__DTOR_LIST__; - u->envptr = &environ; - if (uwasnull) - _impure_ptr = u->impure_ptr; /* Use field initialized in newer DLLs. */ - else - u->impure_ptr_ptr = &_impure_ptr; /* Older DLLs need this. */ - - u->main = f; - - /* These functions are executed prior to main. They are just stubs unless the - user overrides them. */ - u->premain[0] = cygwin_premain0; - u->premain[1] = cygwin_premain1; - u->premain[2] = cygwin_premain2; - u->premain[3] = cygwin_premain3; - u->fmode_ptr = &_fmode; - - /* This is used to record what the initial sp was. The value is needed - when copying the parent's stack to the child during a fork. */ - u->initial_sp = (char *) __builtin_frame_address (1); - - /* Remember whatever the user linked his application with - or - point to entries in the dll. */ - u->malloc = &malloc; - u->free = &free; - u->realloc = &realloc; - u->calloc = &calloc; - - /* Likewise for the C++ memory operators, if any, but not if we - were dlopen()'d, as we might get dlclose()'d and that would - leave stale function pointers behind. */ - if (newu && newu->cxx_malloc && !__dynamically_loaded) - { - /* Inherit what we don't override. */ -#define CONDITIONALLY_OVERRIDE(MEMBER) \ - if (!__cygwin_cxx_malloc.MEMBER) \ - __cygwin_cxx_malloc.MEMBER = newu->cxx_malloc->MEMBER; - CONDITIONALLY_OVERRIDE(oper_new); - CONDITIONALLY_OVERRIDE(oper_new__); - CONDITIONALLY_OVERRIDE(oper_delete); - CONDITIONALLY_OVERRIDE(oper_delete__); - CONDITIONALLY_OVERRIDE(oper_new_nt); - CONDITIONALLY_OVERRIDE(oper_new___nt); - CONDITIONALLY_OVERRIDE(oper_delete_nt); - CONDITIONALLY_OVERRIDE(oper_delete___nt); - /* Now update the resulting set into the global redirectors. */ - *newu->cxx_malloc = __cygwin_cxx_malloc; - } - - /* Setup the module handle so fork can get the path name. */ - u->hmodule = GetModuleHandle (0); - - /* variables for fork */ - u->data_start = &_data_start__; - 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; -} -} /* "C" */ diff --git a/winsup/cygwin/lib/crt0.h b/winsup/cygwin/lib/crt0.h deleted file mode 100644 index 461ea9b2e..000000000 --- a/winsup/cygwin/lib/crt0.h +++ /dev/null @@ -1,23 +0,0 @@ -/* crt0.h: header file for crt0. - - Copyright 2000, 2001, 2008 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include <windows.h> -struct per_process; -typedef int (*MainFunc) (int argc, char *argv[], char **env); -int __stdcall _cygwin_crt0_common (MainFunc, struct per_process *); -int dll_dllcrt0 (HMODULE, struct per_process *); - -#ifdef __cplusplus -} -#endif diff --git a/winsup/cygwin/lib/cygwin_attach_dll.c b/winsup/cygwin/lib/cygwin_attach_dll.c deleted file mode 100644 index 81493a41e..000000000 --- a/winsup/cygwin/lib/cygwin_attach_dll.c +++ /dev/null @@ -1,27 +0,0 @@ -/* attach_dll.cc: crt0 for attaching cygwin DLL from a non-cygwin app. - - Copyright 2000, 2001 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -#undef __INSIDE_CYGWIN__ -#include "winlean.h" -#include <time.h> /* Needed since call to sys/time.h via sys/cygwin.h - complains otherwise */ -#include <sys/cygwin.h> -#include "crt0.h" - -/* for a loaded dll */ -int -cygwin_attach_dll (HMODULE h, MainFunc f) -{ - static struct per_process u; - (void) _cygwin_crt0_common (f, &u); - - /* jump into the dll. */ - return dll_dllcrt0 (h, &u); -} diff --git a/winsup/cygwin/lib/cygwin_crt0.c b/winsup/cygwin/lib/cygwin_crt0.c deleted file mode 100644 index 9e2e8fff2..000000000 --- a/winsup/cygwin/lib/cygwin_crt0.c +++ /dev/null @@ -1,23 +0,0 @@ -/* cygwin_crt0.c: crt0 for cygwin - - Copyright 2000, 2001, 2007, 2008, 2011 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -#undef __INSIDE_CYGWIN__ -#include "crt0.h" - -extern void __stdcall _dll_crt0 () - __declspec (dllimport) __attribute__ ((noreturn)); - -/* for main module */ -void -cygwin_crt0 (MainFunc f) -{ - _cygwin_crt0_common (f, NULL); - _dll_crt0 (); /* Jump into the dll, never to return */ -} diff --git a/winsup/cygwin/lib/dll_entry.c b/winsup/cygwin/lib/dll_entry.c deleted file mode 100644 index 781f6a3ea..000000000 --- a/winsup/cygwin/lib/dll_entry.c +++ /dev/null @@ -1,17 +0,0 @@ -/* dll_entry.cc: Provide the default user DLL linker entry point. - - Copyright 1998, 2000, 2001 Red Hat, Inc. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -/* Here we simply instantiate the DECLARE_CYGWIN_DLL to define the - linker entry point, __cygwin_dll_entry@12, which in turn calls - _DllMain@12 to do user-specific initialization, if any. There is a - default DllMain stub in the library if there is no user supplied - one. */ - -#include "cygwin/cygwin_dll.h" - -DECLARE_CYGWIN_DLL (DllMain); diff --git a/winsup/cygwin/lib/dll_main.cc b/winsup/cygwin/lib/dll_main.cc deleted file mode 100644 index 558c3485b..000000000 --- a/winsup/cygwin/lib/dll_main.cc +++ /dev/null @@ -1,37 +0,0 @@ -/* dll_main.cc: Provide the DllMain stub that the user can override. - - Copyright 1998, 2000, 2001, 2009, 2010 Red Hat, Inc. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - - -#include "winlean.h" - -extern "C" -BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, - LPVOID reserved /* Not used. */); - -BOOL APIENTRY -DllMain ( - HINSTANCE hInst /* Library instance handle. */ , - DWORD reason /* Reason this function is being called. */ , - LPVOID reserved /* Not used. */) -{ - switch (reason) - { - case DLL_PROCESS_ATTACH: - break; - - case DLL_PROCESS_DETACH: - break; - - case DLL_THREAD_ATTACH: - break; - - case DLL_THREAD_DETACH: - break; - } - return TRUE; -} diff --git a/winsup/cygwin/lib/libcmain.c b/winsup/cygwin/lib/libcmain.c deleted file mode 100644 index d1faba1b3..000000000 --- a/winsup/cygwin/lib/libcmain.c +++ /dev/null @@ -1,43 +0,0 @@ -/* libcmain.c - - Copyright 1996, 1997, 1998, 2000, 2001, 2006, 2009 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -#include <windows.h> - -#define SP " \t\n" - -/* Allow apps which don't have a main to work, as long as they define WinMain */ -int -main () -{ - HMODULE x = GetModuleHandle (0); - char *s = GetCommandLine (); - STARTUPINFO si; - char *nexts; - - s += strspn (s, SP); - - if (*s != '"') - nexts = strpbrk (s, SP); - else - while ((nexts = strchr (s + 1, '"')) != NULL && nexts[-1] == '\\') - s = nexts; - - if (!nexts) - nexts = strchr (s, '\0'); - else - nexts += strspn (nexts + 1, SP); - - GetStartupInfo (&si); - - return WinMain (x, 0, nexts, - ((si.dwFlags & STARTF_USESHOWWINDOW) != 0 - ? si.wShowWindow - : SW_SHOWNORMAL)); -} diff --git a/winsup/cygwin/lib/premain0.c b/winsup/cygwin/lib/premain0.c deleted file mode 100644 index b77e02e8e..000000000 --- a/winsup/cygwin/lib/premain0.c +++ /dev/null @@ -1,14 +0,0 @@ -/* premain0.c - - Copyright 2000 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -void -cygwin_premain0(int argc, char **argv) -{ -} diff --git a/winsup/cygwin/lib/premain1.c b/winsup/cygwin/lib/premain1.c deleted file mode 100644 index 99aeac916..000000000 --- a/winsup/cygwin/lib/premain1.c +++ /dev/null @@ -1,14 +0,0 @@ -/* premain1.c - - Copyright 2000 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -void -cygwin_premain1(int argc, char **argv) -{ -} diff --git a/winsup/cygwin/lib/premain2.c b/winsup/cygwin/lib/premain2.c deleted file mode 100644 index a89e76ec3..000000000 --- a/winsup/cygwin/lib/premain2.c +++ /dev/null @@ -1,14 +0,0 @@ -/* premain2.c - - Copyright 2000 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -void -cygwin_premain2(int argc, char **argv) -{ -} diff --git a/winsup/cygwin/lib/premain3.c b/winsup/cygwin/lib/premain3.c deleted file mode 100644 index c5b99b918..000000000 --- a/winsup/cygwin/lib/premain3.c +++ /dev/null @@ -1,14 +0,0 @@ -/* premain3.c - - Copyright 2000 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -void -cygwin_premain3(int argc, char **argv) -{ -} diff --git a/winsup/cygwin/lib/pseudo-reloc-dummy.c b/winsup/cygwin/lib/pseudo-reloc-dummy.c deleted file mode 100644 index 0cd8c4eb4..000000000 --- a/winsup/cygwin/lib/pseudo-reloc-dummy.c +++ /dev/null @@ -1,10 +0,0 @@ -/* pseudo-reloc.c - - Stub for older binaries. -*/ - -void -_pei386_runtime_relocator () -{ - return; -} |