Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/lib')
-rw-r--r--winsup/cygwin/lib/_cygwin_crt0_common.cc51
-rw-r--r--winsup/cygwin/lib/crt0.h2
-rw-r--r--winsup/cygwin/lib/cygwin_attach_dll.c2
-rw-r--r--winsup/cygwin/lib/premain0.c5
-rw-r--r--winsup/cygwin/lib/premain1.c5
-rw-r--r--winsup/cygwin/lib/premain2.c5
-rw-r--r--winsup/cygwin/lib/premain3.c5
7 files changed, 56 insertions, 19 deletions
diff --git a/winsup/cygwin/lib/_cygwin_crt0_common.cc b/winsup/cygwin/lib/_cygwin_crt0_common.cc
index 83cbda828..b22859ec0 100644
--- a/winsup/cygwin/lib/_cygwin_crt0_common.cc
+++ b/winsup/cygwin/lib/_cygwin_crt0_common.cc
@@ -1,6 +1,7 @@
/* _cygwin_crt0_common.cc: common crt0 function for cygwin crt0's.
- Copyright 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2011, 2012 Red Hat, Inc.
+ Copyright 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2011, 2012, 2013
+ Red Hat, Inc.
This file is part of Cygwin.
@@ -16,26 +17,42 @@ details. */
unnecessarily. */
#define WEAK __attribute__ ((weak))
+#ifdef __x86_64__
+#define REAL_ZNWX "__real__Znwm"
+#define REAL_ZNAX "__real__Znam"
+#define REAL_ZNWX_NOTHROW_T "__real__ZnwmRKSt9nothrow_t"
+#define REAL_ZNAX_NOTHROW_T "__real__ZnamRKSt9nothrow_t"
+#else
+#define REAL_ZNWX "___real__Znwj"
+#define REAL_ZNAX "___real__Znaj"
+#define REAL_ZNWX_NOTHROW_T "___real__ZnwjRKSt9nothrow_t"
+#define REAL_ZNAX_NOTHROW_T "___real__ZnajRKSt9nothrow_t"
+#endif
+#define REAL_ZDLPV _SYMSTR (__real__ZdlPv)
+#define REAL_ZDAPV _SYMSTR (__real__ZdaPv)
+#define REAL_ZDLPV_NOTHROW_T _SYMSTR (__real__ZdlPvRKSt9nothrow_t)
+#define REAL_ZDAPV_NOTHROW_T _SYMSTR (__real__ZdaPvRKSt9nothrow_t)
+
/* 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");
+ __asm__ (REAL_ZNWX);
extern WEAK void *operator new[](std::size_t sz) throw (std::bad_alloc)
- __asm__ ("___real__Znaj");
+ __asm__ (REAL_ZNAX);
extern WEAK void operator delete(void *p) throw()
- __asm__ ("___real__ZdlPv ");
+ __asm__ (REAL_ZDLPV);
extern WEAK void operator delete[](void *p) throw()
- __asm__ ("___real__ZdaPv");
+ __asm__ (REAL_ZDAPV);
extern WEAK void *operator new(std::size_t sz, const std::nothrow_t &nt) throw()
- __asm__ ("___real__ZnwjRKSt9nothrow_t");
+ __asm__ (REAL_ZNWX_NOTHROW_T);
extern WEAK void *operator new[](std::size_t sz, const std::nothrow_t &nt) throw()
- __asm__ ("___real__ZnajRKSt9nothrow_t");
+ __asm__ (REAL_ZNAX_NOTHROW_T);
extern WEAK void operator delete(void *p, const std::nothrow_t &nt) throw()
- __asm__ ("___real__ZdlPvRKSt9nothrow_t");
+ __asm__ (REAL_ZDLPV_NOTHROW_T);
extern WEAK void operator delete[](void *p, const std::nothrow_t &nt) throw()
- __asm__ ("___real__ZdaPvRKSt9nothrow_t");
+ __asm__ (REAL_ZDAPV_NOTHROW_T);
/* Avoid an info message from linker when linking applications. */
extern __declspec(dllimport) struct _reent *_impure_ptr;
@@ -47,12 +64,19 @@ extern int __dynamically_loaded;
extern "C"
{
+#ifndef __x86_64__
char **environ;
+#endif
int _fmode;
extern char __RUNTIME_PSEUDO_RELOC_LIST__;
extern char __RUNTIME_PSEUDO_RELOC_LIST_END__;
+#ifdef __x86_64__
+extern char __image_base__;
+#define _image_base__ __image_base__
+#else
extern char _image_base__;
+#endif
struct per_process_cxx_malloc __cygwin_cxx_malloc =
{
@@ -93,7 +117,9 @@ _cygwin_crt0_common (MainFunc f, per_process *u)
u->ctors = &__CTOR_LIST__;
u->dtors = &__DTOR_LIST__;
+#ifndef __x86_64__
u->envptr = &environ;
+#endif
if (uwasnull)
_impure_ptr = u->impure_ptr; /* Use field initialized in newer DLLs. */
else
@@ -145,10 +171,17 @@ _cygwin_crt0_common (MainFunc f, per_process *u)
u->hmodule = GetModuleHandle (0);
/* variables for fork */
+#ifdef __x86_64__
+ u->data_start = &__data_start__;
+ u->data_end = &__data_end__;
+ u->bss_start = &__bss_start__;
+ u->bss_end = &__bss_end__;
+#else
u->data_start = &_data_start__;
u->data_end = &_data_end__;
u->bss_start = &_bss_start__;
u->bss_end = &_bss_end__;
+#endif
u->pseudo_reloc_start = &__RUNTIME_PSEUDO_RELOC_LIST__;
u->pseudo_reloc_end = &__RUNTIME_PSEUDO_RELOC_LIST_END__;
u->image_base = &_image_base__;
diff --git a/winsup/cygwin/lib/crt0.h b/winsup/cygwin/lib/crt0.h
index 1d0b6f0c3..d289e7824 100644
--- a/winsup/cygwin/lib/crt0.h
+++ b/winsup/cygwin/lib/crt0.h
@@ -16,7 +16,7 @@ extern "C" {
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 *);
+PVOID dll_dllcrt0 (HMODULE, struct per_process *);
#ifdef __cplusplus
}
diff --git a/winsup/cygwin/lib/cygwin_attach_dll.c b/winsup/cygwin/lib/cygwin_attach_dll.c
index 54c3caf4c..543073c89 100644
--- a/winsup/cygwin/lib/cygwin_attach_dll.c
+++ b/winsup/cygwin/lib/cygwin_attach_dll.c
@@ -16,7 +16,7 @@ details. */
#include "crt0.h"
/* for a loaded dll */
-int
+PVOID
cygwin_attach_dll (HMODULE h, MainFunc f)
{
static struct per_process u;
diff --git a/winsup/cygwin/lib/premain0.c b/winsup/cygwin/lib/premain0.c
index b77e02e8e..20e4e7712 100644
--- a/winsup/cygwin/lib/premain0.c
+++ b/winsup/cygwin/lib/premain0.c
@@ -1,6 +1,6 @@
/* premain0.c
- Copyright 2000 Red Hat, Inc.
+ Copyright 2000, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -9,6 +9,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
void
-cygwin_premain0(int argc, char **argv)
+cygwin_premain0(int argc __attribute__ ((unused)),
+ char **argv __attribute__ ((unused)))
{
}
diff --git a/winsup/cygwin/lib/premain1.c b/winsup/cygwin/lib/premain1.c
index 99aeac916..e30d11265 100644
--- a/winsup/cygwin/lib/premain1.c
+++ b/winsup/cygwin/lib/premain1.c
@@ -1,6 +1,6 @@
/* premain1.c
- Copyright 2000 Red Hat, Inc.
+ Copyright 2000, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -9,6 +9,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
void
-cygwin_premain1(int argc, char **argv)
+cygwin_premain1(int argc __attribute__ ((unused)),
+ char **argv __attribute__ ((unused)))
{
}
diff --git a/winsup/cygwin/lib/premain2.c b/winsup/cygwin/lib/premain2.c
index a89e76ec3..437562dc5 100644
--- a/winsup/cygwin/lib/premain2.c
+++ b/winsup/cygwin/lib/premain2.c
@@ -1,6 +1,6 @@
/* premain2.c
- Copyright 2000 Red Hat, Inc.
+ Copyright 2000, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -9,6 +9,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
void
-cygwin_premain2(int argc, char **argv)
+cygwin_premain2(int argc __attribute__ ((unused)),
+ char **argv __attribute__ ((unused)))
{
}
diff --git a/winsup/cygwin/lib/premain3.c b/winsup/cygwin/lib/premain3.c
index c5b99b918..b37758600 100644
--- a/winsup/cygwin/lib/premain3.c
+++ b/winsup/cygwin/lib/premain3.c
@@ -1,6 +1,6 @@
/* premain3.c
- Copyright 2000 Red Hat, Inc.
+ Copyright 2000, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -9,6 +9,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
void
-cygwin_premain3(int argc, char **argv)
+cygwin_premain3(int argc __attribute__ ((unused)),
+ char **argv __attribute__ ((unused)))
{
}