]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Sat, 2 Feb 2008 01:42:03 +0000 (01:42 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Sat, 2 Feb 2008 01:42:03 +0000 (01:42 +0000)
2007-08-02  Nathan Froyd  <froydnj@codesourcery.com>

PR middle-end/25445
* varasm.c (default_binds_local_p_1): Consult flag_whole_program
if we are compiling with -fPIC.

From-SVN: r132060

gcc/ChangeLog
gcc/varasm.c

index 62a4c66cdb6e09ab861ae2e7ec8eb7c270042cb1..8a8046938df3a7b3ef7f795f7d035e883d038f57 100644 (file)
@@ -1,3 +1,12 @@
+2008-02-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       Backport:
+       2007-08-02  Nathan Froyd  <froydnj@codesourcery.com>
+
+       PR middle-end/25445
+       * varasm.c (default_binds_local_p_1): Consult flag_whole_program
+       if we are compiling with -fPIC.
+
 2008-02-01  Joseph Myers  <joseph@codesourcery.com>
 
        * BASE-VER: Bump.
index 2163d6d638a09b547c5ce956e41cf98f9608b0ab..62609236fe854585541f38e5fcceeb77b79a4689 100644 (file)
@@ -5872,9 +5872,10 @@ default_binds_local_p_1 (tree exp, int shlib)
   else if (DECL_WEAK (exp))
     local_p = false;
   /* If PIC, then assume that any global name can be overridden by
-     symbols resolved from other modules.  */
+     symbols resolved from other modules, unless we are compiling with
+     -fwhole-program, which assumes that names are local.  */
   else if (shlib)
-    local_p = false;
+    local_p = flag_whole_program;
   /* Uninitialized COMMON variable may be unified with symbols
      resolved from other modules.  */
   else if (DECL_COMMON (exp)