public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Use weak reference for _REENT_SMALL
@ 2022-05-19 17:02 Sebastian Huber
  0 siblings, 0 replies; only message in thread
From: Sebastian Huber @ 2022-05-19 17:02 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=03e815a91b1a1f94ce0cfd6ff64f50ae40ed740c

commit 03e815a91b1a1f94ce0cfd6ff64f50ae40ed740c
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Tue May 17 20:39:35 2022 +0200

    Use weak reference for _REENT_SMALL
    
    Avoid a strong reference to __sfp[] for _impure_data.  The __sfp[] is linked in
    if __sinit() is used for example.

Diff:
---
 newlib/libc/reent/impure.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/newlib/libc/reent/impure.c b/newlib/libc/reent/impure.c
index f10665fd0..643a511c6 100644
--- a/newlib/libc/reent/impure.c
+++ b/newlib/libc/reent/impure.c
@@ -6,10 +6,14 @@
    important to reduce image size for targets with very small amounts
    of memory.  */
 #ifdef _REENT_SMALL
+#ifdef _REENT_GLOBAL_STDIO_STREAMS
+extern __FILE __sf[3] _ATTRIBUTE ((weak));
+#else
 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
+#endif
 
 struct _reent __ATTRIBUTE_IMPURE_DATA__ _impure_data = _REENT_INIT (_impure_data);
 #ifdef __CYGWIN__


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-19 17:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19 17:02 [newlib-cygwin] Use weak reference for _REENT_SMALL Sebastian Huber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).