* OPTIMIZE_FOR_SIZE makes PPC modules sick when trampolines are used
@ 2011-09-21 0:21 Marty Leisner
0 siblings, 0 replies; only message in thread
From: Marty Leisner @ 2011-09-21 0:21 UTC (permalink / raw)
To: linux-kernel; +Cc: maleisner
We're using Windriver linux on a PPC board (2.6.34).
When turning on OPTIMIZE_FOR_SIZE, we saw "strangeness" with the IPv6
module depending on when it was loaded (it either "hung" or paniced the system
with a empty stack dump -- or worked fine!!).
Editing inet6_init so:
a) a return (after entry) worked
b) anything (for example printk) hung/paniced returning from the module
The trampoline code uses r11.
gcc OPTIMIZE_FOR_SIZE (4.x) does (when returning from inet6_init):
418: 39 7f 00 10 addi r11,r31,16
41c: 48 00 00 00 b 41c <ac6_proc_init+0x44>
41c: R_PPC_REL24 _rest32gpr_31_x
on function exit (_rest32gpr_31_x bases a stackpointer off r11)
If _rest32gpr_31_x has to go across a trampoline, r11 is getting clobbered.
Hence bad things happen:
The trampoline code is (if the comments are right ;-):
(from arch/powerpc/kernel/module_32.c)
/* Stolen from Paul Mackerras as well... */
entry->jump[0] = 0x3d600000+((val+0x8000)>>16); /* lis r11,sym@ha */
entry->jump[1] = 0x396b0000 + (val&0xffff); /* addi r11,r11,sym@l*/
entry->jump[2] = 0x7d6903a6; /* mtctr r11 */
entry->jump[3] = 0x4e800420; /* bctr */
Has anyone seen this? An old ABI (maybe current? Its version 3 from 1995) lists r0, r11, r12
as volatile registers which may be used for function linkage.
marty
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-09-20 23:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-21 0:21 OPTIMIZE_FOR_SIZE makes PPC modules sick when trampolines are used Marty Leisner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®