This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR ld/12730: regression] crash when allocating in a static constructor


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]