On Fri, Jul 08, 2011 at 09:03:51AM -0700, Richard Henderson wrote:
> On 07/07/2011 04:21 PM, David Gilbert wrote:
> >> We could possibly wrap the vectors page to make it look like a DSO in
> >> a forwards-compatible way, but since this has not happened so far it
> >> feels like people never saw much benefit.
> > 
> > Any idea how big a job that is?
> 
> It's slightly tricky to get the memory layout correct, but ought
> not be *that* hard.  The x86_64 port also had legacy absolute
> addresses to deal with.

Talking to Will Deacon about this, it sounds like there may be little
appetite for VDSO-ifying the vectors page unless there's a real, concrete
benefit.

Making the libc startup's job slightly easier probably doesn't count
as such a benefit, but if it renders possible something which is
otherwise impossible to do from userspace than that would be more
compelling.

> >> Can you describe the benefits with regard to this case?  (And, out of
> >> interest, how do statically-linked programs make use of needed
> >> functionality in the VDSO?
> 
> There's limited support for dlopen within statically linked 
> programs as well.  The userland side can provide a static
> interface which defers to the kernel implementation.

But you don't dlopen the VDSO, it's just mapped by the kernel
on process startup.  To find it, on other architectures something
in the C library needs to grab the base address passed by the
kernel in the aux vector.

If calls into the VDSO are needed, the C library might have
to find the VDSO and get its symbols by special means in the case
of statically linked programs.  I'm not sure how this works
in practice for architectures using a VDSO.

> Ideally this would be done with an IFUNC relocation, but ARM
> binutils doesn't support that feature yet.  Thankfully it is
> ABI compatible to replace a normal function with an IFUNC at
> a later date.

If we can do this properly using IFUNC in the future, then it
might make sense to go for an interim solution for now, and tidy
it up when IFUNC is available.

Can individual IFUNCs be set to resolve at startup?

I'm still not sure how that would work for static executables...

Cheers
---Dave

_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to