This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: .Ltext0 handling in MIPS back-end



Jim --

  Thanks for the information.  How about this patch, which does indeed
seem to fix the problem?

  If you approve, I will also add any appropriate entry to the list of
macros to define in back-end configuration files in the TeXinfo
documentation.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

Wed Jul 21 00:46:58 1999  Mark P. Mitchell  <mark@codesourcery.com>

	* defaults.h (DWARF2_GENERATE_TEXT_SECTION_LABEL): New macro.  *
 	* 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.
	
Index: defaults.h
===================================================================
RCS file: /cvs/egcs/egcs/gcc/defaults.h,v
retrieving revision 1.7
diff -c -p -r1.7 defaults.h
*** defaults.h	1999/02/27 22:21:57	1.7
--- defaults.h	1999/07/21 06:45:37
*************** do { fprintf (FILE, "\t%s\t", ASM_LONG);
*** 154,156 ****
--- 154,166 ----
  #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
Index: dwarf2out.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/dwarf2out.c,v
retrieving revision 1.96
diff -c -p -r1.96 dwarf2out.c
*** dwarf2out.c	1999/07/08 18:08:48	1.96
--- dwarf2out.c	1999/07/21 06:45:39
*************** dwarf2out_init (asm_out_file, main_input
*** 10005,10011 ****
  
    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);
    ASM_GENERATE_INTERNAL_LABEL (debug_info_section_label, 
  			       DEBUG_INFO_SECTION_LABEL, 0);
    ASM_GENERATE_INTERNAL_LABEL (debug_line_section_label, 
--- 10005,10014 ----
  
    ASM_GENERATE_INTERNAL_LABEL (text_end_label, TEXT_END_LABEL, 0);
    ASM_GENERATE_INTERNAL_LABEL (abbrev_section_label, ABBREV_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, 
*************** dwarf2out_init (asm_out_file, main_input
*** 10014,10020 ****
    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);
    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);
--- 10017,10024 ----
    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);
!   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);
Index: config/mips/iris6.h
===================================================================
RCS file: /cvs/egcs/egcs/gcc/config/mips/iris6.h,v
retrieving revision 1.15
diff -c -p -r1.15 iris6.h
*** iris6.h	1999/03/16 07:25:28	1.15
--- iris6.h	1999/07/21 06:45:39
*************** Boston, MA 02111-1307, USA.  */
*** 34,39 ****
--- 34,44 ----
   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.  */
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]