[Bug c++/53068] collect2 breaks link order control
ppluzhnikov at google dot com
gcc-bugzilla@gcc.gnu.org
Sun Apr 22 14:10:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53068
Paul Pluzhnikov <ppluzhnikov at google dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppluzhnikov at google dot
| |com
--- Comment #8 from Paul Pluzhnikov <ppluzhnikov at google dot com> 2012-04-22 14:09:23 UTC ---
(In reply to comment #7)
> you can use gold linker. it have nice options:
>
> $ ld.gold --help|grep ctors
> --ctors-in-init-array Use DT_INIT_ARRAY for all constructors (default)
> --no-ctors-in-init-array Handle constructors as directed by compiler
Just for the record:
Until we are able to remove inter-CU order dependencies in our code, we are
sticking with:
# prevent GCC from generating init_array:
gcc-4.7/configure --disable-initfini-array ...
# make gold use .ctors (we configure gcc to use gold)
gcc-4.7 main.o ... -Wl,--no-ctors-in-init-array
I believe this fully restores the "legacy" (gcc-4.6) ordering.
More information about the Gcc-bugs
mailing list