X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Received: by 10.129.87.209 with SMTP id l200mr11865563ywb.4.1469123706562; Thu, 21 Jul 2016 10:55:06 -0700 (PDT) X-Received: by 10.157.14.230 with SMTP id 93mr2813716otj.17.1469123706499; Thu, 21 Jul 2016 10:55:06 -0700 (PDT) Newsgroups: comp.os.msdos.djgpp Date: Thu, 21 Jul 2016 10:55:06 -0700 (PDT) Complaints-To: groups-abuse AT google DOT com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=89.24.106.115; posting-account=Q0wMHAoAAADjYrghh94FTf6YnbpTqZgp NNTP-Posting-Host: 89.24.106.115 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: 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]" Injection-Date: Thu, 21 Jul 2016 17:55:06 +0000 Content-Type: text/plain; charset=UTF-8 Bytes: 3086 Lines: 36 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u6LIF2He015523 Reply-To: djgpp AT delorie DOT com I usually run DJGPP from WinXP on my main PC so it took me some time to hit this bug. I compiled one of my project under DOS where I use -ffunction-sections + -Wl,--gc-sections options in Makefile to reduce size of binary trashing unused code and after compiling all objects linker has crashed: gcc -O2 -Wall -Wstrict-prototypes -ffunction-sections -o SMB.EXE unisysio.o pc i.o ide.o smart.o isadev.o smbus.o smbdev.o spd.o smb.o -Wl,--gc-sections Exiting due to signal SIGSEGV Page fault at eip=0006154f, error=0004 eax=00000001 ebx=0026f3a8 ecx=0026f328 edx=00000000 esi=002cead0 edi=002ce038 ebp=000f875c esp=0017a670 program=e:/djgpp/bin/ld.exe cs: sel=01a7 base=00a10000 limit=0045ffff ds: sel=01af base=00a10000 limit=0045ffff es: sel=01af base=00a10000 limit=0045ffff fs: sel=018f base=0005f180 limit=0000ffff gs: sel=01bf base=00000000 limit=0010ffff ss: sel=01af base=00a10000 limit=0045ffff App stack: [0017a9f8..000fa9fc] Exceptn stack: [000fa948..000f8a08] Call frame traceback EIPs: 0x0006154f collect2.exe: error: ld returned 255 exit status makefile:55: recipe for target 'SMB.EXE' failed make.exe: *** [SMB.EXE] Error 1 and produced EXE was empty (zero Bytes). I tried on different PC and with/without XMS manager, DOS 6.22 and 7.1 but still crashes. Under Dosbox too. But when I run it under Win98SE or WinXP it compiles fine and EXE is valid. So I tried some older linker and found that LD.EXE from binutils 2.25 dated 1.6.2015 and some olders that I tried don't crash. So it was introduced recenlty in 2.26. I also tried to tune stack size in stub to 1M but didn't help. Any idea? Are there archived some older versions between 2.26 from 4.3.2016 and 2.25 from 1.6.2015?