This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/39013] [4.3/4.4 Regression] Missing @PLT when -fpie is used
- From: "hjl dot tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jan 2009 15:53:41 -0000
- Subject: [Bug target/39013] [4.3/4.4 Regression] Missing @PLT when -fpie is used
- References: <bug-39013-17238@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #14 from hjl dot tools at gmail dot com 2009-01-29 15:53 -------
Created an attachment (id=17211)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17211&action=view)
A patch
This patch only checks
--- gcc/varasm.c.pie 2008-11-30 08:49:54.000000000 -0800
+++ gcc/varasm.c 2009-01-29 07:50:46.000000000 -0800
@@ -6321,6 +6321,10 @@ default_binds_local_p_1 (const_tree exp,
&& (DECL_INITIAL (exp) == NULL
|| DECL_INITIAL (exp) == error_mark_node))
local_p = false;
+ /* Functions without body are not local. */
+ else if (TREE_CODE (exp) == FUNCTION_DECL
+ && DECL_INITIAL (exp) == NULL)
+ local_p = false;
/* Otherwise we're left with initialized (or non-common) global data
which is of necessity defined locally. */
else
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39013