X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com X-Authenticated: #27081556 X-Provags-ID: V01U2FsdGVkX19H2QglzMxHKZc3uORvTMWowS95WTXL/ocRAgHCEc 5sI5itKsuHoA2p Message-ID: <50A9225B.5010107@gmx.de> Date: Sun, 18 Nov 2012 19:00:59 +0100 From: Juan Manuel Guerrero User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121025 Thunderbird/16.0.2 MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: Difficulties using DJGPP 2.04 together with DOSLFN 0.41 on MSDOS 6.22 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 To debug this issue I have tried to start ld.exe from gdb.exe. The goal is to create an .exe file from the .o file produced by the assembler. The .o file produced by the assembler is all OK. The sample file is still the same as posted elsewhere. To do this I start gdb with this control file: ----------------------- start ----------------------- b main b bfdio.c:124 # b _open.c:24 b crt1.c:__crt1_startup r c:/djgpp-2.04/lib/crt0.o -Lc:/djgpp-2.04/bin/../lib/gcc/djgpp/4.72 -Lc:/djgpp-2.04/bin/../lib/gcc -Lc:/djgpp-2.04/lib -Lc:/djgpp-2.04/lib -Lc:/djgpp-2.04/bin/../lib/gcc/djgpp/4.72/../../.. 1.o -lgcc -lc -lgcc ----------------------- end ----------------------- Because of the __crt1_startup breakpoint, gdb shows how ld.exe is initialized and djgpp.env is loaded and parsed. The issue is that if I try to quit gdb at that breakpoint, NTVDM crashes with the following output: Speicherzuordnungsfehler (memory allocation error) COMMAND kann nicht geladen werden, System angehalten (COMMAND cannot be loaded, system halted) It is my translation. I do not have a english OS version so I do not know the english error message versions would sound. The important issue is that NTVDM crashes no mather where I leave gdb after having passed this point. The above message is issued by WinXP Prof SP3. If I do the same on Win98SE (from inside the GUI), no message is displayed at all because the command prompt window is inmediately closed. This is not a gdb issue. I have tried almost all version and they behave in the same way. If I replace the r line with this one: r 1.o -lgcc -lc -lgcc no crash at all happens. Of course now the arguments to the linker are incomplete and the linker cannot create an executable file anymore and complains accordingly. But that is another story. The original r line is as produced by gcc with the -v option. I know that __crt1_startup is called by crt0.S. Unfortunately my assembler skills and my DPMI skills are very rudimentary. I do not understood the code and its purpose. I assume that somewhere a buffer overrun happens. The question is where and can it be fixed? I have used the libc sources from CVS repository and I have not investigated if this is an 2.03 issue too. If more information is needed, please contact me. Regards, Juan M. Guerrero