lkml.org 
[lkml]   [1999]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectCopying binary code?
A good trick with __initdata is to have a bunch of data, and then copy
only what you need into dynamic kernel memory. PCI names does this.

I want to do the same thing with code: copy the code I want into
dynamic memory on a function-by-function basis. Is there a preferred
method?

Presuming function dependencies are correct, a possible solution might
be to compile any code which might be dynamic copied with -fPIC, and
then set up the copy and call on that basis. That is somewhat messy, I
am almost surely missing a more elegant solution.

If you are wondering "why", I want to drop all support code for chipsets
which are not detected by drive probe (which is substantial in some
cases). Or in other words, have drivers re-link themselves at runtime,
freeing unwanted code :)

Though I guess __init and this sort of hackery becomes less important in
a hot-plug device world.

Thanks much,

Jeff




--
Jeff Garzik | Just once, I wish we would encounter
Building 1024 | an alien menace that wasn't immune to
MandrakeSoft, Inc. | bullets. -- The Brigadier, "Dr. Who"

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.052 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site