This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/20274] New: -fvisibility=hidden has no effect on calling undefined function
- From: "hjl at lucon dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Mar 2005 05:11:38 -0000
- Subject: [Bug middle-end/20274] New: -fvisibility=hidden has no effect on calling undefined function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
bash-3.00$ cat x.c
#if 1
extern void foo ();
#else
extern void foo () __attribute__((visibility ("hidden")));
#endif
void
bar ()
{
foo ();
}
bash-3.00$ ./xgcc -B./ -fPIC -O2 x.c -S -fvisibility=hidden
bash-3.00$ more x.s
.file "x.c"
.text
.p2align 4,,15
.globl bar
.hidden bar
.type bar, @function
bar:
.LFB2:
xorl %eax, %eax
jmp foo@PLT
.LFE2:
.size bar, .-bar
foo is defined in a different file. Why doesn't gcc use "jmp foo" instead of
"jmp foo@PLT"? Use
extern void foo () __attribute__((visibility ("hidden")));
works.
--
Summary: -fvisibility=hidden has no effect on calling undefined
function
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hjl at lucon dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20274