Concatenate object files into executable programs
ld command is the GNU connector, which connects target files into executable programs.
ld(options)(parameters)
ld [options] objfile ...
-o: Specify the output file name;
-e: Specifies the entry symbol of the program.
Target file: Specify the target file to be connected.
This tells ld to generate a file named output
by linking the file /lib/crt0.o
with hello.o
and the library libc.a
, which will come from the standard search directory.
ld -o <output> /lib/crt0.o hello.o -lc
ld -o output /lib/crt0.o hello.o -lc