Martell: OK, I looked at that link briefly.  I think I understand what
you're worried about here: the markers that we have at the beginning
and end of our constructor/destructor sections might be removed by the
linker of clang or GCC if it is determined that no code is actually
referencing those variables.  Yes, that could be a problem.  The
"used" attribute will probably take care of that, as long as something
in the same source file is referenced.

That is different from what I was worried about with the undefined
behavior of comparing pointers from two different objects, but it is
also a good thing to be worried about.

--David

On Wed, Aug 23, 2017 at 9:14 AM, Martell Malone <[email protected]> wrote:
> Hey David,
>
> I came across this today which might be of interest to our discussion,
> while it is not related directly to the problem you mentioned it is similar.
> https://reviews.llvm.org/D37059
> I will follow up with a patch for binutils to add __CTOR_END__ and
> __DTOR_END__ but it is interesting to note.
>
> Martin we might have to add an exception in LLD for the 4 variables being
> optimised out for the COFF linker with LTO.
> (This is because there is no such thing as linker scripts for COFF)
>
> Best,
> Martell
>
> On Tue, Aug 22, 2017 at 9:23 PM, Martin Storsjö <[email protected]> wrote:
>
>> On Tue, 22 Aug 2017, Martell Malone wrote:
>>
>> pushed to master.
>>>
>>
>> Fantastic, thanks!
>>
>>
>> // Martin
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Mingw-w64-public mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to