Refer from https://www.cs.utk.edu/help/doku.php?id=compile:c
Compile Phase:
# gcc -c hello.c
Dynamic Linking:
# gcc -o hello hello.o
# ls -lh hello
-rwx------ 1 user group 12K Sep 18 18:35 hello
# file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
for GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped
Static Linking:
# gcc -static -o hello hello.o
# ls -lh hello
# -rwx------ 1 user group 465K Sep 18 18:38 hello
# file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
for GNU/Linux 2.2.0, statically linked, not stripped
沒有留言:
張貼留言