1 /* Definitions of target machine for GNU compiler, for HPs running
2 HPUX using the 64bit runtime model.
3 Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* We can debug dynamically linked executables on hpux11; we also
23 want dereferencing of a NULL pointer to cause a SEGV. */
26 "-E %{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{shared:-shared}"
28 /* Like the default, except no -lg. */
35 %{threads:-lcma -lc_r}}\
36 %{p: -L/lib/libp/ -lc}\
37 %{pg: -L/lib/libp/ -lc}}} /usr/lib/pa20_64/milli.a"
39 /* Under hpux11, the normal location of the `ld' and `as' programs is the
40 /usr/ccs/bin directory. */
44 #define MD_EXEC_PREFIX "/usr/ccs/bin"
47 /* Under hpux11 the normal location of the various pa20_64 *crt*.o files
48 is the /usr/ccs/lib/pa20_64 directory. Some files may also be in the
49 /opt/langtools/lib/pa20_64 directory. */
52 #undef MD_STARTFILE_PREFIX
53 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/pa20_64/"
57 #undef MD_STARTFILE_PREFIX_1
58 #define MD_STARTFILE_PREFIX_1 "/opt/langtools/lib/pa20_64/"
61 /* hpux11 has the new HP assembler. It's still lousy, but it's a whole lot
62 better than the assembler shipped with older versions of hpux. */
63 #undef NEW_HP_ASSEMBLER
64 #define NEW_HP_ASSEMBLER 1
67 #define ASM_FILE_START(FILE) \
70 fputs("\t.LEVEL 2.0w\n", FILE); \
71 else if (TARGET_PA_20) \
72 fputs("\t.LEVEL 2.0\n", FILE); \
73 else if (TARGET_PA_11) \
74 fputs("\t.LEVEL 1.1\n", FILE); \
76 fputs("\t.LEVEL 1.0\n", FILE); \
78 fprintf (FILE, "\t.IMPORT _mcount, CODE\n");\
79 if (write_symbols != NO_DEBUG) \
80 output_file_directive ((FILE), main_input_filename); \
83 /* It looks like DWARF2 will be the easiest debug format to handle on this
85 #define OBJECT_FORMAT_ELF
86 #define DWARF2_DEBUGGING_INFO
87 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
88 /* This isn't quite ready yet. I'm seeing it mess up some line
89 tables. For example, we're getting lines starting/ending at
90 impossible addresses. */
91 #define DWARF2_ASM_LINE_DEBUG_INFO 1
94 /* The rest of this file is copied from the generic svr4.h. One day we
95 would like to simply include svr4.h instead of copying all these
98 /* Support const sections and the ctors and dtors sections for g++.
99 Note that there appears to be two different ways to support const
100 sections at the moment. You can either #define the symbol
101 READONLY_DATA_SECTION (giving it some code which switches to the
102 readonly data section) or else you can #define the symbols
103 EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
104 SELECT_RTX_SECTION. We do both here just to be on the safe side. */
106 #define USE_CONST_SECTION 1
108 #define CONST_SECTION_ASM_OP "\t.section\t.rodata"
110 /* On svr4, we *do* have support for the .init and .fini sections, and we
111 can put stuff in there to be executed before and after `main'. We let
112 crtstuff.c and other files know this by defining the following symbols.
113 The definitions say how to change sections to the .init and .fini
114 sections. This is the same for all known svr4 assemblers. */
116 /* For the time being, we aren't using init sections. `P' relocations
117 are currently used for function references. However, P relocations are
118 treated as data references and data references are bound by dld.sl
119 immediately at program startup. This causes an abort due to undefined
120 weak symbols in crtbegin.o (e.g., __register_frame_info). Possibly
121 Q relocations might avoid this problem but the GNU assembler doesn't
124 #define INIT_SECTION_ASM_OP "\t.section\t.init"
125 #define FINI_SECTION_ASM_OP "\t.section\t.fini"
127 #define EH_FRAME_IN_DATA_SECTION 1
130 #define ENDFILE_SPEC ""
132 #undef STARTFILE_SPEC
133 #define STARTFILE_SPEC "%{!shared: \
135 %{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}"
138 /* A default list of other sections which we might be "in" at any given
139 time. For targets that use additional sections (e.g. .tdesc) you
140 should override this definition in the target-specific file which
141 includes this file. */
143 #undef EXTRA_SECTIONS
144 #define EXTRA_SECTIONS in_const
146 /* A default list of extra section function definitions. For targets
147 that use additional sections (e.g. .tdesc) you should override this
148 definition in the target-specific file which includes this file. */
150 #undef EXTRA_SECTION_FUNCTIONS
151 #define EXTRA_SECTION_FUNCTIONS \
152 CONST_SECTION_FUNCTION
155 #define READONLY_DATA_SECTION() const_section ()
157 #define CONST_SECTION_FUNCTION \
161 if (!USE_CONST_SECTION) \
163 else if (in_section != in_const) \
165 fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
166 in_section = in_const; \
170 /* Switch into a generic section. */
171 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
173 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
175 /* Define the strings used for the special svr4 .type and .size directives.
176 These strings generally do not vary from one system running svr4 to
177 another, but if a given system (e.g. m88k running svr) needs to use
178 different pseudo-op names for these, they may be overridden in the
179 file which includes this one. */
181 #define TYPE_ASM_OP "\t.type\t"
182 #define SIZE_ASM_OP "\t.size\t"
184 /* This is how we tell the assembler that a symbol is weak. */
186 #define ASM_WEAKEN_LABEL(FILE,NAME) \
187 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
188 fputc ('\n', FILE); } while (0)
190 /* The following macro defines the format used to output the second
191 operand of the .type assembler directive. Different svr4 assemblers
192 expect various different forms for this operand. The one given here
193 is just a default. You may need to override it in your machine-
194 specific tm.h file (depending upon the particulars of your assembler). */
196 #define TYPE_OPERAND_FMT "@%s"
198 /* Write the extra assembler code needed to declare a function's result.
199 Most svr4 assemblers don't require any special declaration of the
200 result value, but there are exceptions. */
202 #ifndef ASM_DECLARE_RESULT
203 #define ASM_DECLARE_RESULT(FILE, RESULT)