From f3403757ec3409d713ace35f9ff07988667560ac Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Mon, 24 Sep 2001 16:30:28 +0000 Subject: [PATCH] som.h (ASM_OUTPUT_EXTERNAL): Improve formatting. * som.h (ASM_OUTPUT_EXTERNAL): Improve formatting. (ASM_OUTPUT_EXTERNAL_LIBCALL): Only generate a .IMPORT statement for the libcall if there isn't a referenced identifier for the symbol. From-SVN: r45777 --- gcc/ChangeLog | 6 ++++++ gcc/config/pa/som.h | 23 +++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d526acff22a..982fc5a95f9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2001-09-24 John David Anglin + + * som.h (ASM_OUTPUT_EXTERNAL): Improve formatting. + (ASM_OUTPUT_EXTERNAL_LIBCALL): Only generate a .IMPORT statement for + the libcall if there isn't a referenced identifier for the symbol. + 2001-09-24 John David Anglin * pa.h (TRAMPOLINE_TEMPLATE): Add two words to the template for diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h index 7588b66d9c2..7ce97ef05fa 100644 --- a/gcc/config/pa/som.h +++ b/gcc/config/pa/som.h @@ -312,8 +312,8 @@ readonly_data () \ #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); \ + fputs ("\t.IMPORT ", FILE); \ + assemble_name (FILE, NAME); \ if (FUNCTION_NAME_P (NAME)) \ fputs (",CODE\n", FILE); \ else \ @@ -327,14 +327,25 @@ readonly_data () \ 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. */ + info recorded in them, we do it here. We must also ensure that + we don't import a libcall that has been previously exported since + the HP assembler may change an ENTRY symbol to a CODE symbol. */ #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, RTL) \ - do { fputs ("\t.IMPORT ", FILE); \ + do { const char *name; \ + tree id; \ + \ if (!function_label_operand (RTL, VOIDmode)) \ hppa_encode_label (RTL); \ - assemble_name (FILE, XSTR ((RTL), 0)); \ - fputs (",CODE\n", FILE); \ + \ + STRIP_NAME_ENCODING (name, XSTR ((RTL), 0)); \ + id = maybe_get_identifier (name); \ + if (! id || ! TREE_SYMBOL_REFERENCED (id)) \ + { \ + fputs ("\t.IMPORT ", FILE); \ + assemble_name (FILE, XSTR ((RTL), 0)); \ + fputs (",CODE\n", FILE); \ + } \ } while (0) #define ASM_FILE_END(FILE) output_deferred_plabels (FILE)