OSDN Git Service

* output.h (assemble_addr_to_section): Declare.
[pf3gnuchains/gcc-fork.git] / gcc / config / vxworks.c
1 /* Common VxWorks target definitions for GNU compiler.
2    Copyright (C) 2007
3    Free Software Foundation, Inc.
4    Contributed by CodeSourcery, Inc.
5
6 This file is part of GCC.
7
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
11 version.
12
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.
17
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
21 02110-1301, USA.  */
22
23 #include "config.h"
24 #include "system.h"
25 #include "coretypes.h"
26 #include "output.h"
27 #include "tm.h"
28
29 /* Like default_named_section_asm_out_constructor, except that even
30    constructors with DEFAULT_INIT_PRIORITY must go in a numbered
31    section on VxWorks.  The VxWorks runtime uses a clever trick to get
32    the sentinel entry (-1) inserted at the beginning of the .ctors
33    segment.  This trick will not work if we ever generate any entries
34    in plain .ctors sections; we must always use .ctors.PRIORITY.  */
35
36 void
37 vxworks_asm_out_constructor (rtx symbol, int priority)
38 {
39   section *sec;
40
41   sec = get_cdtor_priority_section (priority,
42                                     /*constructor_p=*/true);
43   assemble_addr_to_section (symbol, sec);
44 }
45
46 /* See comment for vxworks_asm_out_constructor.  */
47
48 void
49 vxworks_asm_out_destructor (rtx symbol, int priority)
50 {
51   section *sec;
52
53   sec = get_cdtor_priority_section (priority,
54                                     /*constructor_p=*/false);
55   assemble_addr_to_section (symbol, sec);
56 }