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

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

 



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.

See arch/sparc/mm/ultra.S
--
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