From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id CAFF9396DC2C; Thu, 19 May 2022 17:02:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CAFF9396DC2C Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Use weak reference for _REENT_SMALL X-Act-Checkin: newlib-cygwin X-Git-Author: Sebastian Huber X-Git-Refname: refs/heads/master X-Git-Oldrev: 382550072b49430f8c69adee937a0ba07bd385e6 X-Git-Newrev: 03e815a91b1a1f94ce0cfd6ff64f50ae40ed740c Message-Id: <20220519170231.CAFF9396DC2C@sourceware.org> Date: Thu, 19 May 2022 17:02:31 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2022 17:02:31 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D03e815a91b1= a1f94ce0cfd6ff64f50ae40ed740c commit 03e815a91b1a1f94ce0cfd6ff64f50ae40ed740c Author: Sebastian Huber Date: Tue May 17 20:39:35 2022 +0200 Use weak reference for _REENT_SMALL =20 Avoid a strong reference to __sfp[] for _impure_data. The __sfp[] is l= inked 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 =20 struct _reent __ATTRIBUTE_IMPURE_DATA__ _impure_data =3D _REENT_INIT (_imp= ure_data); #ifdef __CYGWIN__