From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id E7795384B078 for ; Thu, 19 May 2022 12:05:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E7795384B078 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652961909; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=d1GWGShVaggwUZ4bbn9IqdNvrELkAYud3EpZrxGTzpc=; b=fI3PwTRhMA9T21yJtJF4V6qc6W5MkNEJy6W+kPxiXvIlfXGxMmSRYF7rsK7fpRE1KpD7Qs KMqMmdZ807HXdPQPHNBvK5FzVXA6avTBh91mWyvFPNZLbm/RGdMs8WKnPjo3sFQsZbEm1u vnYNqhX08cbOqEP2n+ESDXjU3wCiUQc= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-86-I_k0M9vpP8CWx6tQeOMhRQ-1; Thu, 19 May 2022 08:05:08 -0400 X-MC-Unique: I_k0M9vpP8CWx6tQeOMhRQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0413E1C0896F for ; Thu, 19 May 2022 12:05:08 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.36.112.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D3FCE2166B25 for ; Thu, 19 May 2022 12:05:07 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id C98D0A80762; Thu, 19 May 2022 14:05:06 +0200 (CEST) Date: Thu, 19 May 2022 14:05:06 +0200 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH] Use weak reference for _REENT_SMALL Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <20220518171307.53663-1-sebastian.huber@embedded-brains.de> <20220518171307.53663-3-sebastian.huber@embedded-brains.de> MIME-Version: 1.0 In-Reply-To: <20220518171307.53663-3-sebastian.huber@embedded-brains.de> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=vinschen@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2022 12:05:11 -0000 On May 18 19:13, Sebastian Huber wrote: > Avoid a strong reference to __sfp[] for _impure_data. The __sfp[] is linked in > if __sinit() is used for example. > --- > 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__ > -- > 2.35.3 Ok. Thx, Corinna