From: Sam Ravnborg <sam@xxxxxxxxxxxx> Date: Sun, 13 May 2012 20:45:38 +0200 > On Sun, May 13, 2012 at 02:32:29PM -0400, David Miller wrote: >> Instead, I'd do for these routines what sparc64 does, which is patch >> the actual code. >> >> You have a base implementation which is at least as large as the >> largest implementation which exists. Then you simply copy the >> instructions over from the implementation you want to use. All >> branches must be relative and be to destination only within the >> routine itself, otherwise you'd have to fixup their offsets since the >> necessary branch displacement changes once you move the instruction >> from one place to another. > > That makes sense - then we do not need to search for the callers etc. > And we can use the base implemntation as the default case. > > But I need to brush up my sparc assembler skills a bit first, I'm > afraid. I will put this on my todo list as this would be good to > have, but I will postpone the idea for now. BTW, I just wanted to make a note that the R_SPARC_WDISP30 thing I mentioned is essentially what btfixup is doing by hand. If you look at arch/sparc/boot/btfix.S that gets generated, it has the table of relocations (call sites to fix up) and then the NOP function stubs so that vmlinux can link. -- To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html