520a57c81c
* stringpool.c: New file. * ggc-common.c (ggc_mark_string_ptr, ggc_add_string_root): Delete. (ggc_alloc_string): Now in stringpool.o. * ggc-page.c, ggc-simple.c: Do not define or allocate empty_string. * ggc.h: Delete prototype of ggc_add_string_root. #define ggc_add_string_root and ggc_mark_string to nothing. Prototype init_stringpool and stringpool_statistics. (ggc_alloc_string): Returns a const char *. * tree.c (hash_table, do_identifier_warnings): Delete. (init_obstacks): Don't initialize the identifier hash table. (get_identifier, maybe_get_identifier, start_identifier_warnings, set_identifier_size): Now in stringpool.c. * tree.h (struct tree_string): Constify pointer field. (approx_sqrt): Prototype. * Makefile.in (stringpool.o): Add rule, mention in OBJS. * toplev.c (approx_sqrt): New function. (compile_file): Call stringpool_statistics if mem_report is on. (main): Call init_stringpool. * builtins.c (c_strlen), c-decl.c (finish_decl), c-lex.c (process_directive), c-typeck.c (constructor_asmspec, struct initializer_stack, start_init), except.c (create_rethrow_ref), stmt.c (digit_strings), toplev.c (decode_f_option), tree.c (built_in_filename), varasm,c (in_named_name, assemble_static_space, struct constant_descriptor, struct deferred_string, struct pool_constant, force_const_mem), i386.c (pic_label_name, global_offset_table_name), rs6000.c (rs6000_emit_prologue, rs6000_emit_epilogue) : Constify a char *. * c-common.c (combine_strings): Combine strings in scratch buffer, then pass to build_string. * optabs.c (init_libfuncs), profile.c (init_edge_profiler, output_func_start_profiler), stmt.c (init_stmt), alpha.c (alpha_need_linkage), arm.c (arm_encode_call_attribute), i386.c (load_pic_register), ia64.c (ia64_encode_section_info), rs6000.c (rs6000_encode_section_info): Create string in scratch buffer, then pass to ggc_alloc_string. * stmt.c (expand_asm_operands): If we must adjust the constraint strings, do so by creating a new one, not by modifying the old one in place. Constify some char *s. * config/pa/pa.c (hppa_encode_label): Drop unnecessary second argument. Create string in scratch buffer, then pass to ggc_alloc_string. * config/pa/pa-protos.h: Update prototype. * config/pa/elf.h, config/pa/pa.h, config/pa/som.h: hppa_encode_label takes only one argument. * c-parse.in (if_prefix): Find the filename and line number at $-2 and $-1 respectively. * diagnostic.c (error_recursion): Add missing newline, use fputs, translate string. cp: * lex.c (struct impl_files, internal_filename): Constify a char *. java: * jcf-parse.c (get_constant), parse.y (do_merge_string_cste): Create string in scratch buffer, then pass to build_string. From-SVN: r37514
97 lines
3.5 KiB
C
97 lines
3.5 KiB
C
/* Definitions for ELF assembler support.
|
|
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
|
|
This file is part of GNU CC.
|
|
|
|
GNU CC 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)
|
|
any later version.
|
|
|
|
GNU CC 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. */
|
|
|
|
/* So we can conditionalize small amounts of code in pa.c or pa.md. */
|
|
#define OBJ_ELF
|
|
|
|
#define TEXT_SECTION_ASM_OP "\t.text"
|
|
#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 ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
|
|
do { \
|
|
if (TREE_PUBLIC (DECL)) \
|
|
{ \
|
|
fputs ("\t.EXPORT ", FILE); \
|
|
assemble_name (FILE, NAME); \
|
|
fputs (",ENTRY\n", FILE); \
|
|
} \
|
|
} 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; \
|
|
} 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. */
|
|
|
|
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, RTL) \
|
|
do { fputs ("\t.IMPORT ", FILE); \
|
|
if (!function_label_operand (RTL, VOIDmode)) \
|
|
hppa_encode_label (RTL); \
|
|
assemble_name (FILE, XSTR ((RTL), 0)); \
|
|
fputs (",ENTRY\n", FILE); \
|
|
} while (0)
|
|
|
|
/* Biggest alignment supported by the object file format of this
|
|
machine. Use this macro to limit the alignment which can be
|
|
specified using the `__attribute__ ((aligned (N)))' construct. If
|
|
not defined, the default value is `BIGGEST_ALIGNMENT'. */
|
|
#define MAX_OFILE_ALIGNMENT (32768 * 8)
|