1 /* Definitions for PA_RISC with ELF format 2 Copyright (C) 1999-2013 Free Software Foundation, Inc. 3 4 This file is part of GCC. 5 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. 10 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. 15 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/>. */ 19 20 21 #undef TARGET_OS_CPP_BUILTINS 22 #define TARGET_OS_CPP_BUILTINS() \ 23 do \ 24 { \ 25 OPENBSD_OS_CPP_BUILTINS(); \ 26 builtin_assert ("machine=bigendian"); \ 27 } \ 28 while (0) 29 30 /* Our profiling scheme doesn't LP labels and counter words. */ 31 #define NO_DEFERRED_PROFILE_COUNTERS 1 32 33 #undef STRING_ASM_OP 34 #define STRING_ASM_OP "\t.stringz\t" 35 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" 39 40 /* We want local labels to start with period if made with asm_fprintf. */ 41 #undef LOCAL_LABEL_PREFIX 42 #define LOCAL_LABEL_PREFIX "." 43 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? */ 49 50 #undef ASM_OUTPUT_ADDR_VEC_ELT 51 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ 52 if (TARGET_BIG_SWITCH) \ 53 fprintf (FILE, "\t.word .L%d\n", VALUE); \ 54 else \ 55 fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE) 56 57 #undef ASM_OUTPUT_ADDR_DIFF_ELT 58 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ 59 if (TARGET_BIG_SWITCH) \ 60 fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL); \ 61 else \ 62 fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE) 63 64 /* Use the default. */ 65 #undef ASM_OUTPUT_LABEL 66 67 /* NOTE: (*targetm.asm_out.internal_label)() is defined for us by elfos.h, and 68 does what we want (i.e. uses colons). It must be compatible with 69 ASM_GENERATE_INTERNAL_LABEL(), so do not define it here. */ 70 71 /* Use the default. */ 72 #undef ASM_OUTPUT_INTERNAL_LABEL 73 74 /* Use the default. */ 75 #undef TARGET_ASM_GLOBALIZE_LABEL 76 77 /* FIXME: Hacked from the <elfos.h> one so that we avoid multiple 78 labels in a function declaration (since pa.c seems determined to do 79 it differently) */ 80 81 #undef ASM_DECLARE_FUNCTION_NAME 82 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ 83 do \ 84 { \ 85 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \ 86 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ 87 } \ 88 while (0) 89 90 /* As well as globalizing the label, we need to encode the label 91 to ensure a plabel is generated in an indirect call. */ 92 93 #undef ASM_OUTPUT_EXTERNAL_LIBCALL 94 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ 95 do \ 96 { \ 97 if (!FUNCTION_NAME_P (XSTR (FUN, 0))) \ 98 pa_encode_label (FUN); \ 99 (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \ 100 } \ 101 while (0) 102 103 /* This says how to output an assembler line to define a global common symbol 104 with size SIZE (in bytes) and alignment ALIGN (in bits). */ 105 106 #undef ASM_OUTPUT_ALIGNED_COMMON 107 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ 108 pa_asm_output_aligned_common (FILE, NAME, SIZE, ALIGN) 109 110 /* This says how to output an assembler line to define a local common symbol 111 with size SIZE (in bytes) and alignment ALIGN (in bits). This macro 112 controls how the assembler definitions of uninitialized static variables 113 are output. */ 114 115 #undef ASM_OUTPUT_ALIGNED_LOCAL 116 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ 117 pa_asm_output_aligned_local (FILE, NAME, SIZE, ALIGN) 118 119 /* OpenBSD always uses gas. */ 120 #undef TARGET_GAS 121 #define TARGET_GAS 1 122 123 /* Layout of source language data types. */ 124 125 /* This must agree with <machine/_types.h> */ 126 #undef SIZE_TYPE 127 #define SIZE_TYPE "long unsigned int" 128 129 #undef PTRDIFF_TYPE 130 #define PTRDIFF_TYPE "long int" 131 132 #undef WCHAR_TYPE 133 #define WCHAR_TYPE "int" 134 135 #undef WCHAR_TYPE_SIZE 136 #define WCHAR_TYPE_SIZE 32 137 138 #undef WINT_TYPE 139 #define WINT_TYPE "int" 140 141 #undef LINK_SPEC 142 #define LINK_SPEC \ 143 "%{!shared:%{!nostdlib:%{!r:%{!e*:-e __start}}}} \ 144 %{shared:-shared} %{R*} \ 145 %{static:-Bstatic} \ 146 %{!static:-Bdynamic} \ 147 %{assert*} \ 148 -dynamic-linker /usr/libexec/ld.so" 149 150 #undef STARTFILE_SPEC 151 #define STARTFILE_SPEC "\ 152 %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \ 153 crtbegin%O%s} %{shared:crtbeginS%O%s}" 154 155 #undef ENDFILE_SPEC 156 #define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}" 157 158 #define OBSD_HAS_CORRECT_SPECS 159 160 #define HAVE_ENABLE_EXECUTE_STACK 161