From: "John S. Fine" Newsgroups: comp.os.msdos.djgpp Subject: Re: Problem Linking NASM to DJGPP Date: Thu, 21 Jan 1999 13:49:30 -0500 Lines: 35 Message-ID: <36A776BA.4A22@erols.com> References: <69Jp2.52$9F6 DOT 158 AT nnrp2 DOT clara DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dfWhmteVMGHl8U6cujELShldNTbH+IXlS7RKRpzu0WE= X-Complaints-To: abuse AT rcn DOT com NNTP-Posting-Date: 21 Jan 1999 18:50:43 GMT X-Mailer: Mozilla 3.01 (Win95; U) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Paul Sneddon wrote: > > I have compiled my utils to support ELF and carry out the linking example > (elftest) that comes with NASM. When I try to link the two files together I > get lots of undefined reference errors. These references are located in the > elf file build with NASM and linked to the elf file created with gcc. I am > following the NASM example correctly - can anyone help. I have just a guess (because I haven't added any ELF support to DJGPP and so can't test any of this). If you use a version of GCC in which the ELF format is native, GCC doesn't add the leading "_" to global symbols. Since the elftest example in NASM was written for such versions of GCC, it doesn't either. If you modify DJGPP to support ELF, I *think* it still will prepend the underscore. (Somebody, correct me if I am wrong about this part). If you add underscores to the GLOBAL and EXTERN symbols in the ASM file, that may fix the problem. Alternately, I think there are tools for adding or removing them in the object code. BTW, I looked at another post about adding ELF support to the binutils in DJGPP. The sequence of steps looked much too hard. I have wanted ELF support in the past and probably will in the future. It would be nice if someone who has done it would package up the binaries and a brief description of what is affected and how you use them, and make that available. -- http://www.erols.com/johnfine/ http://www.geocities.com/SiliconValley/Peaks/8600/