This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: TARGET_ENCODE_SECTION_INFO for i386
- From: Danny Smith <danny_smith_0000 at yahoo dot co dot nz>
- To: jh at suse dot cz
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 1 Aug 2005 15:53:58 +1200 (NZST)
- Subject: Re: TARGET_ENCODE_SECTION_INFO for i386
- Reply-to: dannysmith at users dot sourceforge dot net
--- Danny Smith wrote:
> This patch
> 2005-07-31 Jan Hubicka <jh@suse.cz>
> ...
> * i386.c (ix86_section_threshold): New static variable.
> (ix86_in_large_data_p, ix86_encode_section_info,
> x86_64_elf_unique_section,
> x86_64_elf_select_section): New functions.
> (TARGET_ENCODE_SECTION_INFO): Define
>
> cause breakage of mingw/cygwin subtargets becuase it overrides the TARGET_ENCODE_SECTION_INFO
> in i386/winnt.c
>
> Putting the TARGET_ENCODE_SECTION_INFO define into i386.h and ix86_encode_section_info proto
> into
> ii386-protos.h instead would help by allowing cygming.h to overide it. The
> i386_pe_encode_section_info function in winnt.c could then just call ix86_encode_section_info
> iinstead of calling the default version.
>
>
This allows windows targets to use their own ENCODE_SECTION_INFO and gets past the recent
breakage. AFAICT windows targets don't support large data so its best just to keep the old
winnt.c encode_section_info.
A bootstrap is not possible on mingw because of dllimport problems. But this lets me test a patch
that fixes the dllimport bug
ChangeLog
2005-08-01 Danny Smith <dannysmith@users.sourceforge.net>
* config/i386/cygming.h (SUBTARGET_ENCODE_SECTION_INFO): Define.
(COMMON_ASM_OP) Define.
* config/i386/i386.c (ix86_in_large_data_p): Add ATTRIBUTE_UNUSED
(ix86_encode_section_info): Likewise.
(TARGET_ENCODE_SECTION_INFO): Conditionally define as
SUBTARGET_ENCODE_SECTION_INFO.
Index: cygming.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/cygming.h,v
retrieving revision 1.31
diff -c -3 -p -r1.31 cygming.h
*** cygming.h 25 Jun 2005 01:21:07 -0000 1.31
--- cygming.h 1 Aug 2005 03:35:34 -0000
*************** do { \
*** 186,193 ****
section and we need to set DECL_SECTION_NAME so we do that here.
Note that we can be called twice on the same decl. */
! #undef TARGET_ENCODE_SECTION_INFO
! #define TARGET_ENCODE_SECTION_INFO i386_pe_encode_section_info
#undef TARGET_STRIP_NAME_ENCODING
#define TARGET_STRIP_NAME_ENCODING i386_pe_strip_name_encoding_full
--- 186,193 ----
section and we need to set DECL_SECTION_NAME so we do that here.
Note that we can be called twice on the same decl. */
! #undef SUBTARGET_ENCODE_SECTION_INFO
! #define SUBTARGET_ENCODE_SECTION_INFO i386_pe_encode_section_info
#undef TARGET_STRIP_NAME_ENCODING
#define TARGET_STRIP_NAME_ENCODING i386_pe_strip_name_encoding_full
*************** do { \
*** 195,200 ****
--- 195,203 ----
#undef ASM_OUTPUT_LABELREF
#define ASM_OUTPUT_LABELREF i386_pe_output_labelref
+ #undef COMMON_ASM_OP
+ #define COMMON_ASM_OP "\t.comm\t"
+
/* Output a common block. */
#undef ASM_OUTPUT_COMMON
#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.846
diff -c -3 -p -r1.846 i386.c
*** i386.c 31 Jul 2005 09:12:28 -0000 1.846
--- i386.c 1 Aug 2005 03:36:08 -0000
*************** static const char * const x86_64_reg_cla
*** 950,957 ****
static REAL_VALUE_TYPE ext_80387_constants_table [5];
static bool ext_80387_constants_init = 0;
static void init_ext_80387_constants (void);
! static bool ix86_in_large_data_p (tree);
! static void ix86_encode_section_info (tree, rtx, int);
static void x86_64_elf_unique_section (tree decl, int reloc) ATTRIBUTE_UNUSED;
static void x86_64_elf_select_section (tree decl, int reloc,
unsigned HOST_WIDE_INT align)
--- 950,957 ----
static REAL_VALUE_TYPE ext_80387_constants_table [5];
static bool ext_80387_constants_init = 0;
static void init_ext_80387_constants (void);
! static bool ix86_in_large_data_p (tree) ATTRIBUTE_UNUSED;
! static void ix86_encode_section_info (tree, rtx, int) ATTRIBUTE_UNUSED;
static void x86_64_elf_unique_section (tree decl, int reloc) ATTRIBUTE_UNUSED;
static void x86_64_elf_select_section (tree decl, int reloc,
unsigned HOST_WIDE_INT align)
*************** static void x86_64_elf_select_section (t
*** 977,983 ****
#define TARGET_ASM_FUNCTION_EPILOGUE ix86_output_function_epilogue
#undef TARGET_ENCODE_SECTION_INFO
! #define TARGET_ENCODE_SECTION_INFO ix86_encode_section_info
#undef TARGET_ASM_OPEN_PAREN
#define TARGET_ASM_OPEN_PAREN ""
--- 977,987 ----
#define TARGET_ASM_FUNCTION_EPILOGUE ix86_output_function_epilogue
#undef TARGET_ENCODE_SECTION_INFO
! #ifndef SUBTARGET_ENCODE_SECTION_INFO
! #define TARGET_ENCODE_SECTION_INFO ix86_encode_section_info
! #else
! #define TARGET_ENCODE_SECTION_INFO SUBTARGET_ENCODE_SECTION_INFO
! #endif
#undef TARGET_ASM_OPEN_PAREN
#define TARGET_ASM_OPEN_PAREN ""
Send instant messages to your online friends http://au.messenger.yahoo.com