On Sat, 5 Aug 2017, David Grayson wrote:
Oops, here is the patch.
On Sat, Aug 5, 2017 at 10:14 AM, David Grayson <davidegray...@gmail.com> wrote:
I think Martell's last patch would have worked but it's not as safe as
I would like it to be. I think the constructor and destructor lists
should not be defined in gccmain.c where they are used, because then
the compiler optimizer might start to get smart and stop optimizing
things in a bad way. The kind of pointer arithmetic we're doing would
be undefined behavior since we're intentionally getting a pointer to
an object and then reading past the end of that object.
Also, I think we should add new symbols so there is no potential for a
clash with the symbols defined by the linker script in binutils.
So, attached to this email is a patch that worked for me (I was able
to compile and run a Qt Widgets application). I'm not entirely sure
it would be a good patch to use though, since I'm not sure how GCC
picks names for its global constructor and destructor sections, and
how it sorts those names, so I'm not sure that the symbols we are
defining would really be in the right place.
Not sure what came out of this discussion as it seems to have stalled, but
I've tested your patch with both gcc/gnu-ld and clang/lld, and it seems to
work with both.
Should we try to move forward with this? Does Kai have something to add on
David's patch and/or concerns?
// 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
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public