Rework the handling of assembler sections

Richard Sandiford richard@codesourcery.com
Wed Dec 7 11:52:00 GMT 2005


Richard Sandiford <richard@codesourcery.com> writes:
> I've installed the patch below as obvious after Eric confirmed it
> fixed the problem.  Thanks to Eric for the quick report and for
> staying up to test the patch. ;)
>
> Richard
>
>
> 	* config/darwin.h: Guard section variables with #ifndef IN_LIBGCC2.

I later realised that the same problem would affect AVR, and that
the correct fix was to provide a dummy definition in coretypes.h.
Tested by building an avr-elf cross and verifying that it fixed
the original build failure.  Installed as "obvious".

Sorry for the run-around.

Richard


	* coretypes.h (section): Provide dummy definition for target files.
	* config/darwin.h: Revert previous change.

Index: gcc/coretypes.h
===================================================================
--- gcc/coretypes.h	(revision 108158)
+++ gcc/coretypes.h	(working copy)
@@ -68,9 +68,11 @@ enum tls_model {
 struct _dont_use_rtx_here_;
 struct _dont_use_rtvec_here_;
 union _dont_use_tree_here_;
+union _dont_use_section_here_;
 #define rtx struct _dont_use_rtx_here_ *
 #define rtvec struct _dont_use_rtvec_here *
 #define tree union _dont_use_tree_here_ *
+#define section union _dont_use_section_here_
 
 #endif
 
Index: gcc/config/darwin.h
===================================================================
--- gcc/config/darwin.h	(revision 108158)
+++ gcc/config/darwin.h	(working copy)
@@ -610,11 +610,9 @@ #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FI
 #define MAX_OFILE_ALIGNMENT 0x8000
 
 /* Declare the section variables.  */
-#ifndef IN_LIBGCC2
 #define DEF_SECTION(NAME, FLAGS, DIRECTIVE, OBJC) extern section *NAME;
 #include "darwin-sections.def"
 #undef DEF_SECTION
-#endif
 
 #undef	TARGET_ASM_SELECT_SECTION
 #define TARGET_ASM_SELECT_SECTION machopic_select_section



More information about the Gcc-patches mailing list