* target.h (asm_out.file_start, file_start_app_off,
[official-gcc.git] / gcc / config / pa / elf.h
blob5b35178ea91ff6675b5f1a5f5c076f7dacef3870
1 /* Definitions for ELF assembler support.
2 Copyright (C) 1999 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC 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)
9 any later version.
11 GNU CC 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 GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* So we can conditionalize small amounts of code in pa.c or pa.md. */
22 #define OBJ_ELF
24 #define ENDFILE_SPEC "crtend.o%s"
26 #define STARTFILE_SPEC "%{!shared: \
27 %{!symbolic: \
28 %{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
29 crtbegin.o%s"
31 #define TEXT_SECTION_ASM_OP "\t.text"
32 #define DATA_SECTION_ASM_OP "\t.data"
33 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
35 #define TARGET_ASM_FILE_START pa_elf_file_start
37 #undef ASM_DECLARE_FUNCTION_NAME
38 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
39 do { \
40 if (TREE_PUBLIC (DECL)) \
41 { \
42 fputs ("\t.EXPORT ", FILE); \
43 assemble_name (FILE, NAME); \
44 fputs (",ENTRY\n", FILE); \
45 } \
46 } while (0)
48 /* This is how to output a command to make the user-level label named NAME
49 defined for reference from other files.
51 We call assemble_name, which in turn sets TREE_SYMBOL_REFERENCED. This
52 macro will restore the original value of TREE_SYMBOL_REFERENCED to avoid
53 placing useless function definitions in the output file.
55 Also note that the SOM based tools need the symbol imported as a CODE
56 symbol, while the ELF based tools require the symbol to be imported as
57 an ENTRY symbol. What a crock. */
59 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
60 do { int save_referenced; \
61 save_referenced = TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (DECL)); \
62 fputs ("\t.IMPORT ", FILE); \
63 assemble_name (FILE, NAME); \
64 if (FUNCTION_NAME_P (NAME)) \
65 fputs (",ENTRY\n", FILE); \
66 else \
67 fputs (",DATA\n", FILE); \
68 TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (DECL)) = save_referenced; \
69 } while (0)
71 /* The bogus HP assembler requires ALL external references to be
72 "imported", even library calls. They look a bit different, so
73 here's this macro.
75 Also note not all libcall names are passed to
76 targetm.encode_section_info (__main for example). To make sure all
77 libcall names have section info recorded in them, we do it here. */
79 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
80 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, RTL) \
81 do { fputs ("\t.IMPORT ", FILE); \
82 if (!function_label_operand (RTL, VOIDmode)) \
83 hppa_encode_label (RTL); \
84 assemble_name (FILE, XSTR ((RTL), 0)); \
85 fputs (",ENTRY\n", FILE); \
86 } while (0)
88 /* Biggest alignment supported by the object file format of this
89 machine. Use this macro to limit the alignment which can be
90 specified using the `__attribute__ ((aligned (N)))' construct. If
91 not defined, the default value is `BIGGEST_ALIGNMENT'. */
92 #define MAX_OFILE_ALIGNMENT (32768 * 8)