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:
authorJeff Johnston <jjohnstn@redhat.com>2009-04-21 22:38:53 +0400
committerJeff Johnston <jjohnstn@redhat.com>2009-04-21 22:38:53 +0400
commit161e368ac4944c97fc4ff9f99368ac252167eadc (patch)
treeca0f45cd881d6086ce20963f9457503fbfedb591 /newlib/libc
parent15b71e66797fb4f2705532da0d08bd656b8c621c (diff)
2009-04-21 Sandra Loosemore <sandra@codesourcery.com>
* libc/reent/impure.c (__sf_fake_stdin, __sf_fake_stdout) (__sf_fake_stderr): Declare locally with weak attribute.
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/reent/impure.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/newlib/libc/reent/impure.c b/newlib/libc/reent/impure.c
index 12ee7177b..f5918c88f 100644
--- a/newlib/libc/reent/impure.c
+++ b/newlib/libc/reent/impure.c
@@ -9,6 +9,17 @@
#define __ATTRIBUTE_IMPURE_DATA__
#endif
+/* Redeclare these symbols locally as weak so that the file containing
+ their definitions (along with a lot of other stuff) isn't sucked in
+ unless they are actually used by other compilation units. This is
+ important to reduce image size for targets with very small amounts
+ of memory. */
+#ifdef _REENT_SMALL
+extern const struct __sFILE_fake __sf_fake_stdin _ATTRIBUTE ((weak));
+extern const struct __sFILE_fake __sf_fake_stdout _ATTRIBUTE ((weak));
+extern const struct __sFILE_fake __sf_fake_stderr _ATTRIBUTE ((weak));
+#endif
+
static struct _reent __ATTRIBUTE_IMPURE_DATA__ impure_data = _REENT_INIT (impure_data);
#ifdef __CYGWIN__
extern struct _reent reent_data __attribute__ ((alias("impure_data")));