Techniques for cloning programming code are disclosed. In an embodiment,
the cloned code is in the form of functions in the C language. Further,
in a method embodiment, a clone of a function is invoked, and information
mapping the clone to the function is generated. At link time, if no
function body of the clone is accessible by a linker, then the linker
uses information mapping the clone to the function to satisfy a linker's
requirement. At load time, if no function body of the clone is accessible
by a loader, then the loader, based on the mapping information, allows
selection of a body of the function. However, if the body function of the
clone is accessible by the loader, then the loader allows selection of
the body of the clone.