Bug 87452 - visibility doesn't work right.
Summary: visibility doesn't work right.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux Beta
Classification: Retired
Component: gcc
Version: alpha 1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-03-26 23:46 UTC by hjl
Modified: 2007-04-18 16:52 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-10-07 10:08:05 UTC
Embargoed:


Attachments (Terms of Use)
A testcase. (852 bytes, application/octet-stream)
2003-03-26 23:47 UTC, hjl
no flags Details
A patch to fix the problem. (698 bytes, patch)
2003-05-15 19:49 UTC, hjl
no flags Details | Diff

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.


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