[Bug target/39013] [4.3/4.4 Regression] Missing @PLT when -fpie is used

2009-01-30 Thread jakub at gcc dot gnu dot org


--- Comment #16 from jakub at gcc dot gnu dot org  2009-01-30 17:31 ---
Patch to set DECL_EXTERNAL instead:
http://gcc.gnu.org/ml/gcc-patches/2009-01/msg01525.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39013



[Bug target/39013] [4.3/4.4 Regression] Missing @PLT when -fpie is used

2009-01-30 Thread jakub at gcc dot gnu dot org


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-01-29 00:47:37 |2009-01-30 20:32:12
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39013



[Bug target/39013] [4.3/4.4 Regression] Missing @PLT when -fpie is used

2009-01-30 Thread jakub at gcc dot gnu dot org


--- Comment #17 from jakub at gcc dot gnu dot org  2009-01-30 20:47 ---
Subject: Bug 39013

Author: jakub
Date: Fri Jan 30 20:46:32 2009
New Revision: 143803

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=143803
Log:
PR target/39013
* c-decl.c (pop_scope): Set DECL_EXTERNAL for functions declared
inline but never defined.

* gcc.target/i386/pr39013-1.c: New test.
* gcc.target/i386/pr39013-2.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/i386/pr39013-1.c
trunk/gcc/testsuite/gcc.target/i386/pr39013-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-decl.c
trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39013



[Bug target/39013] [4.3/4.4 Regression] Missing @PLT when -fpie is used

2009-01-29 Thread rguenth at gcc dot gnu dot org


--- Comment #12 from rguenth at gcc dot gnu dot org  2009-01-29 15:20 
---
My testcase is

 cat t2.c
void foo() {}

 cat t.c
inline void foo ();
int main ()
{
  foo ();
  return 0;
}

which works perfectly fine even with 4.3 and 4.4 if I build both t2.c and t.c
with -fpie and fails with all compilers supporting -fpie if I only build
t.c with -fpie but t2.c not.

They bind locally with 4.3 and 4.4 though.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords|accepts-invalid |
  Known to fail|3.4.6   |4.3.3 4.4.0
  Known to work||4.2.4
Summary|Missing @PLT when -fpie is  |[4.3/4.4 Regression] Missing
   |used|@PLT when -fpie is used
   Target Milestone|--- |4.3.4


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39013



[Bug target/39013] [4.3/4.4 Regression] Missing @PLT when -fpie is used

2009-01-29 Thread hjl dot tools at gmail dot com


--- Comment #13 from hjl dot tools at gmail dot com  2009-01-29 15:52 
---
(In reply to comment #12)
 My testcase is
 
  cat t2.c
 void foo() {}

The problem happens when t2.c is in a shared library.

  cat t.c
 inline void foo ();
 int main ()
 {
   foo ();
   return 0;
 }
 
 which works perfectly fine even with 4.3 and 4.4 if I build both t2.c and t.c
 with -fpie and fails with all compilers supporting -fpie if I only build
 t.c with -fpie but t2.c not.
 

We can argue that this code is invalid and gcc shouldn't accept it
in the first place.  But from user perspective, gcc 4.3 doesn't work
on their codes any more silently.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39013



[Bug target/39013] [4.3/4.4 Regression] Missing @PLT when -fpie is used

2009-01-29 Thread hjl dot tools at gmail dot com


--- 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=17211action=view)
A patch

This patch only checks

--- gcc/varasm.c.pie2008-11-30 08:49:54.0 -0800
+++ gcc/varasm.c2009-01-29 07:50:46.0 -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



[Bug target/39013] [4.3/4.4 Regression] Missing @PLT when -fpie is used

2009-01-29 Thread zorry at ume dot nu


--- Comment #15 from zorry at ume dot nu  2009-01-29 18:23 ---
We have this in the shared library that is compile with -fPIC
inline u_int32_t
libnet_getgre_length(u_int16_t fv)
{
code
}
And the app have 
code
len = libnet_getgre_length(gre_flags);
size += len;
code


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39013



[Bug target/39013] [4.3/4.4 regression] Missing @PLT when -fpie is used

2009-01-28 Thread hjl dot tools at gmail dot com


--- Comment #9 from hjl dot tools at gmail dot com  2009-01-29 04:04 ---
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2009-01/msg01423.html


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

URL||http://gcc.gnu.org/ml/gcc-
   ||patches/2009-
   ||01/msg01423.html
Summary|[4.3/4.4 regression] @PLT is|[4.3/4.4 regression] Missing
   |missing on failed inline|@PLT when -fpie is used
   |function when -fpie is used |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39013