On Wed, Apr 21, 2021 at 6:33 AM Peng Yu <pengyu.ut@xxxxxxxxx> wrote: > > On Tue, Apr 20, 2021 at 11:21 PM Tadeus Prastowo > <tadeus.prastowo@xxxxxxxx> wrote: > > > > On Wed, Apr 21, 2021 at 1:29 AM Peng Yu <pengyu.ut@xxxxxxxxx> wrote: > > > I tried with hola.s below. > > > > > > https://cs.lmu.edu/~ray/notes/gasexamples/ > > > > > > It seems that gcc -v -Wl,-v gives quite complex underlying commands. > > > But most of the options are not useful. > > > > > > The minimal commands should be just the following (on Linux). Why are > > > there so many irrelevant command line options passed down to ld? > > > > If in addition to -v -Wl,-v you pass the compiler option -fno-lto, the > > options pertaining to LTO (link-time optimization) will not appear. > > Since it is *link*-time optimization, I suppose it is ld who does the > actual work? Yes. > So for compiling a .c file, the real work of the gcc package that is > rather significant is just done by cc1. Yes. > All the rest work is > dispatched to as and ld, which could have been implemented in bash or > some shell language instead of C. Yes. > If it were implemented in a shell language, it would be easier to see > what is going on below the surface, instead of relying on the -v > option. Yes. > (Probably it is easier to maintain shell scripts rather than C > code? Also, just for calling others programs, it seems shell is a > better implementation language than C.) Maybe. -- Best regards, Tadeus