freestanding ELF dynamic library

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

freestanding ELF dynamic library

Post 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])
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: freestanding ELF dynamic library

Post by pcmattman »

-nostdlib
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

Re: freestanding ELF dynamic library

Post 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
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
Post Reply