Page 1 of 1

freestanding ELF dynamic library

Posted: Sat Jun 13, 2009 10:06 pm
by mcheung63
Hi all
I compiled my shared library by:
gcc -ffreestanding -Wall -fPIC -c testingLibrary.c
gcc -shared -Wl,-soname,libTesting.so.1 -o libTesting.so testingLibrary.o

When I readelf -d libTesting.so

Dynamic section at offset 0x460 contains 21 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libc.so.6]
0x0000000e (SONAME) Library soname: [libTesting.so.1]

Why it still need libc.so.6 ? I have added -ffreestanding .
thanks
from Peter ([email protected])

Re: freestanding ELF dynamic library

Posted: Sat Jun 13, 2009 10:08 pm
by pcmattman
-nostdlib

Re: freestanding ELF dynamic library

Posted: Mon Jun 15, 2009 11:52 am
by gravaera
I think I'd better remember this one as well. I'm going to be compiling my own standard library dynamic linkable soon. Useful.

-Thanks,
gravaera