This is the mail archive of the
mailing list for the GCC project.
Re: How does gcc link objects to executable?
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Peng Yu <pengyu dot ut at gmail dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 7 Jan 2019 23:36:17 +0000
- Subject: Re: How does gcc link objects to executable?
- References: <CABrM6wmFfQP5psqFP36jSdCMSHzvMGxqGpQfZw8ojGuZUQgHww@mail.gmail.com>
On Mon, 7 Jan 2019 at 20:48, Peng Yu <email@example.com> wrote:
> Does it call the external program ld to do so? Or it has its own code
> to perform the link? Thanks.
It calls an external linker (usually called ld, but not necessarily).
The GCC executable 'collect2' is used to invoke the linker. Add -v to
your GCC commands to see the options used by cc1 and collect2.