From: Alan Modra Date: Sat, 7 Jun 2003 06:11:18 +0000 (+0000) Subject: * config/rs6000/linux64.h (CRT_CALL_STATIC_FUNCTION): Define. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ffbc65c3e05de2a9a684d3104b0b75f1f9e7077a;p=gcc.git * config/rs6000/linux64.h (CRT_CALL_STATIC_FUNCTION): Define. From-SVN: r67578 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 139862087eb..1d9032516a0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2003-06-07 Alan Modra + + * config/rs6000/linux64.h (CRT_CALL_STATIC_FUNCTION): Define. + 2003-06-06 James E Wilson PR inline-asm/10890 diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h index f611471900b..8d136fb4bfd 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -363,6 +363,18 @@ #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_")