From: Richard Dawe Newsgroups: comp.os.msdos.djgpp Subject: Re: make + ld problem Date: Tue, 02 Sep 2003 22:17:22 +0100 Lines: 86 Message-ID: <3F5508E2.C41711D0@phekda.freeserve.co.uk> References: <8c7b1c74 DOT 0309020704 DOT 26e80cf AT posting DOT google DOT com> NNTP-Posting-Host: 217.134.216.185 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: newsg4.svr.pol.co.uk 1062537887 17411 217.134.216.185 (2 Sep 2003 21:24:47 GMT) NNTP-Posting-Date: 2 Sep 2003 21:24:47 GMT X-Complaints-To: abuse AT theplanet DOT net X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hello. "R.Karthick" wrote: > I am using a make file for creating a bin file out of many C files. I > am using win2k cmd shell > > with djpp gcc version 3.1 installed with GNU Make version 3.79. The > version of ld is 2.13. > > My src for the makefile is > > ---------- > > objects = kernel32.o pic.o stdio.o keyboard.o gdt.o string.o idt.o > asm_c.o screen.o writexy.o > > login.o > allobjects = $(objects) asm.o > > header = include/stdio.h \ > include/pic.h \ > include/gdt.h \ > include/types.h \ > include/string.h \ > include/idt.h \ > include/asm.h \ > include/screen.h \ > include/keyboard.h \ > include/keydefs.h \ > include/login.h \ > include/writexy.h > > kernel32.bin : $(objects) asm.o > ld -Ttext=0x9000 -o kernel32 $(allobjects) -e 0x0 > objcopy -R .note -R .comment -S -O binary kernel32 kernel32.bin > > $(objects) : $(header) > > asm.o : > nasm -f coff asm.asm > > -------------- > > Now if i run "make" it returns the error > > make: execvp: ld: Invalid argument > make: *** [kernel32.bin] Error 127 Did you try the ld command manually? make should have displayed the ld command on the screen. It may be worth trying that and then removing options, just to see if it doesn't like some of the options you've used. > I removed the login.o from the compilation( objects variable ) and > added the functions from > > login.c in kernel32.c, so that it will be included in kernel32.o, and > the binary file gets > > created smoothly in that way. Does ld have any maximum number of files > limitation which can be > > included to it from the command line or the make file?? There is a limit on the length of the command-line. It depends whether the command is a normal DOS program, a DJGPP program or a Windows program (*). DOS command-lines are limited to ~128 characters (I can't remember the exact number). Command-lines between DJGPP programs are limited to the size of the transfer buffer, but that's usually several kilobytes. (*) Windows programs can have longer command-lines with DJGPP 2.04 alpha. I don't think you are reaching the maximum command-line length. It seems the problem is in your ld command-line. > I tried to remove all the .o files in the directory and started a > fresh make, and even that didnt > > seem to work. [snip] What error did you get? Regards, -- Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]