This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ppc64 __attribute__((visibility ("hidden"))) and multiple TOCs


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]