Skip to content

Commit

Permalink
powerpc: Put the gpr save/restore functions in their own section
Browse files Browse the repository at this point in the history
This allows the linker to know that calls to them do not need to switch
TOC and stop errors like the following when linking large configurations:

powerpc64-linux-ld: drivers/built-in.o: In function `.gpiochip_is_requested':
(.text+0x4): sibling call optimization to `_savegpr0_29' does not allow automatic multiple TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, or make `_savegpr0_29' extern

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Stephen Rothwell authored and Benjamin Herrenschmidt committed Jul 11, 2012
1 parent 18ad51d commit 1d5a436
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/powerpc/lib/crtsavres.S
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@
#include <asm/ppc_asm.h>

.file "crtsavres.S"
.section ".text"

#ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE

#ifndef CONFIG_PPC64

.section ".text"

/* Routines for saving integer registers, called by the compiler. */
/* Called with r11 pointing to the stack header word of the caller of the */
/* function, just beyond the end of the integer save area. */
Expand Down Expand Up @@ -232,6 +233,8 @@ _GLOBAL(_rest32gpr_31_x)

#else /* CONFIG_PPC64 */

.section ".text.save.restore","ax",@progbits

.globl _savegpr0_14
_savegpr0_14:
std r14,-144(r1)
Expand Down

0 comments on commit 1d5a436

Please sign in to comment.