This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/50687] New: Missing symbols with -flto -fvisibility=hidden on 4.6.x but not on 4.7.0
- From: "giulio.eulisse at cern dot ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 10 Oct 2011 16:00:53 +0000
- Subject: [Bug lto/50687] New: Missing symbols with -flto -fvisibility=hidden on 4.6.x but not on 4.7.0
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50687
Bug #: 50687
Summary: Missing symbols with -flto -fvisibility=hidden on
4.6.x but not on 4.7.0
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: blocker
Priority: P3
Component: lto
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: giulio.eulisse@cern.ch
There seems to be a bug (or least a different behavior) when compiling:
cat >test.cc <<-EOF
struct bar {
static void * foo();
virtual void * getFoo() const { return bar::foo();}
};
EOF
with:
c++ -fPIC -shared -flto -fvisibility=hidden test.cc
using gcc 4.6.x (both 4.6.1 release and this week 4.6.2 snapshot) compared to
gcc
4.7.0 (20111001 snapshot).
In the case of gcc 4.6.x I get a missing symbol:
% nm a.out | grep U
U _ZN3bar3fooEv
while with 4.7.x I don't get it anymore (which is what I would expect).
Dropping -flto fixes the behavior also for 4.6.x.