aboutsummaryrefslogtreecommitdiff
path: root/libgupc/upc-crtstuff.c
blob: 66f15db005db8a8a21da17bd22f4160324dacab6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* upc-crtstuff.c: UPC specific "C Runtime Support"
   Copyright (C) 2009-2016 Free Software Foundation, Inc.
   Contributed by Gary Funck <gary@intrepid.com>
     and Nenad Vukicevic <nenad@intrepid.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.  */

#include "config.h"
#include "upc-crt-config.h"
#include "upc-crt-begin-end.h"

/* Only define section start/end if no link script is used.   */

#ifdef CRT_BEGIN

/* Shared begin is always defined in order to allocate space
   at the beginning of the section.  */
#ifdef UPC_SHARED_SECTION_BEGIN
/* Establish a symbol at the beginning of the data section.  */
UPC_SHARED_SECTION_BEGIN
#endif /* UPC_SHARED_SECTION_BEGIN */

#ifndef HAVE_UPC_LINK_SCRIPT
#ifdef UPC_PGM_INFO_SECTION_BEGIN
/* Establish a symbol at the beginning of the program info data section.  */
UPC_PGM_INFO_SECTION_BEGIN
#endif /* UPC_PGM_INFO_SECTION_BEGIN */
#ifdef UPC_INIT_ARRAY_SECTION_BEGIN
/* Establish a symbol at the beginning of the initialization array section.  */
UPC_INIT_ARRAY_SECTION_BEGIN
#endif /* UPC_INIT_ARRAY_SECTION_BEGIN */
#endif /* !HAVE_UPC_LINK_SCRIPT */

#elif defined(CRT_END)		/* ! CRT_BEGIN */

#ifndef HAVE_UPC_LINK_SCRIPT
#ifdef UPC_SHARED_SECTION_END
/* Establish a symbol at the end of the shared data section.  */
UPC_SHARED_SECTION_END
#endif /* UPC_SHARED_SECTION_END */
#ifdef UPC_PGM_INFO_SECTION_END
/* Establish a symbol at the end of the program info data section.  */
UPC_PGM_INFO_SECTION_END
#endif /* UPC_PGM_INFO_SECTION_END */
#ifdef UPC_INIT_ARRAY_SECTION_END
/* Establish a symbol at the end of the initialization array section.  */
UPC_INIT_ARRAY_SECTION_END
#endif /* UPC_INIT_ARRAY_SECTION_END */
#endif /* !HAVE_UPC_LINK_SCRIPT */
#else /* ! CRT_BEGIN && ! CRT_END */
#error "One of CRT_BEGIN or CRT_END must be defined."
#endif