]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Sat, 2 Feb 2008 02:01:46 +0000 (02:01 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Sat, 2 Feb 2008 02:01:46 +0000 (02:01 +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: r132061

gcc/ChangeLog
gcc/varasm.c

index 9d1a04557e471e73a8a65684d97a06261ca62414..806fce1438376a245be26074d42ece5db0daba5e 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-01-31  Richard Henderson  <rth@redhat.com>
 
         PR c/34993
index 3e317e5c0fba291b0afcccdda94b1f31885447d5..007ae85c21ae73594676428b0f95013fd1c8af78 100644 (file)
@@ -5662,9 +5662,10 @@ default_binds_local_p_1 (tree exp, int shlib)
   else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
     local_p = true;
   /* 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)