Message ID | 4ACC57C4.5010002@in.ibm.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
On Wed, 2009-10-07 at 14:26 +0530, Sachin Sant wrote: > As Ben suggested, i changed LOAD_REG_IMMEDIATE() to LOAD_REG_ADDR() > as follows. > > - LOAD_REG_IMMEDIATE(r4,ftrace_return_to_handler) > + LOAD_REG_ADDR(r4,ftrace_return_to_handler) > > With this change compile time warnings about bad relocations > related to ftrace are gone. You also need to make sure r2 is properly loaded with the kernel TOC pointer, something like ld r2,PACAKTOC(r13) before the LOAD_REG_ADDR. Cheers, Ben.
diff -Naurp a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S --- a/arch/powerpc/kernel/entry_64.S 2009-10-06 15:31:29.000000000 +0530 +++ b/arch/powerpc/kernel/entry_64.S 2009-10-06 15:34:00.000000000 +0530 @@ -1038,7 +1038,7 @@ _GLOBAL(mod_return_to_handler) * We are in a module using the module's TOC. * Switch to our TOC to run inside the core kernel. */ - LOAD_REG_IMMEDIATE(r4,ftrace_return_to_handler) + LOAD_REG_ADDR(r4,ftrace_return_to_handler) ld r2, 8(r4) bl .ftrace_return_to_handler