OSDN Git Service

* pa.c (pa_output_function_prologue): Delete prototype. Make function
[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 TEXT_SECTION_ASM_OP "\t.text"
25 #define DATA_SECTION_ASM_OP "\t.data"
26 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
27
28 #undef ASM_FILE_START
29 #define ASM_FILE_START(FILE) \
30 do {  \
31      if (TARGET_PA_20) \
32        fputs("\t.LEVEL 2.0\n", FILE); \
33      else if (TARGET_PA_11) \
34        fputs("\t.LEVEL 1.1\n", FILE); \
35      else \
36        fputs("\t.LEVEL 1.0\n", FILE); \
37      if (profile_flag)\
38        fprintf (FILE, "\t.IMPORT _mcount, ENTRY\n");\
39      if (write_symbols != NO_DEBUG) \
40        output_file_directive ((FILE), main_input_filename); \
41    } while (0)
42
43 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
44 do {  \
45   if (TREE_PUBLIC (DECL)) \
46     { \
47       fputs ("\t.EXPORT ", FILE); \
48       assemble_name (FILE, NAME); \
49       fputs (",ENTRY\n", FILE); \
50     } \
51    } while (0)
52
53 /* This is how to output a command to make the user-level label named NAME
54    defined for reference from other files.
55
56    We call assemble_name, which in turn sets TREE_SYMBOL_REFERENCED.  This
57    macro will restore the original value of TREE_SYMBOL_REFERENCED to avoid
58    placing useless function definitions in the output file.
59
60    Also note that the SOM based tools need the symbol imported as a CODE
61    symbol, while the ELF based tools require the symbol to be imported as
62    an ENTRY symbol.  What a crock.  */
63
64 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME)   \
65   do { int save_referenced;                                     \
66        save_referenced = TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (DECL)); \
67        fputs ("\t.IMPORT ", FILE);                                      \
68          assemble_name (FILE, NAME);                            \
69        if (FUNCTION_NAME_P (NAME))                              \
70          fputs (",ENTRY\n", FILE);                              \
71        else                                                     \
72          fputs (",DATA\n", FILE);                               \
73        TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (DECL)) = save_referenced; \
74      } while (0)
75
76 /* The bogus HP assembler requires ALL external references to be
77    "imported", even library calls. They look a bit different, so
78    here's this macro.
79
80    Also note not all libcall names are passed to ENCODE_SECTION_INFO
81    (__main for example).  To make sure all libcall names have section
82    info recorded in them, we do it here.  */
83
84 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, RTL) \
85   do { fputs ("\t.IMPORT ", FILE);                                      \
86        if (!function_label_operand (RTL, VOIDmode))                     \
87          hppa_encode_label (RTL);                                       \
88        assemble_name (FILE, XSTR ((RTL), 0));                           \
89        fputs (",ENTRY\n", FILE);                                        \
90      } while (0)
91
92 /* Biggest alignment supported by the object file format of this
93    machine.  Use this macro to limit the alignment which can be
94    specified using the `__attribute__ ((aligned (N)))' construct.  If
95    not defined, the default value is `BIGGEST_ALIGNMENT'.  */
96 #define MAX_OFILE_ALIGNMENT (32768 * 8)