Enable no-exec stacks for more targets using the Linux kernel.
[official-gcc.git] / gcc / config / pa / pa-linux.h
blob811e697b8ed4365532c8ec1bdc3ba40633724d8e
1 /* Definitions for PA_RISC with ELF format
2 Copyright (C) 1999-2017 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
11 GCC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
21 #undef TARGET_OS_CPP_BUILTINS
22 #define TARGET_OS_CPP_BUILTINS() \
23 do \
24 { \
25 GNU_USER_TARGET_OS_CPP_BUILTINS(); \
26 builtin_assert ("machine=bigendian"); \
27 } \
28 while (0)
30 #undef CPP_SPEC
31 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
33 #undef ASM_SPEC
34 #define ASM_SPEC \
37 /* Define this for shared library support because it isn't in the main
38 linux.h file. */
40 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
42 #undef LINK_SPEC
43 #define LINK_SPEC "\
44 %{shared:-shared} \
45 %{!shared: \
46 %{!static: \
47 %{rdynamic:-export-dynamic} \
48 -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
49 %{static:-static}}"
51 /* glibc's profiling functions don't need gcc to allocate counters. */
52 #define NO_DEFERRED_PROFILE_COUNTERS 1
54 /* Define the strings used for the special svr4 .type and .size directives.
55 These strings generally do not vary from one system running svr4 to
56 another, but if a given system (e.g. m88k running svr) needs to use
57 different pseudo-op names for these, they may be overridden in the
58 file which includes this one. */
60 #undef STRING_ASM_OP
61 #define STRING_ASM_OP "\t.stringz\t"
63 #define TEXT_SECTION_ASM_OP "\t.text"
64 #define DATA_SECTION_ASM_OP "\t.data"
65 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
67 #define TARGET_ASM_FILE_START pa_linux_file_start
69 /* We want local labels to start with period if made with asm_fprintf. */
70 #undef LOCAL_LABEL_PREFIX
71 #define LOCAL_LABEL_PREFIX "."
73 /* Define these to generate the Linux/ELF/SysV style of internal
74 labels all the time - i.e. to be compatible with
75 ASM_GENERATE_INTERNAL_LABEL in <elfos.h>. Compare these with the
76 ones in pa.h and note the lack of dollar signs in these. FIXME:
77 shouldn't we fix pa.h to use ASM_GENERATE_INTERNAL_LABEL instead? */
79 #undef ASM_OUTPUT_ADDR_VEC_ELT
80 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
81 fprintf (FILE, "\t.word .L%d\n", VALUE)
83 #undef ASM_OUTPUT_ADDR_DIFF_ELT
84 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
85 fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL)
87 /* Use the default. */
88 #undef ASM_OUTPUT_LABEL
90 /* NOTE: (*targetm.asm_out.internal_label)() is defined for us by elfos.h, and
91 does what we want (i.e. uses colons). It must be compatible with
92 ASM_GENERATE_INTERNAL_LABEL(), so do not define it here. */
94 /* Use the default. */
95 #undef ASM_OUTPUT_INTERNAL_LABEL
97 /* Use the default. */
98 #undef TARGET_ASM_GLOBALIZE_LABEL
99 /* Globalizing directive for a label. */
100 #define GLOBAL_ASM_OP ".globl "
102 /* FIXME: Hacked from the <elfos.h> one so that we avoid multiple
103 labels in a function declaration (since pa.c seems determined to do
104 it differently) */
106 #undef ASM_DECLARE_FUNCTION_NAME
107 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
108 do \
110 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
111 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
113 while (0)
115 /* As well as globalizing the label, we need to encode the label
116 to ensure a plabel is generated in an indirect call. */
118 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
119 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
120 do \
122 if (!FUNCTION_NAME_P (XSTR (FUN, 0))) \
123 pa_encode_label (FUN); \
124 (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \
126 while (0)
128 #undef TARGET_GAS
129 #define TARGET_GAS 1
131 #undef TARGET_SYNC_LIBCALL
132 #define TARGET_SYNC_LIBCALL 1
134 /* The SYNC operations are implemented as library functions, not
135 INSN patterns. As a result, the HAVE defines for the patterns are
136 not defined. We need to define them to generate the corresponding
137 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* and __GCC_ATOMIC_*_LOCK_FREE
138 defines. */
140 #define HAVE_sync_compare_and_swapqi 1
141 #define HAVE_sync_compare_and_swaphi 1
142 #define HAVE_sync_compare_and_swapsi 1
143 #define HAVE_sync_compare_and_swapdi 1
145 #undef NEED_INDICATE_EXEC_STACK
146 #define NEED_INDICATE_EXEC_STACK 1