Bug 87452

Summary: visibility doesn't work right.
Product: [Retired] Red Hat Linux Beta Reporter: hjl
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: alpha 1CC: chris.ricker
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-07 10:08:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
A testcase.
none
A patch to fix the problem. none

Description hjl 2003-03-26 23:46:36 UTC
# make
gcc -O -DGCC_BUG -c main.c
gcc -O -DGCC_BUG -fPIC -c shared.c
gcc -shared -o libfoo.so  shared.o
gcc -o foo  main.o libfoo.so -Wl,-rpath,.
for f in foo; do echo "Running: $f"; ./$f; \
  if [ $? != 0 ]; then echo Failed; fi; done
Running: foo
Data address: 0x8049924 != Data address from DSO: 0x400187e4
Function address: 0x80484c0 !=  Function address from DSO: 0x4001775f
Data: 100 != Data from DSO: 10
Failed

The testcase will always fail. But without -DGCC_BUG,

Function address: 0x80484c0 !=  Function address from DSO: 0x4001775f

won't be there.

Comment 1 hjl 2003-03-26 23:47:53 UTC
Created attachment 90737 [details]
A testcase.

Comment 2 hjl 2003-05-15 19:49:47 UTC
Created attachment 91702 [details]
A patch to fix the problem.

Comment 3 Jakub Jelinek 2004-10-07 10:08:05 UTC
If you are convinced this is a bug, please push that upstream.
I don't know why addresses of variables should be handled differently
from function pointers and the code you're patching is certainly not there.