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.
This commit is contained in:
Sebastian Huber 2022-05-17 20:39:35 +02:00
parent 382550072b
commit 03e815a91b
1 changed files with 4 additions and 0 deletions

View File

@ -6,10 +6,14 @@
important to reduce image size for targets with very small amounts important to reduce image size for targets with very small amounts
of memory. */ of memory. */
#ifdef _REENT_SMALL #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_stdin _ATTRIBUTE ((weak));
extern const struct __sFILE_fake __sf_fake_stdout _ATTRIBUTE ((weak)); extern const struct __sFILE_fake __sf_fake_stdout _ATTRIBUTE ((weak));
extern const struct __sFILE_fake __sf_fake_stderr _ATTRIBUTE ((weak)); extern const struct __sFILE_fake __sf_fake_stderr _ATTRIBUTE ((weak));
#endif #endif
#endif
struct _reent __ATTRIBUTE_IMPURE_DATA__ _impure_data = _REENT_INIT (_impure_data); struct _reent __ATTRIBUTE_IMPURE_DATA__ _impure_data = _REENT_INIT (_impure_data);
#ifdef __CYGWIN__ #ifdef __CYGWIN__