From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1GgkrW-00076o-Lk for garchives@archives.gentoo.org; Sun, 05 Nov 2006 16:28:47 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.8/8.13.8) with SMTP id kA5GRl7I015209; Sun, 5 Nov 2006 16:27:47 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by robin.gentoo.org (8.13.8/8.13.8) with ESMTP id kA5GPUMw011305 for ; Sun, 5 Nov 2006 16:25:30 GMT Received: from gentoo.org (cp237988-a.mill1.nb.home.nl [84.29.241.100]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id B7B6D647E4 for ; Sun, 5 Nov 2006 16:25:29 +0000 (UTC) Date: Sun, 5 Nov 2006 17:25:01 +0100 From: Harald van =?utf-8?Q?D=C4=B3k?= To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] linking with ld or gcc? Message-ID: <20061105162501.GB15905@gentoo.org> References: <1162741650.8728.17.camel@localhost> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1162741650.8728.17.camel@localhost> User-Agent: Mutt/1.5.13 (2006-08-11) X-Archives-Salt: 9a1b23fb-d648-4083-bfd8-ed2f043041e8 X-Archives-Hash: 928c91e8f002bb89563fb55080eb236f On Sun, Nov 05, 2006 at 06:47:07PM +0300, Peter Volkov (pva) wrote: > Hello. > > Short question: What shall we use to link libraries/programs: gcc or ld? > Why? > > A bit longer story: I have a problem during linking of wepattack on > amd64 systems. Linking stage issues warning: > > $ x86_64-pc-linux-gnu-ld -o wepattack wepattack.o rc4.o wepfilter.o > log.o modes.o misc.o verify.o keygen.o -lpcap -lz -lcrypto > ld: warning: cannot find entry symbol _start; defaulting to > 0000000000400e10 > > And resulted file is not executable. In google I found the most of > tutorials/howtos suggest to link with gcc but some programs still use > LD. From ld man page it's clear that it should link the program but this > is not working. So what is the right way to do that? Why? Link using gcc unless your program is a very special case. _start is defined in /usr/lib/crt1.o (may be slightly different on amd64), and that as well as other object files typically required by every program will be pulled in by gcc. -- gentoo-dev@gentoo.org mailing list