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 NETBSD_OS_CPP_BUILTINS_ELF(); \ 26 builtin_assert ("machine=bigendian"); \ 27 } \ 28 while (0) 29 30 #undef CPP_SPEC 31 #define CPP_SPEC NETBSD_CPP_SPEC 32 33 #undef ASM_SPEC 34 #define ASM_SPEC \ 35 "%{v:-V} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}" 36 37 #undef EXTRA_SPECS 38 #define EXTRA_SPECS \ 39 { "netbsd_entry_point", NETBSD_ENTRY_POINT }, 40 41 #define NETBSD_ENTRY_POINT "__start" 42 43 #undef LINK_SPEC 44 #define LINK_SPEC NETBSD_LINK_SPEC_ELF 45 46 /* NetBSD profiling functions don't need gcc to allocate counters. */ 47 #define NO_DEFERRED_PROFILE_COUNTERS 1 48 49 /* Define the strings used for the special svr4 .type and .size directives. 50 These strings generally do not vary from one system running svr4 to 51 another, but if a given system (e.g. m88k running svr) needs to use 52 different pseudo-op names for these, they may be overridden in the 53 file which includes this one. */ 54 55 #undef STRING_ASM_OP 56 #define STRING_ASM_OP "\t.stringz\t" 57 58 #define TEXT_SECTION_ASM_OP "\t.text" 59 #define DATA_SECTION_ASM_OP "\t.data" 60 #define BSS_SECTION_ASM_OP "\t.section\t.bss" 61 62 #define TARGET_ASM_FILE_START pa_linux_file_start 63 64 /* We want local labels to start with period if made with asm_fprintf. */ 65 #undef LOCAL_LABEL_PREFIX 66 #define LOCAL_LABEL_PREFIX "." 67 68 /* Define these to generate the Linux/ELF/SysV style of internal 69 labels all the time - i.e. to be compatible with 70 ASM_GENERATE_INTERNAL_LABEL in <elfos.h>. Compare these with the 71 ones in pa.h and note the lack of dollar signs in these. FIXME: 72 shouldn't we fix pa.h to use ASM_GENERATE_INTERNAL_LABEL instead? */ 73 74 #undef ASM_OUTPUT_ADDR_VEC_ELT 75 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ 76 if (TARGET_BIG_SWITCH) \ 77 fprintf (FILE, "\t.word .L%d\n", VALUE); \ 78 else \ 79 fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE) 80 81 #undef ASM_OUTPUT_ADDR_DIFF_ELT 82 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ 83 if (TARGET_BIG_SWITCH) \ 84 fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL); \ 85 else \ 86 fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE) 87 88 /* Use the default. */ 89 #undef ASM_OUTPUT_LABEL 90 91 /* NOTE: (*targetm.asm_out.internal_label)() is defined for us by elfos.h, and 92 does what we want (i.e. uses colons). It must be compatible with 93 ASM_GENERATE_INTERNAL_LABEL(), so do not define it here. */ 94 95 /* Use the default. */ 96 #undef ASM_OUTPUT_INTERNAL_LABEL 97 98 /* Use the default. */ 99 #undef TARGET_ASM_GLOBALIZE_LABEL 100 /* Globalizing directive for a label. */ 101 #define GLOBAL_ASM_OP ".globl " 102 103 /* FIXME: Hacked from the <elfos.h> one so that we avoid multiple 104 labels in a function declaration (since pa.c seems determined to do 105 it differently) */ 106 107 #undef ASM_DECLARE_FUNCTION_NAME 108 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ 109 do \ 110 { \ 111 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \ 112 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ 113 } \ 114 while (0) 115 116 /* As well as globalizing the label, we need to encode the label 117 to ensure a plabel is generated in an indirect call. */ 118 119 #undef ASM_OUTPUT_EXTERNAL_LIBCALL 120 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ 121 do \ 122 { \ 123 if (!FUNCTION_NAME_P (XSTR (FUN, 0))) \ 124 pa_encode_label (FUN); \ 125 (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \ 126 } \ 127 while (0) 128 129 /* NetBSD always uses gas. */ 130 #undef TARGET_GAS 131 #define TARGET_GAS 1 132 133 /* Use long int for these type to make hppa64 compatibility easier. */ 134 #undef SIZE_TYPE 135 #define SIZE_TYPE "long unsigned int" 136 137 #undef PTRDIFF_TYPE 138 #define PTRDIFF_TYPE "long int" 139 140 #if 0 141 #undef TARGET_SYNC_LIBCALL 142 #define TARGET_SYNC_LIBCALL 1 143 #endif 144 145 #if 0 146 #undef TARGET_SYNC_LIBCALL 147 #define TARGET_SYNC_LIBCALL 1 148 #endif 149