This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/12730: regression] crash when allocating in a static constructor
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 5 May 2011 17:57:21 +0930
- Subject: Re: PATCH: PR ld/12730: regression] crash when allocating in a static constructor
- References: <20110505051832.GA28229@intel.com>
On Wed, May 04, 2011 at 10:18:32PM -0700, H.J. Lu wrote:
> When we put .ctors into .init_array, we have to reverse copy .ctors secton.
> Otherwise, constructor function may not work with C++ run-time library
> correctly. OK for trunk?
What about .dtors? You have the same problem there. I suspect, but
haven't verified, that .ctors.* and .dtors.* also need reversing. If
that is true then it would be better to do your reversing trick for
anything going to the .init_array output section that isn't named
.init_array* and similarly for .fini_array.
You also need to reverse any dynamic relocations applying to the
sections you are reversing.
--
Alan Modra
Australia Development Lab, IBM