delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2016/07/22/06:00:18

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Received: by 10.157.10.20 with SMTP id 20mr2599045otg.25.1469180510058;
Fri, 22 Jul 2016 02:41:50 -0700 (PDT)
X-Received: by 10.157.21.74 with SMTP id z10mr148348otz.18.1469180510025; Fri,
22 Jul 2016 02:41:50 -0700 (PDT)
Newsgroups: comp.os.msdos.djgpp
Date: Fri, 22 Jul 2016 02:41:49 -0700 (PDT)
In-Reply-To: <e5d46af2-36fb-46af-af04-805ce2f8b6c3@googlegroups.com>
Complaints-To: groups-abuse AT google DOT com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=89.177.46.45; posting-account=Q0wMHAoAAADjYrghh94FTf6YnbpTqZgp
NNTP-Posting-Host: 89.177.46.45
References: <e5d46af2-36fb-46af-af04-805ce2f8b6c3 AT googlegroups DOT com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b558cc5e-cc8f-4794-a8ca-f90f65312a90@googlegroups.com>
Subject: Re: LD from binutils 2.26 crashes when -ffunction-sections +
-Wl,--gc-sections is used but only under DOS
From: "RayeR (glaux AT centrum DOT cz) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
Injection-Date: Fri, 22 Jul 2016 09:41:50 +0000
Bytes: 2530
Lines: 28
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u6MA03g7013273
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

OK, OK, I remember it was told that DJDEV 2.04+ may crash under pure DOS (never happened to me before). If it is really caused by a bug in some libc function of djdev 2.04 it is chance to find it as it is perfectry reproducable on minimal code, that I have found. It may solve also other issues.

First to say that if I use mentioned options:
-ffunction-sections, -Wl,--gc-sections
it have possitive effect on resulting code size so it does something (I had tried it some years ago and leaved it in makefile). It's a few kB with LD 2.25 or older and about 10kB with LD 2.26 in particular case. So I don't know if it is supported in full range as it should be but it's definitely DO SOMETHING positive on code size. Even if not, it should either print warning about ussuported option or ignore it but DON'T CRASH. And if crash it should be consistent and crash under Windows too.

I minimized the testcase on very dummy code:
test.c

int main(void)
{
  return(0);
}

Compile:
gcc -Wall -ffunction-sections -c -o test.o test.c
gcc -o test.exe test.o -Wl,--gc-sections

It can be reproduced running DJGPP in DOSBOX so you don't need to leave your beloved XP :)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019