Merge trunk version 204345 into gupc branch.
[official-gcc.git] / libgupc / upc-crtstuff.c
blobb4a36915ec3c350e69d3dff36b98dbae17b53962
1 /* upc-crtstuff.c: UPC specific "C Runtime Support"
2 Copyright (C) 2009-2013 Free Software Foundation, Inc.
3 Contributed by Gary Funck <gary@intrepid.com>
4 and Nenad Vukicevic <nenad@intrepid.com>.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License 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 /* Target machine header files require this define. */
23 #define IN_LIBGCC2
25 #undef USED_FOR_TARGET
27 #include "tconfig.h"
28 #include "tsystem.h"
29 #include "coretypes.h"
30 #include "tm.h"
31 #include "config.h"
32 #include "upc-crt-config.h"
34 /* Only define section start/end if no link script is used. */
36 #ifdef CRT_BEGIN
38 /* Shared begin is always defined in order to allocate space
39 at the beginning of the section. */
40 #ifdef UPC_SHARED_SECTION_BEGIN
41 /* Establish a symbol at the beginning of the data section. */
42 UPC_SHARED_SECTION_BEGIN
43 #endif /* UPC_SHARED_SECTION_BEGIN */
45 #ifndef HAVE_UPC_LINK_SCRIPT
46 #ifdef UPC_PGM_INFO_SECTION_BEGIN
47 /* Establish a symbol at the beginning of the program info data section. */
48 UPC_PGM_INFO_SECTION_BEGIN
49 #endif /* UPC_PGM_INFO_SECTION_BEGIN */
50 #ifdef UPC_INIT_ARRAY_SECTION_BEGIN
51 /* Establish a symbol at the beginning of the initialization array section. */
52 UPC_INIT_ARRAY_SECTION_BEGIN
53 #endif /* UPC_INIT_ARRAY_SECTION_BEGIN */
54 #endif /* !HAVE_UPC_LINK_SCRIPT */
56 #elif defined(CRT_END) /* ! CRT_BEGIN */
58 #ifndef HAVE_UPC_LINK_SCRIPT
59 #ifdef UPC_SHARED_SECTION_END
60 /* Establish a symbol at the end of the shared data section. */
61 UPC_SHARED_SECTION_END
62 #endif /* UPC_SHARED_SECTION_END */
63 #ifdef UPC_PGM_INFO_SECTION_END
64 /* Establish a symbol at the end of the program info data section. */
65 UPC_PGM_INFO_SECTION_END
66 #endif /* UPC_PGM_INFO_SECTION_END */
67 #ifdef UPC_INIT_ARRAY_SECTION_END
68 /* Establish a symbol at the end of the initialization array section. */
69 UPC_INIT_ARRAY_SECTION_END
70 #endif /* UPC_INIT_ARRAY_SECTION_END */
71 #endif /* !HAVE_UPC_LINK_SCRIPT */
72 #else /* ! CRT_BEGIN && ! CRT_END */
73 #error "One of CRT_BEGIN or CRT_END must be defined."
74 #endif