diff options
author | Jerome Lambourg <lambourg@adacore.com> | 2018-11-16 09:23:22 +0000 |
---|---|---|
committer | Olivier Hainque <hainque@gcc.gnu.org> | 2018-11-16 09:23:22 +0000 |
commit | 7f37b31d731262f65b5274e660ac123117e3b775 (patch) | |
tree | 18933e0ad81eb68ca32bd2ea167f81f32037abaf /gcc/config/vxworks.h | |
parent | ff641ae11288626fb367dd7e56ddcc363c34d02a (diff) |
Allow target overrides of ctors/dtors support advertisement on VxWorks
2018-11-16 Jerome Lambourg <lambourg@adacore.com>
* config/vxworks.h (TARGET_VXWORKS_HAVE_CTORS_DTORS): New macro.
Default to TARGET_VXWORKS_RTP.
(SUPPORTS_INIT_PRIORITY): Use TARGET_VXWORKS_HAVE_CTORS_DTORS instead
of TARGET_VXWORKS_RTP.
* config/vxworksae.h: Also define TARGET_VXWORKS_HAVE_CTORS_DTORS.
* config/vxworks.c: Use TARGET_VXWORKS_HAVE_CTORS_DTORS instead
of TARGET_VXWORKS_RTP to set targetm.have_ctors_dtors.
From-SVN: r266201
Diffstat (limited to 'gcc/config/vxworks.h')
-rw-r--r-- | gcc/config/vxworks.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h index 2c4c79643de..156fcc060aa 100644 --- a/gcc/config/vxworks.h +++ b/gcc/config/vxworks.h @@ -142,13 +142,18 @@ along with GCC; see the file COPYING3. If not see #define VXWORKS_OVERRIDE_OPTIONS vxworks_override_options () extern void vxworks_override_options (void); -/* RTPs support prioritized constructors and destructors: the - implementation relies on numbered .ctors* sections. If the compiler - was built with --enable-initfini-array, we assume the user uses a - linker script that sorts and merges the .init_array.* sections - appropriately. */ +/* Whether the VxWorks variant and mode supports constructors/destructors + placed in .ctors/.dtors section or if we should generate proxy functions + for them, with special names which munch knows how to collect. On most + versions of VxWorks, only the RTP loader supports .ctors/.dtors sections, + not the kernel module loader. */ +#define TARGET_VXWORKS_HAVE_CTORS_DTORS TARGET_VXWORKS_RTP + +/* Support for prioritized ctors/dtors is in sync with the support for sections + on the VxWorks front, and is assumed to be provided by whatever linker level + glue is required if we were configured with --enable-initfini-array. */ #define SUPPORTS_INIT_PRIORITY \ - (TARGET_VXWORKS_RTP || HAVE_INITFINI_ARRAY_SUPPORT) + (TARGET_VXWORKS_HAVE_CTORS_DTORS || HAVE_INITFINI_ARRAY_SUPPORT) #if !HAVE_INITFINI_ARRAY_SUPPORT /* VxWorks requires special handling of constructors and destructors. |