This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug dynamic-link/20673] ifunc resolver function cannot call extern functions
- From: "nszabolcs at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Mon, 10 Oct 2016 14:23:29 +0000
- Subject: [Bug dynamic-link/20673] ifunc resolver function cannot call extern functions
- Auto-submitted: auto-generated
- References: <bug-20673-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=20673
--- Comment #2 from Szabolcs Nagy <nszabolcs at gmail dot com> ---
(In reply to Florian Weimer from comment #1)
> Calling extern functions is possible if no run-time relocation is required,
> or if the shared object properly expresses its dependencies using DT_NEEDED
> (and there are no cycles). Your example has a cycle.
this is not related to DT_NEEDED or cycles in module dependencies.
change cond() to rand() to get a test with proper module
dependencies and extern call into libc.
it does not help that libc.so is loaded before foo.so:
the pltgot entries of foo.so are not yet initialized,
when the ifunc resolver of foo calls rand@plt so it
jumps to 0 instead of calling the lazy resolver/rand.
this is not just a documentation bug: users cannot
tell what relocations might appear in a c language
function or if those may be processed later than the
resolver is called.
--
You are receiving this mail because:
You are on the CC list for the bug.