1 /* Subroutines for insn-output.c for Windows NT.
2 Copyright (C) 1998, 1999 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
25 #include "hard-reg-set.h"
30 /* Return string which is the former assembler name modified with a
31 suffix consisting of an atsign (@) followed by the number of bytes of
35 gen_stdcall_suffix (decl
)
39 /* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead
40 of DECL_ASSEMBLER_NAME. */
41 char *asmname
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl
));
44 if (TYPE_ARG_TYPES (TREE_TYPE (decl
)))
45 if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl
))))
48 tree formal_type
= TYPE_ARG_TYPES (TREE_TYPE (decl
));
50 while (TREE_VALUE (formal_type
) != void_type_node
)
53 = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type
)));
54 /* Must round up to include padding. This is done the same
55 way as in store_one_arg. */
56 parm_size
= ((parm_size
+ PARM_BOUNDARY
- 1)
57 / PARM_BOUNDARY
* PARM_BOUNDARY
);
59 formal_type
= TREE_CHAIN (formal_type
);
63 newsym
= xmalloc (strlen (asmname
) + 10);
64 sprintf (newsym
, "%s@%d", asmname
, total
/BITS_PER_UNIT
);
65 return IDENTIFIER_POINTER (get_identifier (newsym
));
69 /* Turn this back on when the linker is updated to handle grouped
70 .data$ sections correctly. See corresponding note in i386/interix.h.
73 /* Cover function for UNIQUE_SECTION. */
76 i386_pe_unique_section (decl
, reloc
)
84 name
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl
));
85 /* Strip off any encoding in fnname. */
86 STRIP_NAME_ENCODING (name
, name
);
88 /* The object is put in, for example, section .text$foo.
89 The linker will then ultimately place them in .text
90 (everything from the $ on is stripped). Don't put
91 read-only data in .rdata section to avoid a PE linker
92 bug when .rdata$* grouped sections are used in code
93 without a .rdata section. */
94 if (TREE_CODE (decl
) == FUNCTION_DECL
)
96 /* else if (DECL_INITIAL (decl) == 0
97 || DECL_INITIAL (decl) == error_mark_node)
99 else if (DECL_READONLY_SECTION (decl
, reloc
))
100 #ifdef READONLY_DATA_SECTION
107 len
= strlen (name
) + strlen (prefix
);
108 string
= alloca (len
+ 1);
109 sprintf (string
, "%s%s", prefix
, name
);
111 DECL_SECTION_NAME (decl
) = build_string (len
, string
);