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
This commit is contained in:
Danny Smith 2003-10-16 19:37:53 +00:00 committed by Danny Smith
parent 8f850e49a0
commit 1e8a52484b
3 changed files with 47 additions and 21 deletions

View File

@ -1,3 +1,15 @@
2003-10-16 Danny Smith <dannysmith@users.sourceforge.net>
* 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 <zack@codesourcery.com> 2003-10-16 Zack Weinberg <zack@codesourcery.com>
* configure.in: Add snprintf to gcc_AC_CHECK_DECLS list. * configure.in: Add snprintf to gcc_AC_CHECK_DECLS list.

View File

@ -364,9 +364,24 @@ extern int i386_pe_dllimport_name_p (const char *);
#ifndef SET_ASM_OP #ifndef SET_ASM_OP
#define SET_ASM_OP "\t.set\t" #define SET_ASM_OP "\t.set\t"
#endif #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 #undef TREE
#ifndef BUFSIZ #ifndef BUFSIZ
# undef FILE # undef FILE
#endif #endif

View File

@ -47,12 +47,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
*/ */
static tree associated_type (tree); static tree associated_type (tree);
const char * gen_stdcall_suffix (tree); static const char * gen_stdcall_suffix (tree);
const char * gen_fastcall_suffix (tree); static const char * gen_fastcall_suffix (tree);
int i386_pe_dllexport_p (tree); static int i386_pe_dllexport_p (tree);
int i386_pe_dllimport_p (tree); static int i386_pe_dllimport_p (tree);
void i386_pe_mark_dllexport (tree); static void i386_pe_mark_dllexport (tree);
void i386_pe_mark_dllimport (tree); static void i386_pe_mark_dllimport (tree);
/* This is we how mark internal identifiers with dllimport or dllexport /* This is we how mark internal identifiers with dllimport or dllexport
attributes. */ attributes. */
@ -182,7 +182,7 @@ associated_type (tree decl)
/* Return nonzero if DECL is a dllexport'd object. */ /* Return nonzero if DECL is a dllexport'd object. */
int static int
i386_pe_dllexport_p (tree decl) i386_pe_dllexport_p (tree decl)
{ {
tree exp; tree exp;
@ -208,7 +208,7 @@ i386_pe_dllexport_p (tree decl)
/* Return nonzero if DECL is a dllimport'd object. */ /* Return nonzero if DECL is a dllimport'd object. */
int static int
i386_pe_dllimport_p (tree decl) i386_pe_dllimport_p (tree decl)
{ {
tree imp; tree imp;
@ -308,7 +308,7 @@ i386_pe_dllimport_name_p (const char *symbol)
/* Mark a DECL as being dllexport'd. /* Mark a DECL as being dllexport'd.
Note that we override the previous setting (eg: dllimport). */ Note that we override the previous setting (eg: dllimport). */
void static void
i386_pe_mark_dllexport (tree decl) i386_pe_mark_dllexport (tree decl)
{ {
const char *oldname; const char *oldname;
@ -350,7 +350,7 @@ i386_pe_mark_dllexport (tree decl)
/* Mark a DECL as being dllimport'd. */ /* Mark a DECL as being dllimport'd. */
void static void
i386_pe_mark_dllimport (tree decl) i386_pe_mark_dllimport (tree decl)
{ {
const char *oldname; const char *oldname;
@ -406,11 +406,10 @@ i386_pe_mark_dllimport (tree decl)
prefix consisting of FASTCALL_PREFIX and a suffix consisting of an prefix consisting of FASTCALL_PREFIX and a suffix consisting of an
atsign (@) followed by the number of bytes of arguments. */ atsign (@) followed by the number of bytes of arguments. */
const char * static const char *
gen_fastcall_suffix (tree decl) gen_fastcall_suffix (tree decl)
{ {
int total = 0; int total = 0;
const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
char *newsym; char *newsym;
@ -446,7 +445,7 @@ gen_fastcall_suffix (tree decl)
suffix consisting of an atsign (@) followed by the number of bytes of suffix consisting of an atsign (@) followed by the number of bytes of
arguments */ arguments */
const char * static const char *
gen_stdcall_suffix (tree decl) gen_stdcall_suffix (tree decl)
{ {
int total = 0; int total = 0;
@ -717,14 +716,14 @@ i386_pe_asm_named_section (const char *name, unsigned int flags)
*f++ ='r'; *f++ ='r';
} }
else else
{ {
if (flags & SECTION_CODE) if (flags & SECTION_CODE)
*f++ = 'x'; *f++ = 'x';
if (flags & SECTION_WRITE) if (flags & SECTION_WRITE)
*f++ = 'w'; *f++ = 'w';
if (flags & SECTION_PE_SHARED) if (flags & SECTION_PE_SHARED)
*f++ = 's'; *f++ = 's';
} }
*f = '\0'; *f = '\0';