diff options
Diffstat (limited to 'gcc/config/rs6000/linux64.h')
-rw-r--r-- | gcc/config/rs6000/linux64.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h index 73fd5beed3d..55065c6a31d 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -207,6 +207,18 @@ Boston, MA 02111-1307, USA. */ #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 "._savef" |