This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Results for 2.19.51.20090517 testsuite on i686-pc-cygwin
Ian Lance Taylor wrote:
> Dave Korn <dave.korn.cygwin@googlemail.com> writes:
>> Ian Lance Taylor wrote:
>>> On cygwin -Ur should mean that the global constructor tables have proper
>>> header and trailer information. This may not be useful but it is
>>> defined.
>> You mean the sentinel entries (leading 0xffffffff, trailing 0x00000000)? I
>> don't quite get this; where would they go?
>
> Around the list of constructors, as in a final link.
Ok, so we build the full lists, put them in .data, and assign the
__CTOR_LIST__ and __DTOR_LIST__ symbols to them at that time.
>> The test in question uses -Ur with
>> a relocatable link. I don't understand how it's supposed to work; if we merge
>> the .[cd]tor sections and build the lists and ap-/pre-pend the sentinels, the
>> generated object won't be truly relocatable - as indeed that's what we do, and
>> we fail when further static [cd]tors are added in the final link and they
>> don't all get processed. Are we just supposed to preserve separate
>> .ctor/.dtor sections, but build the final form of the lists in them? That
>> doesn't seem like it would work right either.
>
> The test will only work if no additional constructors and destructors
> are added in the final link. The test is intended to not require such
> constructors. It may be that that can not work on cygwin; I don't know.
Hmm, I think the problem may be that the values of __CTOR_LIST__ and
__DTOR_LIST__ are being replaced in the final link with pointers to
freshly-constructed new-but-empty lists. Thanks for the clues, I should be
able to follow it from here.
> The purpose of -Ur is for environments like Vxworks, where programs are
> relocatable objects and the final link is done at runtime by the loader.
Heh, been years since I used to use that :)
cheers,
DaveK