/* Definitions for ELF assembler support.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2003, 2005, 2007 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
/* So we can conditionalize small amounts of code in pa.c or pa.md. */
#define OBJ_ELF
#define DATA_SECTION_ASM_OP "\t.data"
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-do { \
- if (TARGET_PA_20) \
- fputs("\t.LEVEL 2.0\n", FILE); \
- else if (TARGET_PA_11) \
- fputs("\t.LEVEL 1.1\n", FILE); \
- else \
- fputs("\t.LEVEL 1.0\n", FILE); \
- if (profile_flag)\
- fprintf (FILE, "\t.IMPORT _mcount, ENTRY\n");\
- if (write_symbols != NO_DEBUG) \
- output_file_directive ((FILE), main_input_filename); \
- } while (0)
+#define TARGET_ASM_FILE_START pa_elf_file_start
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
} \
} while (0)
-/* This is how to output a command to make the user-level label named NAME
- defined for reference from other files.
-
- We call assemble_name, which in turn sets TREE_SYMBOL_REFERENCED. This
- macro will restore the original value of TREE_SYMBOL_REFERENCED to avoid
- placing useless function definitions in the output file.
-
- Also note that the SOM based tools need the symbol imported as a CODE
- symbol, while the ELF based tools require the symbol to be imported as
- an ENTRY symbol. What a crock. */
-
-#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
- do { int save_referenced; \
- save_referenced = TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (DECL)); \
- fputs ("\t.IMPORT ", FILE); \
- assemble_name (FILE, NAME); \
- if (FUNCTION_NAME_P (NAME)) \
- fputs (",ENTRY\n", FILE); \
- else \
- fputs (",DATA\n", FILE); \
- TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (DECL)) = save_referenced; \
+/* This is how to output a command to make the user-level label
+ named NAME defined for reference from other files. We use
+ assemble_name_raw instead of assemble_name since a symbol in
+ a .IMPORT directive that isn't otherwise referenced is not
+ placed in the symbol table of the assembled object.
+
+ Failure to import a function reference can cause the HP linker
+ to segmentation fault!
+
+ Note that the SOM based tools need the symbol imported as a
+ CODE symbol, while the ELF based tools require the symbol to
+ be imported as an ENTRY symbol. */
+
+#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
+ pa_hpux_asm_output_external ((FILE), (DECL), (NAME))
+#define ASM_OUTPUT_EXTERNAL_REAL(FILE, DECL, NAME) \
+ do { fputs ("\t.IMPORT ", FILE); \
+ assemble_name_raw (FILE, NAME); \
+ if (FUNCTION_NAME_P (NAME)) \
+ fputs (",ENTRY\n", FILE); \
+ else \
+ fputs (",DATA\n", FILE); \
} while (0)
/* The bogus HP assembler requires ALL external references to be
"imported", even library calls. They look a bit different, so
here's this macro.
- Also note not all libcall names are passed to ENCODE_SECTION_INFO
- (__main for example). To make sure all libcall names have section
- info recorded in them, we do it here. */
+ Also note not all libcall names are passed to
+ targetm.encode_section_info (__main for example). To make sure all
+ libcall names have section info recorded in them, we do it here. */
#undef ASM_OUTPUT_EXTERNAL_LIBCALL
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, RTL) \