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.c | |
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.c')
-rw-r--r-- | gcc/config/vxworks.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/config/vxworks.c b/gcc/config/vxworks.c index 3b6b2343859..f0d19745199 100644 --- a/gcc/config/vxworks.c +++ b/gcc/config/vxworks.c @@ -145,11 +145,14 @@ vxworks_override_options (void) targetm.emutls.debug_form_tls_address = true; } - /* We can use .ctors/.dtors sections only in RTP mode. But, if the - compiler was built with --enable-initfini-array, assume the - toolchain implements the proper glue to make .init_array and - .fini_array work. */ - targetm.have_ctors_dtors = TARGET_VXWORKS_RTP || HAVE_INITFINI_ARRAY_SUPPORT; + /* Arrange to use .ctors/.dtors sections if the target VxWorks configuration + and mode supports it, or the init/fini_array sections if we were + configured with --enable-initfini-array explicitly. In the latter case, + the toolchain user is expected to provide whatever linker level glue is + required to get things to operate properly. */ + + targetm.have_ctors_dtors = + TARGET_VXWORKS_HAVE_CTORS_DTORS || HAVE_INITFINI_ARRAY_SUPPORT; /* PIC is only supported for RTPs. */ if (flag_pic && !TARGET_VXWORKS_RTP) |