summaryrefslogtreecommitdiff
path: root/gcc/config/i386/interix.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/i386/interix.c')
-rw-r--r--gcc/config/i386/interix.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/gcc/config/i386/interix.c b/gcc/config/i386/interix.c
index e8caa60e605..dc9c3d6e422 100644
--- a/gcc/config/i386/interix.c
+++ b/gcc/config/i386/interix.c
@@ -33,7 +33,7 @@ Boston, MA 02111-1307, USA. */
const char *
gen_stdcall_suffix (decl)
- tree decl;
+ tree decl;
{
int total = 0;
/* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead
@@ -65,6 +65,26 @@ gen_stdcall_suffix (decl)
return IDENTIFIER_POINTER (get_identifier (newsym));
}
+void
+i386_interix_encode_section_info (decl, first)
+ tree decl;
+ int first;
+{
+ if (flag_pic)
+ {
+ rtx rtl = (TREE_CODE_CLASS (TREE_CODE (decl)) != 'd'
+ ? TREE_CST_RTL (decl) : DECL_RTL (decl));
+ SYMBOL_REF_FLAG (XEXP (rtl, 0))
+ = (TREE_CODE_CLASS (TREE_CODE (decl)) != 'd'
+ || ! TREE_PUBLIC (decl));
+ }
+ if (first && TREE_CODE (decl) == FUNCTION_DECL)
+ if (lookup_attribute ("stdcall",
+ TYPE_ATTRIBUTES (TREE_TYPE (decl))))
+ XEXP (DECL_RTL (decl), 0) =
+ gen_rtx (SYMBOL_REF, Pmode, gen_stdcall_suffix (decl));
+}
+
#if 0
/* Turn this back on when the linker is updated to handle grouped
.data$ sections correctly. See corresponding note in i386/interix.h.