Bug 159197 - gcc produces wrong relocation type with -fvisibility=hidden
Summary: gcc produces wrong relocation type with -fvisibility=hidden
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc
Version: 4.0
Hardware: i386
OS: Linux
Target Milestone: ---
: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
Blocks: 156322
TreeView+ depends on / blocked
Reported: 2005-05-31 14:04 UTC by Petr Rockai
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version: RHBA-2005-677
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-10-05 11:17:13 UTC
Target Upstream Version:

Attachments (Terms of Use)
testcase (728 bytes, text/plain)
2005-05-31 14:04 UTC, Petr Rockai
no flags Details
gcc34-pr18925.patch (1.39 KB, patch)
2005-05-31 15:58 UTC, Jakub Jelinek
no flags Details | Diff

System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 18925 0 None None None Never
Red Hat Product Errata RHBA-2005:677 0 qe-ready SHIPPED_LIVE gcc bug fix update 2005-10-05 04:00:00 UTC

Description Petr Rockai 2005-05-31 14:04:22 UTC
Description of problem:    
The attached testcase produces wrong relocation:    
OFFSET   TYPE              VALUE    
0000000e R_386_GOTPC       _GLOBAL_OFFSET_TABLE_    
00000014 R_386_GOT32       _ZN16QCoreApplication4selfE    
00000033 R_386_GOTPC       _GLOBAL_OFFSET_TABLE_    
0000003c R_386_GOTOFF      _ZN16QCoreApplication4selfE    
The last one is incorrect and causes crashes in applications using Qt4 (qt    
designer, assistant).  
[15:38:26] < SadEagle> mornfall: a bit more background: the way variables work  
is that the space for them gets allocated in the binary  
[15:38:45] < SadEagle> mornfall: and the library gets patched up to use the  
binary's copy.  
[15:39:16] < SadEagle> mornfall: with this relocation type, there is nothing  
to patch up in the library -- it basically just gets relative addressing wrt  
to the library base in the final .so  
[15:39:22] < SadEagle> mornfall: so you end up with 2 copies of the symbol  
The attached testcase has compile flags in it. The above is output of objdump   
-x on the resulting object file.  
Version-Release number of selected component (if applicable):    
gcc (GCC) 3.4.3 20050227 (Red Hat 3.4.3-22.fc3)

Comment 1 Petr Rockai 2005-05-31 14:04:23 UTC
Created attachment 114995 [details]

Comment 2 Jakub Jelinek 2005-05-31 15:56:33 UTC
I have tested the PR18925 fix seems to cure this and looks safe for RHEL4 U2.

Comment 3 Jakub Jelinek 2005-05-31 15:58:05 UTC
Created attachment 115004 [details]

Backported patch.

Comment 6 Jakub Jelinek 2005-07-25 14:06:19 UTC
Should be fixed in gcc-3.4.4-2{,.fc3}.

Comment 11 Red Hat Bugzilla 2005-10-05 11:17:13 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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