1 /* Definitions for PA_RISC with ELF format
2 Copyright 1999, 2000, 2001, 2002, 2003 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 2, 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 COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
22 /* A C expression whose value is RTL representing the location of the
23 incoming return address at the beginning of any function, before the
24 prologue. You only need to define this macro if you want to support
25 call frame debugging information like that provided by DWARF 2. */
26 #define INCOMING_RETURN_ADDR_RTX (gen_rtx_REG (word_mode, 2))
27 #define DWARF_FRAME_RETURN_COLUMN (DWARF_FRAME_REGNUM (2))
29 /* This macro chooses the encoding of pointers embedded in the exception
30 handling sections. If at all possible, this should be defined such
31 that the exception handling section will not require dynamic relocations,
32 and so may be read-only.
34 FIXME: We use DW_EH_PE_aligned to output a PLABEL constructor for
35 global function pointers. */
36 /* XXXMRG: should we use the version in <pa/pa.h>? */
37 #undef ASM_PREFERRED_EH_DATA_FORMAT
38 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
39 (CODE == 2 && GLOBAL ? DW_EH_PE_aligned : DW_EH_PE_absptr)
41 /* Handle special EH pointer encodings. Absolute, pc-relative, and
42 indirect are handled automatically. Since pc-relative encoding is
43 not possible on the PA and we don't have the infrastructure for
44 data relative encoding, we use aligned plabels for global function
46 /* XXXMRG: should we use the version in <pa/pa.h>? */
47 #undef ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX
48 #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
50 if (((ENCODING) & 0x0F) == DW_EH_PE_aligned) \
52 fputs (integer_asm_op (SIZE, FALSE), FILE); \
54 assemble_name (FILE, XSTR (ADDR, 0)); \
59 #undef TARGET_OS_CPP_BUILTINS
60 #define TARGET_OS_CPP_BUILTINS() \
63 NETBSD_OS_CPP_BUILTINS_ELF(); \
68 #define CPP_SPEC NETBSD_CPP_SPEC
72 "%{v:-V} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
76 { "netbsd_entry_point", NETBSD_ENTRY_POINT },
78 #define NETBSD_ENTRY_POINT "__start"
81 #define LINK_SPEC NETBSD_LINK_SPEC_ELF
83 /* NetBSD profiling functions don't need gcc to allocate counters. */
84 #define NO_DEFERRED_PROFILE_COUNTERS 1
86 /* Define the strings used for the special svr4 .type and .size directives.
87 These strings generally do not vary from one system running svr4 to
88 another, but if a given system (e.g. m88k running svr) needs to use
89 different pseudo-op names for these, they may be overridden in the
90 file which includes this one. */
93 #define STRING_ASM_OP "\t.stringz"
95 #define TEXT_SECTION_ASM_OP "\t.text"
96 #define DATA_SECTION_ASM_OP "\t.data"
97 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
99 #define TARGET_ASM_FILE_START pa_linux_file_start
101 /* We want local labels to start with period if made with asm_fprintf. */
102 #undef LOCAL_LABEL_PREFIX
103 #define LOCAL_LABEL_PREFIX "."
105 /* Define these to generate the Linux/ELF/SysV style of internal
106 labels all the time - i.e. to be compatible with
107 ASM_GENERATE_INTERNAL_LABEL in <elfos.h>. Compare these with the
108 ones in pa.h and note the lack of dollar signs in these. FIXME:
109 shouldn't we fix pa.h to use ASM_GENERATE_INTERNAL_LABEL instead? */
111 #undef ASM_OUTPUT_ADDR_VEC_ELT
112 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
113 if (TARGET_BIG_SWITCH) \
114 fprintf (FILE, "\t.word .L%d\n", VALUE); \
116 fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
118 #undef ASM_OUTPUT_ADDR_DIFF_ELT
119 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
120 if (TARGET_BIG_SWITCH) \
121 fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL); \
123 fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
125 /* Use the default. */
126 #undef ASM_OUTPUT_LABEL
128 /* NOTE: (*targetm.asm_out.internal_label)() is defined for us by elfos.h, and
129 does what we want (i.e. uses colons). It must be compatible with
130 ASM_GENERATE_INTERNAL_LABEL(), so do not define it here. */
132 /* Use the default. */
133 #undef TARGET_ASM_GLOBALIZE_LABEL
134 /* Globalizing directive for a label. */
135 #define GLOBAL_ASM_OP ".globl "
137 /* FIXME: Hacked from the <elfos.h> one so that we avoid multiple
138 labels in a function declaration (since pa.c seems determined to do
141 #undef ASM_DECLARE_FUNCTION_NAME
142 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
145 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
146 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
150 /* As well as globalizing the label, we need to encode the label
151 to ensure a plabel is generated in an indirect call. */
153 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
154 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
157 if (!FUNCTION_NAME_P (XSTR (FUN, 0))) \
158 hppa_encode_label (FUN); \
159 (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \
163 /* NetBSD always uses gas. */
167 /* Use long int for these type to make hppa64 compatibility easier. */
169 #define SIZE_TYPE "long unsigned int"
172 #define PTRDIFF_TYPE "long int"