Gentoo Archives: gentoo-dev

From: "Harald van Dijk" <truedfx@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] linking with ld or gcc?
Date: Sun, 05 Nov 2006 16:28:47
Message-Id: 20061105162501.GB15905@gentoo.org
In Reply to: [gentoo-dev] linking with ld or gcc? by "Peter Volkov (pva)"
1 On Sun, Nov 05, 2006 at 06:47:07PM +0300, Peter Volkov (pva) wrote:
2 > Hello.
3 >
4 > Short question: What shall we use to link libraries/programs: gcc or ld?
5 > Why?
6 >
7 > A bit longer story: I have a problem during linking of wepattack on
8 > amd64 systems. Linking stage issues warning:
9 >
10 > $ x86_64-pc-linux-gnu-ld -o wepattack wepattack.o rc4.o wepfilter.o
11 > log.o modes.o misc.o verify.o keygen.o -lpcap -lz -lcrypto
12 > ld: warning: cannot find entry symbol _start; defaulting to
13 > 0000000000400e10
14 >
15 > And resulted file is not executable. In google I found the most of
16 > tutorials/howtos suggest to link with gcc but some programs still use
17 > LD. From ld man page it's clear that it should link the program but this
18 > is not working. So what is the right way to do that? Why?
19
20 Link using gcc unless your program is a very special case. _start is defined
21 in /usr/lib/crt1.o (may be slightly different on amd64), and that as well as
22 other object files typically required by every program will be pulled in by
23 gcc.
24 --
25 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] linking with ld or gcc? Andreas Vinsander <andreas@×××××××××.se>