i have some variations on a theme:

linux, i386: main() { syscall(4, 1, "hello world\n", 12); } (~6KB
dynamically linked)
linux, x86: main() { syscall(1, 1, "hello world\n", 12); } (~6KB, 4KB
stripped; 2.4megs statically linked, 400KB statically linked and
stripped)

p9, shell: % syscall write 1 'hello world' 11
p9, c: void main(){_write(1, "hello world\n", 12);} (link with libc
manually, 3.3KB)

also, i discovered something new today:

"... decided to link everything dynamically. To enforce this (allmost)
all static libraries are removed (or not even build)..."

$ gcc t.c -static
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status

Reply via email to