Re: Do we use runtime patching of function calls somewhere?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 13, 2012 at 02:32:29PM -0400, David Miller wrote:
> From: Sam Ravnborg <sam@xxxxxxxxxxxx>
> Date: Sun, 13 May 2012 14:16:00 +0200
> 
> > I could try to come up with something myself - but if we already
> > have it somewhere maybe there is something to be inspired by.
> 
> You could relocatable link, record all the R_SPARC_WDISP30 relocations
> into a special data file (which you'd link into vmlinux), then provide
> a stub version of all the routines.
> 
> At run time you walk through the relocations and resolve them just as
> the linker or the module loader would.
> 
> But I wouldn't do this, it's hairy with modules etc.
> 
> 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.

	Sam
--
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


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux