* config/rs6000/linux64.h (CRT_CALL_STATIC_FUNCTION): Define.
authorAlan Modra <amodra@bigpond.net.au>
Sat, 7 Jun 2003 06:11:18 +0000 (06:11 +0000)
committerAlan Modra <amodra@gcc.gnu.org>
Sat, 7 Jun 2003 06:11:18 +0000 (15:41 +0930)
From-SVN: r67578

gcc/ChangeLog
gcc/config/rs6000/linux64.h

index 139862087ebbd0323425640ea3e5e2f83509723e..1d9032516a04b303cfd4b9bbb148f5e3e64af12a 100644 (file)
@@ -1,3 +1,7 @@
+2003-06-07  Alan Modra  <amodra@bigpond.net.au>
+
+       * config/rs6000/linux64.h (CRT_CALL_STATIC_FUNCTION): Define.
+
 2003-06-06  James E Wilson  <wilson@tuliptree.org>
 
        PR inline-asm/10890
index f611471900b54b61f11ab01acfd7629d33ae9399..8d136fb4bfd0f6e8bf2362d044d8915afca138a8 100644 (file)
 #undef  RS6000_MCOUNT
 #define RS6000_MCOUNT "_mcount"
 
+#ifdef __powerpc64__
+/* _init and _fini functions are built from bits spread across many
+   object files, each potentially with a different TOC pointer.  For
+   that reason, place a nop after the call so that the linker can
+   restore the TOC pointer if a TOC adjusting call stub is needed.  */
+#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC)     \
+  asm (SECTION_OP "\n"                                 \
+"      bl ." #FUNC "\n"                                \
+"      nop\n"                                          \
+"      .previous");
+#endif
+
 /* FP save and restore routines.  */
 #undef  SAVE_FP_PREFIX
 #define SAVE_FP_PREFIX (TARGET_64BIT ? "._savef" : "_savefpr_")