Bug 175442 - visibility handling causes bad jump generation
Summary: visibility handling causes bad jump generation
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: FC6Target 175275
TreeView+ depends on / blocked
 
Reported: 2005-12-10 18:28 UTC by Ulrich Drepper
Modified: 2007-11-30 22:11 UTC (History)
12 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-08-29 09:31:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
This test fails only with gcc 4.0.2. (190 bytes, text/plain)
2005-12-10 18:28 UTC, Ulrich Drepper
no flags Details
Test case with implicit call generation (297 bytes, text/plain)
2005-12-10 18:30 UTC, Ulrich Drepper
no flags Details
testcase with implicit call generation and no #includes (1.71 KB, text/plain; charset=UTF-8)
2006-03-21 08:25 UTC, David Baron
no flags Details
testcase with implicit call generation and no #includes (757 bytes, text/plain; charset=utf-8)
2006-03-21 08:28 UTC, David Baron
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 17470 0 None None None Never
GNU Compiler Collection 19134 0 None None None Never
GNU Compiler Collection 19238 0 None None None Never
GNU Compiler Collection 19520 0 None None None Never
GNU Compiler Collection 19664 0 None None None Never
GNU Compiler Collection 20218 0 None None None Never
GNU Compiler Collection 20274 0 None None None Never
GNU Compiler Collection 20297 0 None None None Never
GNU Compiler Collection 21243 0 None None None Never
GNU Compiler Collection 21405 0 None None None Never
GNU Compiler Collection 21581 0 None None None Never
GNU Compiler Collection 21764 0 None None None Never
GNU Compiler Collection 22063 0 None None None Never
GNU Compiler Collection 22592 0 None None None Never
GNU Compiler Collection 23058 0 None None None Never
GNU Compiler Collection 26612 0 None None None Never
GNU Compiler Collection 27000 0 None None None Never

Description Ulrich Drepper 2005-12-10 18:28:10 UTC
Description of problem:

I was looking into why firefox/thunderbird/mozilla have so many text
relocations.  Both on FC4 and devel.  It turns out the compiler is buggy when it
comes to implicitly generated calls and visibility.  With gcc 4.0.2-3 the
problem is even worse since also ordinary calls are affected.


Version-Release number of selected component (if applicable):
gcc-4.0.2-3
gcc-4.1.0-0.6

How reproducible:
always

Steps to Reproduce:
I'll attach two test cases:
1.compile with gcc -c -fpic -O2 -fno-builtin <FILE>.c
2.readelf -r <FILE>.o | fgrep memcpy
3.
  
Actual results:
  0x000000XX  386_PC32             0000000000  memcpy


Expected results:
  0x000000XX  386_PLT32            0000000000  memcpy


Additional info:

Comment 1 Ulrich Drepper 2005-12-10 18:28:10 UTC
Created attachment 122100 [details]
This test fails only with gcc 4.0.2.

Comment 2 Ulrich Drepper 2005-12-10 18:30:13 UTC
Created attachment 122101 [details]
Test case with implicit call generation

This test fails with gcc 4.0.2 and gcc 4.1.0.

Comment 3 Ulrich Drepper 2005-12-10 18:34:04 UTC
Argh, I meant use

  gcc -c -fpic -Os -fno-builtin <FILE>.c


Note: -Os, not -O2.

Comment 4 Jakub Jelinek 2005-12-12 10:06:27 UTC
This is upstream PR20297 I'd say, but there are many other unresolved GCC
problems with visibility (mainly in C++ land).
The most important ones are I think
PR20297, PR19664, PR21581 and PR21764
but I've added external references to other relevant upstream bugreports.

I think this is something that should be resolved soon, for FC5/GCC 4.2
and can be backported to selected compilers, because without resolving at least
the more important bugs applications that use #pragma GCC visibility
or -fvisibility=... (there are many now), if they work, work often by pure luck.

For PR20297, Roger's
http://gcc.gnu.org/ml/gcc-patches/2005-03/msg00321.html
contains some good comments about it.

Comment 5 Benjamin Kosnik 2005-12-12 17:23:18 UTC
Agreed that this is a major problem. However, want weak versioning patches
finished first.... which also impact linkage for FC5. 

Then I'll start paying  more attention to the vis stuff.

Comment 6 Christopher Aillon 2006-01-13 20:14:55 UTC
Would be nice to get this for FC5 for the big apps that use it (firefox,
thunderbird, mozilla, etc).  Adding to FC5Target

Comment 7 David Baron 2006-03-21 08:25:18 UTC
Created attachment 126379 [details]
testcase with implicit call generation and no #includes

Since I just spent a good bit of time simplifying this before drepper pointed
me to this bug, I may as well attach it; it has the advantage of not having any
#includes, since none are needed to see the bug in the implicit call generation
case.

Comment 8 David Baron 2006-03-21 08:28:07 UTC
Created attachment 126380 [details]
testcase with implicit call generation and no #includes

Comment 9 Benjamin Kosnik 2006-04-05 11:04:34 UTC
Can we just make this a tracker bug for all the gcc bugs WRT visibility? 

Comment 10 Jakub Jelinek 2006-04-05 11:05:54 UTC
I think so.

Comment 11 David Baron 2006-04-05 15:15:39 UTC
There were a bunch of commits for
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20297 recently.  Those may have
fixed the text relocations in Mozilla described in comment 0, although I haven't
tested.

Comment 12 Jakub Jelinek 2006-04-05 15:19:35 UTC
Sure, and not just PR20297.  But some of the changes now expose latent bugs
much more frequently.  See
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=187399
http://gcc.gnu.org/PR27000
http://gcc.gnu.org/PR26612
So, I'm going to revert PR c++/21764, c++/19238, c++/21581 fixes from rawhide
for the time being, until PR27000 and PR26612 get resolved.

Comment 13 David Baron 2006-05-27 19:52:17 UTC
It looks like the fix for this shipped in the FC5 update to gcc 4.1.1.

Comment 14 Jakub Jelinek 2006-08-29 09:31:50 UTC
I think we can close this now, to my knowledge all known visibility issues but
#198967 have been already resolved on redhat/gcc-4_1-branch.



Note You need to log in before you can comment on or make changes to this bug.