This is the mail archive of the
mailing list for the binutils project.
Re: SPARC: nested static initialization
- From: Erik Volk <eriksnga at gmail dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 1 Dec 2015 21:35:54 -0500
- Subject: Re: SPARC: nested static initialization
- Authentication-results: sourceware.org; auth=none
- References: <CALB4ytn0TcVfDKFgL_TKELqbMsuLMtGvCHctA1VEL2ticyswjA at mail dot gmail dot com> <20151202013111 dot GC5966 at bubble dot grove dot modra dot org>
On Tue, Dec 1, 2015 at 8:31 PM, Alan Modra <email@example.com> wrote:
> On Wed, Nov 25, 2015 at 01:35:29PM -0500, Erik Volk wrote:
>> The attached small test case calls a global function during static
>> initialization in a shared library. After the function address is
>> resolved but before the function is actually being called, the global
>> initialization from main executable is triggered
> So the process of resolving _Z8equals42d (defined in both main and
> libshared.so) which you call from _ZL13init_shared_2v, causes the
> global init in main to run. This is likely a glibc ld.so issue, not a
> binutils problem.
Thank you for taking a look. Truly appreciated.
FWIIW: the problem also triggers when _Z8equals42d is undefined in
libshared.so; the double definition
actually came from #include <cmath> in the original code exhibiting the problem.
>> and registers used to
>> hold function arguments get clobbered.
> This also is likely a glibc issue. You may find it better to ask
> about this problem on the glibc list.