Bug#490173: g++-4.3: Doesn't hide (visibility-wise) vtables and VTTs on ARM
Package: g++-4.3
Version: 4.3.1-4
Severity: important
This bug causes FTBFS of webkit on ARM:
http://buildd.debian.org/fetch.cgi?pkg=webkit;ver=1.0.1-1;arch=armel;stamp=1215557168
The problem can be seen on the following code:
-----8<---------
class A {
public:
int a;
virtual int v();
};
int A::v() {
return 2;
}
class B : public A {
public:
int b;
};
extern "C" __attribute__((visibility("default"))) int test(void) {
B *b = new B;
return b->v();
}
-------->8-------
Build with: g++ -fvisibility=hidden -o test.o -c test.cpp
Take a look at symbols with objdump -x test.o
Relevant part:
00000000 g O .rodata 0000000c _ZTV1A
00000000 w O .rodata._ZTV1B 0000000c _ZTV1B
These should be marked .hidden.
Resulting shared library (g++ -shared -fvisibility=hidden -o test.so test.cpp)
exports both _ZTV1A and _ZTV1B symbols as a result of this, which is
unexpected.
Proper result is obtained on other architectures (x86 below):
00000000 w O .rodata._ZTV1A 0000000c .hidden _ZTV1A
00000000 w O .rodata._ZTV1B 0000000c .hidden _ZTV1B
Note this may be related to the fact that apparently, ARM doesn't have vtables
in .rodata.
Mike
-- System Information:
Debian Release: 4.0
APT prefers proposed-updates
APT policy: (500, 'proposed-updates'), (500, 'stable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-6-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Reply to: