This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What is the raw ld command called by gcc?


On Thu, 24 Jan 2019 at 17:13, Peng Yu <pengyu.ut@gmail.com> wrote:
>
> Hi
>
> I'd like to know the raw ld command is called by gcc. Is there a way
> to figure it out?

Use gcc's -v option.

> Also, why gcc acts like a front end to ld for which people has to use
> options like -Wl?
>
> Why not keep ld and gcc separated, so that if people want to link they
> just call ld? Thanks.

Because gcc adds several things to the linker command, and knows how
to invoke the linker for your target. Using gcc gives a uniform
interface, and is more convenient than adding all the extra arguments
by hand.

If you want to use ld directly, nothing stops you doing that.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]