This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
ppc64 __attribute__((visibility ("hidden"))) and multiple TOCs
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: gcc at gcc dot gnu dot org, binutils at sources dot redhat dot com
- Date: Mon, 25 Jun 2007 07:06:01 -0400
- Subject: ppc64 __attribute__((visibility ("hidden"))) and multiple TOCs
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
extern void bar (void) __attribute__((visibility ("hidden")));
void foo (void)
{
bar ();
bar ();
}
compiled on ppc64-linux with -O2 -m64 -mminimal-toc
leads to bl bar without nop in the following instruction
and to sibling call.
Now, when this together with bar's definition is linked
into a big binary and foo and bar need to have different TOCs,
ld issues error:
sibling call optimization to `bar' does not allow automatic multiple TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, or make `foo' extern
Shouldn't -mminimal-toc also forbid omitting nops if
the target call isn't defined in the same file and forbid
sibcalls to such functions? Or do we need another switch?
In this case -mminimal-toc, nor -fno-optimize-sibling-calls
helps ATM, only removing the hidden visibility.
Jakub