$ gcc --version
gcc (Debian 6.3.0-18) 6.3.0 20170516
$ f=simple
$ vi $f.c
int main (){
return(12);
}
gcc -Wall -static -Os $f.c -S
gcc -Wall -static -Os $f.c -c
gcc -Wall -static -Os $f.c -o $f.unstripped.static
gcc -Wall -static -Os $f.c -s -o $f.stripped.static
gcc -Wall -Os $f.c -o $f.unstripped.dynamic
gcc -Wall -Os $f.c -s -o $f.stripped.dynamic
diet gcc -Wall -Os $f.c -o $f.unstripped.diet
diet gcc -Wall -Os $f.c -s -o $f.stripped.diet
ls -l
-rw-r--r-- 1 nobs nobs 28 Feb 11 18:06 simple.c
-rw-r--r-- 1 nobs nobs 1312 Feb 18 19:28 simple.o
-rw-r--r-- 1 nobs nobs 271 Feb 18 19:28 simple.s
-rwxr-xr-x 1 nobs nobs 4968 Feb 18 19:28 simple.stripped.diet
-rwxr-xr-x 1 nobs nobs 6208 Feb 18 19:28 simple.stripped.dynamic
-rwxr-xr-x 1 nobs nobs 738376 Feb 18 19:28 simple.stripped.static
-rwxr-xr-x 1 nobs nobs 7856 Feb 18 19:28 simple.unstripped.diet
-rwxr-xr-x 1 nobs nobs 8488 Feb 18 19:28 simple.unstripped.dynamic
-rwxr-xr-x 1 nobs nobs 810600 Feb 18 19:28 simple.unstripped.static
Comments
0 B
|👍
/👎