Bug 159197 - gcc produces wrong relocation type with -fvisibility=hidden
gcc produces wrong relocation type with -fvisibility=hidden
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
Blocks: 156322
  Show dependency treegraph
Reported: 2005-05-31 10:04 EDT by Petr Rockai
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version: RHBA-2005-677
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-10-05 07:17:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 18925 None None None Never

  None (edit)
Description Petr Rockai 2005-05-31 10:04:22 EDT
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 10:04:23 EDT
Created attachment 114995 [details]
Comment 2 Jakub Jelinek 2005-05-31 11:56:33 EDT
I have tested the PR18925 fix seems to cure this and looks safe for RHEL4 U2.
Comment 3 Jakub Jelinek 2005-05-31 11:58:05 EDT
Created attachment 115004 [details]

Backported patch.
Comment 6 Jakub Jelinek 2005-07-25 10:06:19 EDT
Should be fixed in gcc-3.4.4-2{,.fc3}.
Comment 11 Red Hat Bugzilla 2005-10-05 07:17:13 EDT
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.