-nostartfiles for -shared on ELF

Ian Lance Taylor iant@google.com
Tue Feb 3 08:46:00 GMT 2009


Mathieu Lacage <mathieu.lacage@gmail.com> writes:

> [mlacage@diese test]$ cc  -fpic  -c -o test.o test.c
> [mlacage@diese test]$ ld -shared -nostartfiles -o libtest.so test.o
> [mlacage@diese test]$ readelf -l ./libtest.so

-nostartfiles is a compiler option, not a linker option.  I would
expect that passing -nostartfiles to the linker would be treated as
passing -n -o startfiles.  Then the -o option is overridden by your
later -o libtest.so.  So you are effectively invoking the linker with
the -n option, q.v.

Ian



More information about the Gcc-help mailing list