This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to fix compilation on cross targets (default_eh_frame_section)
- To: gcc-patches at gcc dot gnu dot org
- Subject: Patch to fix compilation on cross targets (default_eh_frame_section)
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Thu, 25 Oct 2001 14:38:04 -0400 (EDT)
- Cc: rbrown64 at csc dot com dot au, shebs at apple dot com
> --- gcc/config/pa/som.h.orig Tue Oct 23 11:33:35 2001
> +++ gcc/config/pa/som.h Thu Oct 25 16:07:08 2001
> @@ -296,6 +296,11 @@
> fprintf (asm_out_file, "%s\n", READONLY_DATA_ASM_OP); \
> in_section = in_readonly_data; \
> } \
> +} \
> + \
> +void \
> +default_eh_frame_section () \
> +{ \
> }
Rather than put the empty function in every affected target file, I
found it cleaner to simply move the function outside the macro guards
in dwarf2out.c. I also fixed some #endif comments I came across while
reading this code.
Okay to install?
--Kaveh
2001-10-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* dwarf2out.c (PTR_SIZE, default_eh_frame_section): Move outside
of macro guards. Fix #endif comment.
* output.h (default_exception_section, default_eh_frame_section):
Move prototypes outside of macro guard.
* crtstuff.c: Fix #endif comment.
diff -rup orig/egcs-CVS20011025/gcc/dwarf2out.c egcs-CVS20011025/gcc/dwarf2out.c
--- orig/egcs-CVS20011025/gcc/dwarf2out.c Wed Oct 24 22:42:10 2001
+++ egcs-CVS20011025/gcc/dwarf2out.c Thu Oct 25 14:16:38 2001
@@ -107,6 +107,30 @@ dwarf2out_do_frame ()
unique to each function definition. */
unsigned current_funcdef_number = 0;
+/* The size of the target's pointer type. */
+#ifndef PTR_SIZE
+#define PTR_SIZE (POINTER_SIZE / BITS_PER_UNIT)
+#endif
+
+/* Default version of targetm.eh_frame_section. Note this must appear
+ outside the DWARF2_DEBUGGING_INFO || DWARF2_UNWIND_INFO macro
+ guards. */
+
+void
+default_eh_frame_section ()
+{
+#ifdef EH_FRAME_SECTION_NAME
+ named_section_flags (EH_FRAME_SECTION_NAME, SECTION_WRITE);
+#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));
+#endif
+}
+
#if defined (DWARF2_DEBUGGING_INFO) || defined (DWARF2_UNWIND_INFO)
/* How to start an assembler comment. */
@@ -175,11 +199,6 @@ dw_fde_node;
/* Maximum size (in bytes) of an artificially generated label. */
#define MAX_ARTIFICIAL_LABEL_BYTES 30
-/* The size of the target's pointer type. */
-#ifndef PTR_SIZE
-#define PTR_SIZE (POINTER_SIZE / BITS_PER_UNIT)
-#endif
-
/* The size of addresses as they appear in the Dwarf 2 data.
Some architectures use word addresses to refer to code locations,
but Dwarf 2 info always uses byte addresses. On such machines,
@@ -1968,21 +1987,6 @@ output_call_frame_info (for_eh)
app_disable ();
}
-void
-default_eh_frame_section ()
-{
-#ifdef EH_FRAME_SECTION_NAME
- named_section_flags (EH_FRAME_SECTION_NAME, SECTION_WRITE);
-#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));
-#endif
-}
-
/* Output a marker (i.e. a label) for the beginning of a function, before
the prologue. */
@@ -11807,4 +11811,4 @@ dwarf2out_finish (input_filename)
dw2_asm_output_data (1, DW_MACINFO_end_file, "End file");
}
}
-#endif /* DWARF2_DEBUGGING_INFO */
+#endif /* DWARF2_DEBUGGING_INFO || DWARF2_UNWIND_INFO */
diff -rup orig/egcs-CVS20011025/gcc/output.h egcs-CVS20011025/gcc/output.h
--- orig/egcs-CVS20011025/gcc/output.h Mon Oct 22 15:30:46 2001
+++ egcs-CVS20011025/gcc/output.h Thu Oct 25 14:15:15 2001
@@ -208,12 +208,6 @@ extern void named_section PARAMS ((tree
/* Tell assembler to switch to the section for function DECL. */
extern void function_section PARAMS ((tree));
-/* Tell assembler to switch to the section for the exception table. */
-extern void default_exception_section PARAMS ((void));
-
-/* Tell assembler to switch to the section for the EH frames. */
-extern void default_eh_frame_section PARAMS ((void));
-
/* Tell assembler to switch to the section for string merging. */
extern void mergeable_string_section PARAMS ((tree, unsigned HOST_WIDE_INT,
unsigned int));
@@ -461,6 +455,12 @@ extern int profile_label_no;
/* Default target function prologue and epilogue assembler output. */
extern void default_function_pro_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+
+/* Tell assembler to switch to the section for the exception table. */
+extern void default_exception_section PARAMS ((void));
+
+/* Tell assembler to switch to the section for the EH frames. */
+extern void default_eh_frame_section PARAMS ((void));
/* Default target hook that outputs nothing to a stream. */
extern void no_asm_to_stream PARAMS ((FILE *));
diff -rup orig/egcs-CVS20011025/gcc/crtstuff.c egcs-CVS20011025/gcc/crtstuff.c
--- orig/egcs-CVS20011025/gcc/crtstuff.c Wed Oct 10 16:30:26 2001
+++ egcs-CVS20011025/gcc/crtstuff.c Thu Oct 25 12:48:39 2001
@@ -460,7 +460,7 @@ STATIC int __FRAME_END__[]
__attribute__ ((unused, mode(SI), section(EH_FRAME_SECTION_NAME),
aligned(4)))
= { 0 };
-#endif /* EH_FRAME_SECTION */
+#endif /* EH_FRAME_SECTION_NAME */
#ifdef JCR_SECTION_NAME
/* Null terminate the .jcr section array. */