From 1e8a52484b64956ec2cc84e98eb4110b43c7b885 Mon Sep 17 00:00:00 2001 From: Danny Smith Date: Thu, 16 Oct 2003 19:37:53 +0000 Subject: [PATCH] cygming.h (ASM_OUTPUT_DEF_FROM_DECLS): Define. * config/i386/cygming.h (ASM_OUTPUT_DEF_FROM_DECLS): Define. * config/i386/winnt.c (gen_stdcall_suffix): Make static (gen_fastcall_suffix): Likewise. (i386_pe_dllexport_p): Likewise. (i386_pe_dllimport_p): Likewise. (i386_pe_mark_dllexport): Likewise. (i386_pe_mark_dllimport): Likewise. (i386_pe_asm_named_section): Fix formatting. From-SVN: r72566 --- gcc/ChangeLog | 12 ++++++++++++ gcc/config/i386/cygming.h | 15 ++++++++++++++ gcc/config/i386/winnt.c | 41 +++++++++++++++++++-------------------- 3 files changed, 47 insertions(+), 21 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f3e2a44f1e2..d9c52aa9aed 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2003-10-16 Danny Smith + + * config/i386/cygming.h (ASM_OUTPUT_DEF_FROM_DECLS): Define. + + * config/i386/winnt.c (gen_stdcall_suffix): Make static + (gen_fastcall_suffix): Likewise. + (i386_pe_dllexport_p): Likewise. + (i386_pe_dllimport_p): Likewise. + (i386_pe_mark_dllexport): Likewise. + (i386_pe_mark_dllimport): Likewise. + (i386_pe_asm_named_section): Fix formatting. + 2003-10-16 Zack Weinberg * configure.in: Add snprintf to gcc_AC_CHECK_DECLS list. diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h index dfdb4994927..8ed30443bc8 100644 --- a/gcc/config/i386/cygming.h +++ b/gcc/config/i386/cygming.h @@ -364,9 +364,24 @@ extern int i386_pe_dllimport_name_p (const char *); #ifndef SET_ASM_OP #define SET_ASM_OP "\t.set\t" #endif +/* This implements the `alias' attribute, keeping any stdcall or + fastcall decoration. */ +#undef ASM_OUTPUT_DEF_FROM_DECLS +#define ASM_OUTPUT_DEF_FROM_DECLS(STREAM, DECL, TARGET) \ + do \ + { \ + const char *alias; \ + rtx rtlname = XEXP (DECL_RTL (DECL), 0); \ + if (GET_CODE (rtlname) == SYMBOL_REF) \ + alias = XSTR (rtlname, 0); \ + else \ + abort (); \ + ASM_OUTPUT_DEF (STREAM, alias, IDENTIFIER_POINTER (TARGET)); \ + } while (0) #undef TREE #ifndef BUFSIZ # undef FILE #endif + diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c index c1c54956fdc..486fc5a10f8 100644 --- a/gcc/config/i386/winnt.c +++ b/gcc/config/i386/winnt.c @@ -47,12 +47,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA */ static tree associated_type (tree); -const char * gen_stdcall_suffix (tree); -const char * gen_fastcall_suffix (tree); -int i386_pe_dllexport_p (tree); -int i386_pe_dllimport_p (tree); -void i386_pe_mark_dllexport (tree); -void i386_pe_mark_dllimport (tree); +static const char * gen_stdcall_suffix (tree); +static const char * gen_fastcall_suffix (tree); +static int i386_pe_dllexport_p (tree); +static int i386_pe_dllimport_p (tree); +static void i386_pe_mark_dllexport (tree); +static void i386_pe_mark_dllimport (tree); /* This is we how mark internal identifiers with dllimport or dllexport attributes. */ @@ -182,7 +182,7 @@ associated_type (tree decl) /* Return nonzero if DECL is a dllexport'd object. */ -int +static int i386_pe_dllexport_p (tree decl) { tree exp; @@ -208,7 +208,7 @@ i386_pe_dllexport_p (tree decl) /* Return nonzero if DECL is a dllimport'd object. */ -int +static int i386_pe_dllimport_p (tree decl) { tree imp; @@ -308,7 +308,7 @@ i386_pe_dllimport_name_p (const char *symbol) /* Mark a DECL as being dllexport'd. Note that we override the previous setting (eg: dllimport). */ -void +static void i386_pe_mark_dllexport (tree decl) { const char *oldname; @@ -350,7 +350,7 @@ i386_pe_mark_dllexport (tree decl) /* Mark a DECL as being dllimport'd. */ -void +static void i386_pe_mark_dllimport (tree decl) { const char *oldname; @@ -406,11 +406,10 @@ i386_pe_mark_dllimport (tree decl) prefix consisting of FASTCALL_PREFIX and a suffix consisting of an atsign (@) followed by the number of bytes of arguments. */ -const char * +static const char * gen_fastcall_suffix (tree decl) { int total = 0; - const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); char *newsym; @@ -446,7 +445,7 @@ gen_fastcall_suffix (tree decl) suffix consisting of an atsign (@) followed by the number of bytes of arguments */ -const char * +static const char * gen_stdcall_suffix (tree decl) { int total = 0; @@ -717,14 +716,14 @@ i386_pe_asm_named_section (const char *name, unsigned int flags) *f++ ='r'; } else - { - if (flags & SECTION_CODE) - *f++ = 'x'; - if (flags & SECTION_WRITE) - *f++ = 'w'; - if (flags & SECTION_PE_SHARED) - *f++ = 's'; - } + { + if (flags & SECTION_CODE) + *f++ = 'x'; + if (flags & SECTION_WRITE) + *f++ = 'w'; + if (flags & SECTION_PE_SHARED) + *f++ = 's'; + } *f = '\0'; -- 2.30.2