RFA: Use flag_shlib to choose the default TLS model

Daniel Jacobowitz drow@false.org
Wed Mar 9 18:23:00 GMT 2005


decl_tls_model selects the default model based on flag_pic.  All mips-linux
userspace code is compiled with -fpic, but this doesn't interfere with using
LE or IE model in an executable.  The same should be true for PIE objects.
So check flag_shlib instead.

Almost obvious but... OK?  Tested on mips-linux-gnu.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

2005-03-09  Daniel Jacobowitz  <dan@codesourcery.com>

	* varasm.c (decl_tls_model): Check flag_shlib instead of flag_pic.

Index: gcc/gcc/varasm.c
===================================================================
--- gcc.orig/gcc/varasm.c	2005-03-08 17:18:44.000000000 -0500
+++ gcc/gcc/varasm.c	2005-03-09 10:03:32.000000000 -0500
@@ -4614,7 +4614,7 @@ decl_tls_model (tree decl)
     }
 
   is_local = targetm.binds_local_p (decl);
-  if (!flag_pic)
+  if (!flag_shlib)
     {
       if (is_local)
 	kind = TLS_MODEL_LOCAL_EXEC;



More information about the Gcc-patches mailing list