[Bug target/16092] New: wrong thunk code produced with -fPIC and visibility("hidden")
qboosh at pld-linux dot org
gcc-bugzilla@gcc.gnu.org
Sun Jun 20 09:45:00 GMT 2004
non-virtual thunk code produced without -fPIC (regardless if function has
__attribute((visibility("hidden"))) or not) is (seems correct):
_ZThn16_N18nsDirectoryService6AddRefEv:
addq $-16, %rdi
jmp _ZN18nsDirectoryService6AddRefEv
The same thunk code produced with -fPIC for function w/o visibility("hidden")
attribute (still seems correct):
_ZThn16_N18nsDirectoryService6AddRefEv:
addq $-16, %rdi
jmp *_ZN18nsDirectoryService6AddRefEv@GOTPCREL(%rip)
But with -fPIC for function with visibility("hidden") attribute it's:
_ZThn16_N18nsDirectoryService6AddRefEv:
addq $-16, %rdi
jmp _ZN18nsDirectoryService6AddRefEv(%rip)
i.e. indirect jump with function address, which tries to take function code
as its address and jump there... causing SEGV.
Tested with gcc 3.3.3 and 3.3.4.
--
Summary: wrong thunk code produced with -fPIC and
visibility("hidden")
Product: gcc
Version: 3.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: qboosh at pld-linux dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: amd64-linux
GCC host triplet: amd64-linux
GCC target triplet: amd64-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16092
More information about the Gcc-bugs
mailing list