From b366352bbd1d4439e25d46f101ba898e5642b8d9 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Thu, 22 Jul 1999 02:16:55 +0000 Subject: [PATCH] defaults.h (DWARF2_GENERATE_TEXT_SECTION_LABEL): New macro. * defaults.h (DWARF2_GENERATE_TEXT_SECTION_LABEL): New macro. * tm.texi (DWARF2_GENERATE_TEXT_SECTION_LABEL): Define it. * dwarf2out.c (dwarf2out_init): Don't output a label to mark the start of the text section if DWARF2_GENERATE_TEXT_SECTION_LABEL is false. * config/mips/iris6.h (DWARF2_GENERATE_TEXT_SECTION_LABEL): Define to zero. From-SVN: r28213 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/mips/iris6.h | 5 +++++ gcc/defaults.h | 10 ++++++++++ gcc/dwarf2out.c | 8 ++++++-- gcc/tm.texi | 7 +++++++ 5 files changed, 38 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ffc896a14bf..fb6fc1e11f9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +Wed Jul 21 00:46:58 1999 Mark P. Mitchell + + * defaults.h (DWARF2_GENERATE_TEXT_SECTION_LABEL): New macro. + * tm.texi (DWARF2_GENERATE_TEXT_SECTION_LABEL): Define it. + * dwarf2out.c (dwarf2out_init): Don't output a label to mark the + start of the text section if DWARF2_GENERATE_TEXT_SECTION_LABEL is + false. + * config/mips/iris6.h (DWARF2_GENERATE_TEXT_SECTION_LABEL): + Define to zero. + 1999-07-21 Michael Meissner * print-rtl.c (print_rtx): Print the names of the virtual diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h index 9df7732e8b0..47d4ea85d39 100644 --- a/gcc/config/mips/iris6.h +++ b/gcc/config/mips/iris6.h @@ -34,6 +34,11 @@ Boston, MA 02111-1307, USA. */ irix5.h file. */ #undef DWARF2_UNWIND_INFO +/* The Irix6 assembler will sometimes assign labels to the wrong + section unless the labels are within .ent/.end blocks. Therefore, + we avoid creating such labels. */ +#define DWARF2_GENERATE_TEXT_SECTION_LABEL 0 + /* For Irix 6, -mabi=64 implies TARGET_LONG64. */ /* This is handled in override_options. */ diff --git a/gcc/defaults.h b/gcc/defaults.h index a0e3bfca57a..14c365a2b44 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -154,3 +154,13 @@ do { fprintf (FILE, "\t%s\t", ASM_LONG); \ #if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX) #define DWARF2_UNWIND_INFO 1 #endif + +/* By default, we generate a label at the beginning and end of the + text section, and compute the size of the text section by + subtracting the two. However, on some platforms that doesn't + work, and we use the section itself, rather than a label at the + beginning of it, to indicate the start of the section. On such + platforms, define this to zero. */ +#ifndef DWARF2_GENERATE_TEXT_SECTION_LABEL +#define DWARF2_GENERATE_TEXT_SECTION_LABEL 1 +#endif diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 90bedcb0aca..4e1ebee44ad 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -10008,7 +10008,10 @@ dwarf2out_init (asm_out_file, main_input_filename) ASM_GENERATE_INTERNAL_LABEL (text_end_label, TEXT_END_LABEL, 0); ASM_GENERATE_INTERNAL_LABEL (abbrev_section_label, ABBREV_SECTION_LABEL, 0); - ASM_GENERATE_INTERNAL_LABEL (text_section_label, TEXT_SECTION_LABEL, 0); + if (DWARF2_GENERATE_TEXT_SECTION_LABEL) + ASM_GENERATE_INTERNAL_LABEL (text_section_label, TEXT_SECTION_LABEL, 0); + else + strcpy (text_section_label, stripattributes (TEXT_SECTION)); ASM_GENERATE_INTERNAL_LABEL (debug_info_section_label, DEBUG_INFO_SECTION_LABEL, 0); ASM_GENERATE_INTERNAL_LABEL (debug_line_section_label, @@ -10017,7 +10020,8 @@ dwarf2out_init (asm_out_file, main_input_filename) ASM_OUTPUT_SECTION (asm_out_file, ABBREV_SECTION); ASM_OUTPUT_LABEL (asm_out_file, abbrev_section_label); ASM_OUTPUT_SECTION (asm_out_file, TEXT_SECTION); - ASM_OUTPUT_LABEL (asm_out_file, text_section_label); + if (DWARF2_GENERATE_TEXT_SECTION_LABEL) + ASM_OUTPUT_LABEL (asm_out_file, text_section_label); ASM_OUTPUT_SECTION (asm_out_file, DEBUG_INFO_SECTION); ASM_OUTPUT_LABEL (asm_out_file, debug_info_section_label); ASM_OUTPUT_SECTION (asm_out_file, DEBUG_LINE_SECTION); diff --git a/gcc/tm.texi b/gcc/tm.texi index 28fefa847c4..a44c27bc5a2 100644 --- a/gcc/tm.texi +++ b/gcc/tm.texi @@ -6908,6 +6908,13 @@ Normally, if the user specifies only @samp{-ggdb} GNU CC will use Dwarf version 2 if available; this macro disables this. See the description of the @code{PREFERRED_DEBUGGING_TYPE} macro for more details. +@findex DWARF2_GENERATE_TEXT_SECTION_LABEL +@item DWARF2_GENERATE_TEXT_SECTION_LABEL +By default, the Dwarf 2 debugging information generator will generate a +label to mark the beginning of the text section. If it is better simply +to use the name of the text section itself, rather than an explicit label, +to indicate the beginning of the text section, define this macro to zero. + @findex PUT_SDB_@dots{} @item PUT_SDB_@dots{} Define these macros to override the assembler syntax for the special