1 /* Definitions for PA_RISC with ELF format
2 Copyright (C) 1999-2021 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 NETBSD_OS_CPP_BUILTINS_ELF(); \
26 builtin_assert ("machine=bigendian"); \
31 #define CPP_SPEC NETBSD_CPP_SPEC
35 "%{v:-V} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
38 #define EXTRA_SPECS NETBSD_SUBTARGET_EXTRA_SPECS
39 #undef SUBTARGET_EXTRA_SPECS
41 #define NETBSD_ENTRY_POINT "__start"
44 #define LINK_SPEC NETBSD_LINK_SPEC_ELF
46 /* NetBSD profiling functions don't need gcc to allocate counters. */
47 #define NO_DEFERRED_PROFILE_COUNTERS 1
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. */
56 #define STRING_ASM_OP "\t.stringz\t"
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"
62 #define TARGET_ASM_FILE_START pa_linux_file_start
64 /* We want local labels to start with period if made with asm_fprintf. */
65 #undef LOCAL_LABEL_PREFIX
66 #define LOCAL_LABEL_PREFIX "."
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? */
74 #undef ASM_OUTPUT_ADDR_VEC_ELT
75 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
76 fprintf (FILE, "\t.word .L%d\n", VALUE)
78 #undef ASM_OUTPUT_ADDR_DIFF_ELT
79 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
80 fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL)
82 /* Use the default. */
83 #undef ASM_OUTPUT_LABEL
85 /* NOTE: (*targetm.asm_out.internal_label)() is defined for us by elfos.h, and
86 does what we want (i.e. uses colons). It must be compatible with
87 ASM_GENERATE_INTERNAL_LABEL(), so do not define it here. */
89 /* Use the default. */
90 #undef ASM_OUTPUT_INTERNAL_LABEL
92 /* Use the default. */
93 #undef TARGET_ASM_GLOBALIZE_LABEL
94 /* Globalizing directive for a label. */
95 #define GLOBAL_ASM_OP ".globl "
97 /* FIXME: Hacked from the <elfos.h> one so that we avoid multiple
98 labels in a function declaration (since pa.c seems determined to do
101 #undef ASM_DECLARE_FUNCTION_NAME
102 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
105 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
106 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
110 /* As well as globalizing the label, we need to encode the label
111 to ensure a plabel is generated in an indirect call. */
113 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
114 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
117 if (!FUNCTION_NAME_P (XSTR (FUN, 0))) \
118 pa_encode_label (FUN); \
119 (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \
123 /* NetBSD always uses gas. */
127 /* Use long int for these type to make hppa64 compatibility easier. */
129 #define SIZE_TYPE "long unsigned int"
132 #define PTRDIFF_TYPE "long int"
135 #undef TARGET_SYNC_LIBCALL
136 #define TARGET_SYNC_LIBCALL 1