Bug 175442 - visibility handling causes bad jump generation
visibility handling causes bad jump generation
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks: FC6Target 175275
  Show dependency treegraph
 
Reported: 2005-12-10 13:28 EST by Ulrich Drepper
Modified: 2007-11-30 17:11 EST (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-08-29 05:31:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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


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

  None (edit)
Description Ulrich Drepper 2005-12-10 13:28:10 EST
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 13:28:10 EST
Created attachment 122100 [details]
This test fails only with gcc 4.0.2.
Comment 2 Ulrich Drepper 2005-12-10 13:30:13 EST
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 13:34:04 EST
Argh, I meant use

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


Note: -Os, not -O2.
Comment 4 Jakub Jelinek 2005-12-12 05:06:27 EST
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 12:23:18 EST
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 15:14:55 EST
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 03:25:18 EST
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 03:28:07 EST
Created attachment 126380 [details]
testcase with implicit call generation and no #includes
Comment 9 Benjamin Kosnik 2006-04-05 07:04:34 EDT
Can we just make this a tracker bug for all the gcc bugs WRT visibility? 
Comment 10 Jakub Jelinek 2006-04-05 07:05:54 EDT
I think so.
Comment 11 David Baron 2006-04-05 11:15:39 EDT
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 11:19:35 EDT
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 15:52:17 EDT
It looks like the fix for this shipped in the FC5 update to gcc 4.1.1.
Comment 14 Jakub Jelinek 2006-08-29 05:31:50 EDT
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.