This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: wrong (?) order of initialization of so.
- From: Andrea <mariofutire at gmail dot com>
- To: libc-help at sourceware dot org
- Date: Tue, 07 Jan 2014 11:16:42 +0000
- Subject: Re: wrong (?) order of initialization of so.
- Authentication-results: sourceware.org; auth=none
- References: <52CB2386 dot 1000002 at gmail dot com> <20140106223942 dot GA6024 at domone dot podge>
On 06/01/14 22:39, OndÅej BÃlka wrote:
> The ld decides order and it should be A B C D. Simplest explanation would be cyclic dependecy,
> is there E that D depend on C and E depends on A?
I have been unable to find it so far.
How do I detect a cyclic dependency?
If I get all the .so loaded, extract the DT_NEEDED for each and check if there is a loop, would that
be enough?
It is possible that some .so calls dlopen() in the init phase. Would that be relevant in this context?
> If not then you could try reproduce layout by compiling dummy libraries
> with same layout like
>
> gcc dummy.c -L. -lC -lD -fPIC -shared -o libB.so
>
I have tried, but I cannot reproduce it at all in a simplified context.
Andrea