| delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mail set sender to djgpp-workers-bounces using -f |
| X-Recipient: | djgpp-workers AT delorie DOT com |
| DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; |
| d=gmail.com; s=20120113; | |
| h=mime-version:in-reply-to:references:date:message-id:subject:from:to | |
| :content-type; | |
| bh=134efHLibUkWk6MvNiWJYaJ+CpZ8rtLhCjtdIyKKIgA=; | |
| b=SVlFnLbDwfMCFMwc5cqGGulggwvzwxHm97LZAcTkPHkoOmqOMqr5l1PE4pFv28QMuZ | |
| PWCMsdRM1aX8+hKY1vusOKMY/lqgs0f/nh9aQcxcz1l+uyRZYYlwnIWv7PW0S5AOYlFg | |
| 2cROl4qRFoVx2Hb1umYKZXxyEU9i5Bii/Vjb4IobNrKYm2FeO8SGgbJK0OCoeSmj//3p | |
| oyBT+tdyCLPjLCNoPlNEaVltek2hx33tw64REYfGD8cz2E+kKngkzxXKbxe1C0xFmaOK | |
| lyKhBt+yn4jtsik/L/2K1wZK6ZUQbyrravbRc9MPOQ92wA3Fa6znJGcTtq4KtCaWIbsZ | |
| MEAQ== | |
| MIME-Version: | 1.0 |
| X-Received: | by 10.182.153.33 with SMTP id vd1mr4909obb.86.1398115035685; Mon, |
| 21 Apr 2014 14:17:15 -0700 (PDT) | |
| In-Reply-To: | <53555BFD.4000202@gmx.de> |
| References: | <CAA2C=vBamXSU9Eh53WTLos=nemZs+uJ09QPF9Y8Jj4OSdZPsyQ AT mail DOT gmail DOT com> |
| <53555BFD DOT 4000202 AT gmx DOT de> | |
| Date: | Mon, 21 Apr 2014 16:17:15 -0500 |
| Message-ID: | <CAA-ihx9Je2xXChvz1+3_dSLt+KbrkzsymsbXFH=_5wqOqXzCMQ@mail.gmail.com> |
| Subject: | Re: ctime.c changes add about 4.5k more size |
| From: | Rugxulo <rugxulo AT gmail DOT com> |
| To: | djgpp-workers AT delorie DOT com |
| Reply-To: | djgpp-workers AT delorie DOT com |
| Errors-To: | nobody AT delorie DOT com |
| X-Mailing-List: | djgpp-workers AT delorie DOT com |
| X-Unsubscribes-To: | listserv AT delorie DOT com |
Hi,
On Mon, Apr 21, 2014 at 12:57 PM, Juan Manuel Guerrero
<juan DOT guerrero AT gmx DOT de> wrote:
> Am 21.04.2014 08:44, schrieb Ozkan Sezer:
>
>> Recent(ish) src/libc/ansi/time/ctime.c changes add about 4.5k more
>> size to the final stripped binary:
>>
>> #include <time.h>
>> int main () {
>> return time(NULL);
>> }
>>
>> Linking against v2.04 from 2011-10-01 gives a 91648 bytes a.exe,
>> whereas linking against v2.04 from 2014-04-20 gives a 96256 bytes
>> a.exe. (not mentioning at all the crazy sizes themselves which is
>> irrelevant to the present case at hand.) A "return 0" instead of
>> a "return time(NULL)" yields a 52736 bytes exe, so ctime.c stuff
>> is adding about 43k size.
>>
>> time() calls gettimeofday() which calls 0x2c and 0x2a dos functions
>> and calls ctime.c::mktime() where the additional bloat happens.
>>
>> Is there no other way of reducing the code size here?
Not automatically since COFF (nor PE/COFF) doesn't have proper support
for --gc-sections in GNU ld, last I heard.
> The time zone database format has changed so that the original ctime code
> of djgpp (code before 2011-10-01) had to be replaced (aka ported) by the
> ctime code provided by time zone source code.
>
> If someone can optimize the ctime code for speed and size, that changes will
> always be welcome; but I do not think that optimization for size should be
> done sacrificing/removing time zone features that other users expect to be
> provided by djgpp.
BTW, on a semi-related note, a few years ago I mentioned that mkdir()
was always pulling in ctime.o , so that will also make some apps even
bigger in size. The culprit (for that separate case) is apparently
xstat.c's _file_time_stamp(), which should probably be split into a
separate file entirely (ftstamp.c ?).
http://www.delorie.com/djgpp/mail-archives/browse.cgi?p=djgpp-workers/2009/09/26/21:32:54
http://www.delorie.com/bin/cvsweb.cgi/djgpp/src/libc/posix/sys/stat/xstat.c
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |