Daily bump.
[official-gcc.git] / gcc / config / vxworks.c
blob4fde6ad3c87e2fdf62fcfa69708c70058aac2a35
1 /* Common VxWorks target definitions for GNU compiler.
2 Copyright (C) 2007
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 3, or (at your option) any later
11 version.
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
16 for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 #include "config.h"
23 #include "system.h"
24 #include "coretypes.h"
25 #include "target.h"
26 #include "toplev.h"
27 #include "output.h"
28 #include "tm.h"
30 /* Like default_named_section_asm_out_constructor, except that even
31 constructors with DEFAULT_INIT_PRIORITY must go in a numbered
32 section on VxWorks. The VxWorks runtime uses a clever trick to get
33 the sentinel entry (-1) inserted at the beginning of the .ctors
34 segment. This trick will not work if we ever generate any entries
35 in plain .ctors sections; we must always use .ctors.PRIORITY. */
37 void
38 vxworks_asm_out_constructor (rtx symbol, int priority)
40 section *sec;
42 sec = get_cdtor_priority_section (priority,
43 /*constructor_p=*/true);
44 assemble_addr_to_section (symbol, sec);
47 /* See comment for vxworks_asm_out_constructor. */
49 void
50 vxworks_asm_out_destructor (rtx symbol, int priority)
52 section *sec;
54 sec = get_cdtor_priority_section (priority,
55 /*constructor_p=*/false);
56 assemble_addr_to_section (symbol, sec);
59 /* Do VxWorks-specific parts of OVERRIDE_OPTIONS. */
61 void
62 vxworks_override_options (void)
64 /* We can use .ctors/.dtors sections only in RTP mode. */
65 targetm.have_ctors_dtors = TARGET_VXWORKS_RTP;
67 /* PIC is only supported for RTPs. */
68 if (flag_pic && !TARGET_VXWORKS_RTP)
69 error ("PIC is only supported for RTPs");