[arch-projects] ELF questions

Jason Chu jason at archlinux.org
Wed Mar 16 19:22:39 EST 2005


> Well what I'm saying is this:
> If I have a binary, my_binary, and an SO, load_me.so.  When my_binary
> is executed, it does nothing for, 10 seconds, then dynamically loads
> "load_me.so".
> Let's assume that load_me.so uses strlen() internally, and as such, ld
> would most likely link in libc...what I want is for libc and all the
> other crap to not be linked in, because these symbols will exist in
> my_binary.
> 
> Now, I may be getting ahead of myself, and -fPIC/-fpic may do this for
> me already.... I'll look into it

Why worry about this?  It is the job of the dynamic linker.  Most likely
libc won't strictly be linked to the library, instead it'll just be linked
to your process (because you ran my_binary) and not linked again to the
library.

That was my impression of dynamic linking; loading into the symbol space
when needed.  All functions in all linked libraries execute the same
"instance" of strlen() within a single process.

Jason

-- 
If you understand, things are just as they are.  If you do not understand,
things are just as they are.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://archlinux.org/pipermail/arch-projects/attachments/20050316/65f85556/attachment.pgp>


More information about the arch-projects mailing list