mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Link time manipulation of kernel symbols like read/write
@ 2010-05-07 17:51 Leonidas .
  2010-05-09  6:51 ` Leonidas .
  0 siblings, 1 reply; 4+ messages in thread
From: Leonidas . @ 2010-05-07 17:51 UTC (permalink / raw)
  To: linux-kernel

Hi folks,

Is it possible to wrap module entry points like open/close during the
module compilation?
By wrapping, I mean interposing using linker --wrap option. This is
very much possible in
user space and is commonly used to interpose library functions.

E.g.

void *
__wrap_malloc (int c)
{
  printf ("malloc called with %ld\n", c);
  return __real_malloc (c);
}

int main()
{
    malloc(17);
    return 0;
}

Above works expected, can we wrap kmalloc this way?

-Leo.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-05-09 15:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-07 17:51 Link time manipulation of kernel symbols like read/write Leonidas .
2010-05-09  6:51 ` Leonidas .
2010-05-09 14:38   ` Arjan van de Ven
2010-05-09 15:19     ` Leonidas .

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®