1 /* Common VxWorks target definitions for GNU compiler.
3 Free Software Foundation, Inc.
4 Contributed by CodeSourcery, Inc.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2, or (at your option) any later
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to the Free
20 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
25 #include "coretypes.h"
31 /* Like default_named_section_asm_out_constructor, except that even
32 constructors with DEFAULT_INIT_PRIORITY must go in a numbered
33 section on VxWorks. The VxWorks runtime uses a clever trick to get
34 the sentinel entry (-1) inserted at the beginning of the .ctors
35 segment. This trick will not work if we ever generate any entries
36 in plain .ctors sections; we must always use .ctors.PRIORITY. */
39 vxworks_asm_out_constructor (rtx symbol, int priority)
43 sec = get_cdtor_priority_section (priority,
44 /*constructor_p=*/true);
45 assemble_addr_to_section (symbol, sec);
48 /* See comment for vxworks_asm_out_constructor. */
51 vxworks_asm_out_destructor (rtx symbol, int priority)
55 sec = get_cdtor_priority_section (priority,
56 /*constructor_p=*/false);
57 assemble_addr_to_section (symbol, sec);
60 /* Do VxWorks-specific parts of OVERRIDE_OPTIONS. */
63 vxworks_override_options (void)
65 /* We can use .ctors/.dtors sections only in RTP mode. */
66 targetm.have_ctors_dtors = TARGET_VXWORKS_RTP;
68 /* PIC is only supported for RTPs. */
69 if (flag_pic && !TARGET_VXWORKS_RTP)
70 error ("PIC is only supported for RTPs");