diff gcc/config/i386/winnt.c @ 63:b7f97abdc517 gcc-4.6-20100522

update gcc from gcc-4.5.0 to gcc-4.6
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Mon, 24 May 2010 12:47:05 +0900
parents 77e2b8dfacca
children f6334be47118
line wrap: on
line diff
--- a/gcc/config/i386/winnt.c	Fri Feb 12 23:41:23 2010 +0900
+++ b/gcc/config/i386/winnt.c	Mon May 24 12:47:05 2010 +0900
@@ -1,7 +1,7 @@
 /* Subroutines for insn-output.c for Windows NT.
    Contributed by Douglas Rupp (drupp@cs.washington.edu)
    Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -35,6 +35,7 @@
 #include "langhooks.h"
 #include "ggc.h"
 #include "target.h"
+#include "lto-streamer.h"
 
 /* i386/PE specific attribute support.
 
@@ -320,6 +321,14 @@
       && DECL_DLLIMPORT_P (exp))
     return false;
 
+  /* Or a weak one, now that they are supported.  */
+  if ((TREE_CODE (exp) == VAR_DECL || TREE_CODE (exp) == FUNCTION_DECL)
+      && DECL_WEAK (exp))
+    /* But x64 gets confused and attempts to use unsupported GOTPCREL
+       relocations if we tell it the truth, so we still return true in
+       that case until the deeper problem can be fixed.  */
+    return (TARGET_64BIT && DEFAULT_ABI == MS_ABI);
+
   return true;
 }
 
@@ -465,6 +474,12 @@
         *f++ = 's';
     }
 
+  /* LTO sections need 1-byte alignment to avoid confusing the
+     zlib decompression algorithm with trailing zero pad bytes.  */
+  if (strncmp (name, LTO_SECTION_NAME_PREFIX,
+			strlen (LTO_SECTION_NAME_PREFIX)) == 0)
+    *f++ = '0';
+
   *f = '\0';
 
   fprintf (asm_out_file, "\t.section\t%s,\"%s\"\n", name, flagchars);
@@ -485,6 +500,8 @@
     }
 }
 
+/* Beware, DECL may be NULL if compile_file() is emitting the LTO marker.  */
+
 void
 i386_pe_asm_output_aligned_decl_common (FILE *stream, tree decl,
 					const char *name, HOST_WIDE_INT size,
@@ -581,7 +598,8 @@
    these, so that we can output the export list at the end of the
    assembly.  We used to output these export symbols in each function,
    but that causes problems with GNU ld when the sections are
-   linkonce.  */
+   linkonce.  Beware, DECL may be NULL if compile_file() is emitting
+   the LTO marker.  */
 
 void
 i386_pe_maybe_record_exported_symbol (tree decl, const char *name, int is_data)
@@ -589,6 +607,9 @@
   rtx symbol;
   struct export_list *p;
 
+  if (!decl)
+    return;
+
   symbol = XEXP (DECL_RTL (decl), 0);
   gcc_assert (GET_CODE (symbol) == SYMBOL_REF);
   if (!SYMBOL_REF_DLLEXPORT_P (symbol))
@@ -670,8 +691,6 @@
 {
   struct extern_list *p;
 
-  ix86_file_end ();
-
   for (p = extern_head; p != NULL; p = p->next)
     {
       tree decl;