This is the mail archive of the gcc-patches@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]

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


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


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