]> git.ipfire.org Git - thirdparty/gcc.git/commit
vxworks: enable use of .init_array/.fini_array for cdtors
authorvillemoes <villemoes@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Aug 2018 08:50:27 +0000 (08:50 +0000)
committervillemoes <villemoes@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Aug 2018 08:50:27 +0000 (08:50 +0000)
commitba51b9b497e18886fbba276b698ffac002b591a5
treefc20d372cc962ea6382184e80aa1fcac7b03a9ff
parentf8a195db4f2e5ab9ae1155847ba8a5bcbe5e9ce7
vxworks: enable use of .init_array/.fini_array for cdtors

The target OS actually runs all function pointers found in the _ctors
array when the module is loaded. So it is not that hard to make use of
the "modern" .init_array/.fini_array mechanism - it mostly just requires
a linker script adding the _ctors and _dtors symbols and terminating
LONG(0) entries.

Assume that if the user passed --enable-initfini-array when building
gcc, the rest of the toolchain (including the link spec and linker
script) is set up appropriately.

Note that configuring with --enable-initfini-array may prevent the -mrtp
mode from working, due to the (unconditional) use of .init_array.*
sections instead of .ctors.* - however, that is the case regardless of this
patch.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263691 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/vxworks.c
gcc/config/vxworks.h