From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86543 invoked by alias); 26 May 2017 17:52:22 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 85361 invoked by uid 89); 26 May 2017 17:52:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*M:online, H*Ad:D*t-online.de, H*F:D*t-online.de, 26052017 X-HELO: mailout03.t-online.de Received: from mailout03.t-online.de (HELO mailout03.t-online.de) (194.25.134.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 26 May 2017 17:52:19 +0000 Received: from fwd21.aul.t-online.de (fwd21.aul.t-online.de [172.20.27.66]) by mailout03.t-online.de (Postfix) with SMTP id 6C0B942574D2; Fri, 26 May 2017 19:52:20 +0200 (CEST) Received: from [192.168.2.28] (rfrI3gZJYhHxvTPJaVauDqF+DJXJec-pg0dCQhVVUvDkpnYERjgVyzZPqS8t55JQ2p@[91.59.28.27]) by fwd21.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1dEJPK-0f0lFI0; Fri, 26 May 2017 19:52:14 +0200 Subject: Re: Memory usage of __global_locale for non-locale functions To: Prakhar Bahuguna , newlib@sourceware.org Cc: nd@arm.com References: <20170526133112.mh6nbz2bvn6t2fp5@e107464-lin.cambridge.arm.com> From: =?UTF-8?Q?Hans-Bernhard_Br=c3=b6ker?= Message-ID: Date: Fri, 26 May 2017 17:52:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170526133112.mh6nbz2bvn6t2fp5@e107464-lin.cambridge.arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00369.txt.bz2 Am 26.05.2017 um 15:31 schrieb Prakhar Bahuguna: > We've noticed that since a series of patches to add support for POSIX-1.2008 > per-thread locales in August 2015, the size of the .data section in binaries > produced by our toolchain has increased significantly due to the > __global_locale struct in lib_a-locale.o. This is linked in when any strto*() > function is called. This is true even for non-locale functions such as > strtoul(). Your classification of stroul() as a non-locale function is wrong. This general issue has come up before, quite recently: https://sourceware.org/ml/newlib/2017/msg00192.html The answer for you is the same as it was then: a library that does support setlocale at all has little chance but to pull in the required machinery as soon as any of the localized standard library functions (or macros) is referred to by the program. And no, I don't think there's a configure-time option to disable locale altogether.