Emit .note.GNU-stack for hard-float linux targets.
[official-gcc.git] / gcc / ada / initialize.c
blob0e52feb1340f8cdf40ee40f369655dc08195367e
1 /****************************************************************************
2 * *
3 * GNAT COMPILER COMPONENTS *
4 * *
5 * I N I T I A L I Z E *
6 * *
7 * C Implementation File *
8 * *
9 * Copyright (C) 1992-2019, Free Software Foundation, Inc. *
10 * *
11 * GNAT is free software; you can redistribute it and/or modify it under *
12 * terms of the GNU General Public License as published by the Free Soft- *
13 * ware Foundation; either version 3, or (at your option) any later ver- *
14 * sion. GNAT is distributed in the hope that it will be useful, but WITH- *
15 * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
16 * or FITNESS FOR A PARTICULAR PURPOSE. *
17 * *
18 * As a special exception under Section 7 of GPL version 3, you are granted *
19 * additional permissions described in the GCC Runtime Library Exception, *
20 * version 3.1, as published by the Free Software Foundation. *
21 * *
22 * You should have received a copy of the GNU General Public License and *
23 * a copy of the GCC Runtime Library Exception along with this program; *
24 * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see *
25 * <http://www.gnu.org/licenses/>. *
26 * *
27 * GNAT was originally developed by the GNAT team at New York University. *
28 * Extensive contributions were provided by Ada Core Technologies Inc. *
29 * *
30 ****************************************************************************/
32 /* This unit provides default implementation for __gnat_initialize ()
33 which is called before the elaboration of the partition. It is provided
34 in a separate file/object so that users can replace it easily.
35 The default implementation should be null on most targets. */
37 /* The following include is here to meet the published VxWorks requirement
38 that the __vxworks header appear before any other include. */
39 #ifdef __vxworks
40 #include "vxWorks.h"
41 #endif
43 #ifdef IN_RTS
44 #include "runtime.h"
45 /* We don't have libiberty, so use malloc. */
46 #define xmalloc(S) malloc (S)
47 #define xrealloc(V,S) realloc (V,S)
48 #else
49 #include "config.h"
50 #include "system.h"
51 #endif
53 #include "raise.h"
54 #include <fcntl.h>
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
60 /******************************************/
61 /* __gnat_initialize (NT-mingw32 Version) */
62 /******************************************/
64 #if defined (__MINGW32__)
66 extern void __gnat_install_SEH_handler (void *);
68 void
69 __gnat_initialize (void *eh ATTRIBUTE_UNUSED)
71 /* Note that we do not activate this for the compiler itself to avoid a
72 bootstrap path problem. Older version of gnatbind will generate a call
73 to __gnat_initialize() without argument. Therefore we cannot use eh in
74 this case. It will be possible to remove the following #ifdef at some
75 point. */
76 #ifdef IN_RTS
77 /* Install the Structured Exception handler. */
78 if (eh)
79 __gnat_install_SEH_handler (eh);
80 #endif
83 /******************************************/
84 /* __gnat_initialize (init_float version) */
85 /******************************************/
87 #elif defined (__Lynx__) || defined (__FreeBSD__) || defined(__NetBSD__) \
88 || defined (__OpenBSD__) || defined (__DragonFly__)
90 void
91 __gnat_initialize (void *eh ATTRIBUTE_UNUSED)
95 /***************************************/
96 /* __gnat_initialize (VxWorks Version) */
97 /***************************************/
99 #elif defined(__vxworks)
101 void
102 __gnat_initialize (void *eh)
106 #elif defined(_T_HPUX10) || (!defined(IN_RTS) && defined(_X_HPUX10))
108 /************************************************/
109 /* __gnat_initialize (PA-RISC HP-UX 10 Version) */
110 /************************************************/
112 extern void __main (void);
114 void
115 __gnat_initialize (void *eh ATTRIBUTE_UNUSED)
117 __main ();
120 #else
122 /* For all other versions of GNAT, the initialize routine and handler
123 installation do nothing */
125 /***************************************/
126 /* __gnat_initialize (Default Version) */
127 /***************************************/
129 void
130 __gnat_initialize (void *eh ATTRIBUTE_UNUSED)
133 #endif
135 #ifdef __cplusplus
137 #endif