forced data section
Andrew Macleod
amacleod@cygnus.com
Mon Dec 14 14:23:00 GMT 1998
I've applied this patch to egcs. There is the odd time when we get a little
confused what the current section is, and then some exception
handling data can end up in the wrong section. This patch will
make sure things go to the right section.
Andrew
Index: ChangeLog
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/ChangeLog,v
retrieving revision 1.2643
diff -c -p -r1.2643 ChangeLog
*** ChangeLog 1998/12/14 00:42:35 1.2643
--- ChangeLog 1998/12/14 22:15:17
***************
*** 1,3 ****
--- 1,11 ----
+ Mon Dec 14 17:13:36 EST 1998 Andrew MacLeod <amacleod@cygnus.com>
+
+ * output.h (force_data_section): New prototype.
+ * varasm.c (force_data_section): New function to force the
+ data section, regardless of what in_section thinks.
+ * dwarf2out.c (output_call_frame_info): Call force_data_section
+ since varasm may not realize we've changes sections.
+
Mon Dec 14 01:39:28 1998 Jeffrey A Law (law@cygnus.com)
* rtl.h (multiple_sets): Fix prototype.
Index: output.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/output.h,v
retrieving revision 1.13
diff -c -p -r1.13 output.h
*** output.h 1998/10/28 22:30:59 1.13
--- output.h 1998/12/14 22:15:17
*************** extern void text_section PROTO((void));
*** 142,147 ****
--- 142,150 ----
/* Tell assembler to switch to data section. */
extern void data_section PROTO((void));
+ /* Tell assembler to make sure its in the data section. */
+ extern void force_data_section PROTO((void));
+
/* Tell assembler to switch to read-only data section. This is normally
the text section. */
extern void readonly_data_section PROTO((void));
Index: varasm.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/varasm.c,v
retrieving revision 1.44
diff -c -p -r1.44 varasm.c
*** varasm.c 1998/10/13 15:25:24 1.44
--- varasm.c 1998/12/14 22:15:24
*************** data_section ()
*** 216,221 ****
--- 216,230 ----
in_section = in_data;
}
}
+ /* Tell assembler to ALWAYS switch to data section, in case
+ it's not sure where it it. */
+
+ void
+ force_data_section ()
+ {
+ in_section = no_section;
+ data_section ();
+ }
/* Tell assembler to switch to read-only data section. This is normally
the text section. */
Index: dwarf2out.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/dwarf2out.c,v
retrieving revision 1.77
diff -c -p -r1.77 dwarf2out.c
*** dwarf2out.c 1998/11/03 17:52:59 1.77
--- dwarf2out.c 1998/12/14 22:15:37
*************** output_call_frame_info (for_eh)
*** 1691,1697 ****
#else
tree label = get_file_function_name ('F');
! data_section ();
ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
ASM_GLOBALIZE_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
ASM_OUTPUT_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
--- 1691,1697 ----
#else
tree label = get_file_function_name ('F');
! force_data_section ();
ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
ASM_GLOBALIZE_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
ASM_OUTPUT_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
More information about the Gcc-patches
mailing list