This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ppc64 __attribute__((visibility ("hidden"))) and multiple TOCs
- From: Jakub Jelinek <jakub at redhat dot com>
- To: David Edelsohn <dje at watson dot ibm dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, Alan Modra <amodra at bigpond dot net dot au>, gcc-patches at gcc dot gnu dot org, binutils at sources dot redhat dot com
- Date: Mon, 25 Jun 2007 17:17:44 -0400
- Subject: Re: ppc64 __attribute__((visibility ("hidden"))) and multiple TOCs
- References: <200706251315.l5PDFeQ35784@makai.watson.ibm.com> <467FC3A2.5020705@codesourcery.com> <20070625134308.GA32079@caradoc.them.org> <467FCE1B.8080705@codesourcery.com> <20070625154639.GS7012@devserv.devel.redhat.com> <467FEEE8.8090401@codesourcery.com> <200706251643.l5PGhhQ27990@makai.watson.ibm.com> <467FF1CA.5090205@codesourcery.com> <20070625170440.GT7012@devserv.devel.redhat.com> <200706251955.l5PJt6Q34110@makai.watson.ibm.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jun 25, 2007 at 03:55:06PM -0400, David Edelsohn wrote:
> Assuming that I did not introduce any typos from jetlag, can
> someone check if the following fixes the problem?
>
> * config/rs6000/predicates.md (current_file_function_operand):
> Ensure the symbol is non-external for AIX ABI.
It fixes part of the problem, for non-sibcall calls to DECL_EXTERNAL
symbols nops are emitted with your patch in AIX ABI.
But sibling calls are still allowed and those don't have the nop either.
With the patch below on top of yours even
int bar (void) __attribute__((visibility ("hidden")));
int
foo (void)
{
bar ();
return bar ();
}
generates code that will link even if bar uses different TOC from foo.
2007-06-25 Jakub Jelinek <jakub@redhat.com>
* config/rs6000/rs6000.c (rs6000_function_ok_for_sibcall): Ensure
decl is non-external for AIX ABI.
--- gcc/config/rs6000/rs6000.c.jj 2007-06-25 22:22:41.000000000 +0200
+++ gcc/config/rs6000/rs6000.c 2007-06-25 23:11:20.000000000 +0200
@@ -13938,7 +13938,8 @@ rs6000_function_ok_for_sibcall (tree dec
}
}
if (DEFAULT_ABI == ABI_DARWIN
- || (*targetm.binds_local_p) (decl))
+ || ((*targetm.binds_local_p) (decl)
+ && (DEFAULT_ABI != ABI_AIX || !DECL_EXTERNAL (decl))))
{
tree attr_list = TYPE_ATTRIBUTES (TREE_TYPE (decl));
Jakub