1 /* Definitions for PA_RISC with ELF format
2 Copyright (C) 1999-2018 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)
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() \
25 OPENBSD_OS_CPP_BUILTINS(); \
26 builtin_assert ("machine=bigendian"); \
30 /* Our profiling scheme doesn't LP labels and counter words. */
31 #define NO_DEFERRED_PROFILE_COUNTERS 1
34 #define STRING_ASM_OP "\t.stringz\t"
36 #define TEXT_SECTION_ASM_OP "\t.text"
37 #define DATA_SECTION_ASM_OP "\t.data"
38 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
40 /* We want local labels to start with period if made with asm_fprintf. */
41 #undef LOCAL_LABEL_PREFIX
42 #define LOCAL_LABEL_PREFIX "."
44 /* Define these to generate the Linux/ELF/SysV style of internal
45 labels all the time - i.e. to be compatible with
46 ASM_GENERATE_INTERNAL_LABEL in <elfos.h>. Compare these with the
47 ones in pa.h and note the lack of dollar signs in these. FIXME:
48 shouldn't we fix pa.h to use ASM_GENERATE_INTERNAL_LABEL instead? */
50 #undef ASM_OUTPUT_ADDR_VEC_ELT
51 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
52 fprintf (FILE, "\t.word .L%d\n", VALUE)
54 #undef ASM_OUTPUT_ADDR_DIFF_ELT
55 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
56 fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL)
58 /* Use the default. */
59 #undef ASM_OUTPUT_LABEL
61 /* NOTE: (*targetm.asm_out.internal_label)() is defined for us by elfos.h, and
62 does what we want (i.e. uses colons). It must be compatible with
63 ASM_GENERATE_INTERNAL_LABEL(), so do not define it here. */
65 /* Use the default. */
66 #undef ASM_OUTPUT_INTERNAL_LABEL
68 /* Use the default. */
69 #undef TARGET_ASM_GLOBALIZE_LABEL
71 /* FIXME: Hacked from the <elfos.h> one so that we avoid multiple
72 labels in a function declaration (since pa.c seems determined to do
75 #undef ASM_DECLARE_FUNCTION_NAME
76 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
79 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
80 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
84 /* As well as globalizing the label, we need to encode the label
85 to ensure a plabel is generated in an indirect call. */
87 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
88 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
91 if (!FUNCTION_NAME_P (XSTR (FUN, 0))) \
92 pa_encode_label (FUN); \
93 (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \
97 /* This says how to output an assembler line to define a global common symbol
98 with size SIZE (in bytes) and alignment ALIGN (in bits). */
100 #undef ASM_OUTPUT_ALIGNED_COMMON
101 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
102 pa_asm_output_aligned_common (FILE, NAME, SIZE, ALIGN)
104 /* This says how to output an assembler line to define a local common symbol
105 with size SIZE (in bytes) and alignment ALIGN (in bits). This macro
106 controls how the assembler definitions of uninitialized static variables
109 #undef ASM_OUTPUT_ALIGNED_LOCAL
110 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
111 pa_asm_output_aligned_local (FILE, NAME, SIZE, ALIGN)
113 /* OpenBSD always uses gas. */
117 /* Layout of source language data types. */
119 /* This must agree with <machine/_types.h> */
121 #define SIZE_TYPE "long unsigned int"
124 #define PTRDIFF_TYPE "long int"
127 #define WCHAR_TYPE "int"
129 #undef WCHAR_TYPE_SIZE
130 #define WCHAR_TYPE_SIZE 32
133 #define WINT_TYPE "int"
137 "%{!shared:%{!nostdlib:%{!r:%{!e*:-e __start}}}} \
138 %{shared:-shared} %{R*} \
140 %{!static:-Bdynamic} \
142 -dynamic-linker /usr/libexec/ld.so"
144 #undef STARTFILE_SPEC
145 #define STARTFILE_SPEC "\
146 %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \
147 crtbegin%O%s} %{shared:crtbeginS%O%s}"
150 #define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
152 #define OBSD_HAS_CORRECT_SPECS
154 #define HAVE_ENABLE_EXECUTE_STACK