On Thu, 24 Jan 2019 at 17:13, Peng Yu <pengyu.ut@xxxxxxxxx> 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.