OSDN Git Service

* arc.c (output_shift): Use stdio instead of asm_fprintf.
[pf3gnuchains/gcc-fork.git] / gcc / config / pa / elf.h
1 /* Definitions for ELF assembler support.
2    Copyright (C) 1999 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
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.
10
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.
15
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.  */
20
21 /* So we can conditionalize small amounts of code in pa.c or pa.md.  */
22 #define OBJ_ELF
23
24 #define ENDFILE_SPEC "crtend.o%s"
25
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"
30
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"
34
35 #undef ASM_FILE_START
36 #define ASM_FILE_START(FILE) \
37 do {  \
38      if (TARGET_PA_20) \
39        fputs("\t.LEVEL 2.0\n", FILE); \
40      else if (TARGET_PA_11) \
41        fputs("\t.LEVEL 1.1\n", FILE); \
42      else \
43        fputs("\t.LEVEL 1.0\n", FILE); \
44      if (profile_flag)\
45        fprintf (FILE, "\t.IMPORT _mcount, ENTRY\n");\
46      if (write_symbols != NO_DEBUG) \
47        output_file_directive ((FILE), main_input_filename); \
48    } while (0)
49
50 #undef ASM_DECLARE_FUNCTION_NAME
51 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
52 do {  \
53   if (TREE_PUBLIC (DECL)) \
54     { \
55       fputs ("\t.EXPORT ", FILE); \
56       assemble_name (FILE, NAME); \
57       fputs (",ENTRY\n", FILE); \
58     } \
59    } while (0)
60
61 /* This is how to output a command to make the user-level label named NAME
62    defined for reference from other files.
63
64    We call assemble_name, which in turn sets TREE_SYMBOL_REFERENCED.  This
65    macro will restore the original value of TREE_SYMBOL_REFERENCED to avoid
66    placing useless function definitions in the output file.
67
68    Also note that the SOM based tools need the symbol imported as a CODE
69    symbol, while the ELF based tools require the symbol to be imported as
70    an ENTRY symbol.  What a crock.  */
71
72 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME)   \
73   do { int save_referenced;                                     \
74        save_referenced = TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (DECL)); \
75        fputs ("\t.IMPORT ", FILE);                                      \
76          assemble_name (FILE, NAME);                            \
77        if (FUNCTION_NAME_P (NAME))                              \
78          fputs (",ENTRY\n", FILE);                              \
79        else                                                     \
80          fputs (",DATA\n", FILE);                               \
81        TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (DECL)) = save_referenced; \
82      } while (0)
83
84 /* The bogus HP assembler requires ALL external references to be
85    "imported", even library calls. They look a bit different, so
86    here's this macro.
87
88    Also note not all libcall names are passed to
89    targetm.encode_section_info (__main for example).  To make sure all
90    libcall names have section info recorded in them, we do it here.  */
91
92 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
93 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, RTL) \
94   do { fputs ("\t.IMPORT ", FILE);                                      \
95        if (!function_label_operand (RTL, VOIDmode))                     \
96          hppa_encode_label (RTL);                                       \
97        assemble_name (FILE, XSTR ((RTL), 0));                           \
98        fputs (",ENTRY\n", FILE);                                        \
99      } while (0)
100
101 /* Biggest alignment supported by the object file format of this
102    machine.  Use this macro to limit the alignment which can be
103    specified using the `__attribute__ ((aligned (N)))' construct.  If
104    not defined, the default value is `BIGGEST_ALIGNMENT'.  */
105 #define MAX_OFILE_ALIGNMENT (32768 * 8)