[arch-projects] ELF questions
Aaron Griffin
aaronmgriffin at gmail.com
Wed Mar 16 19:16:24 EST 2005
On Wed, 16 Mar 2005 19:06:24 -0500, Jason Chu <jason at archlinux.org> wrote:
> On Wed, Mar 16, 2005 at 06:03:36PM -0600, Aaron Griffin wrote:
> > Ok, I'm not really clear, on a binary level, about ELF objects, so I'm
> > going to shoot some questions out there:
> >
> > Is an elf binary required to link to things such as libc? let's
> > assume for a moment the SO does not call any libc functions. that
> > should work fine. however, if it does call libc functions, is it able
> > to resolve that, perhaps, strlen() is linked into it's parent?
>
> Doesn't the linker (ld) handle resolving symbols? And if it can't find one
> you won't even be able to run the executable because you'll get an
> unresolved symbol error.
>
> Jason
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
More information about the arch-projects
mailing list