Method and apparatus for switching between multiple implementations of a
routine. A plurality of implementations of a routine are compiled into
respective object code modules. In one embodiment, each implementation of
the routine is adapted for a particular hardware configuration. The
different object code modules are associated with respective sets of
hardware characteristics and with the name of the routine. When the
application program and library are loaded into memory of the computer
system, a references to the routine are resolved using the sets of
hardware characteristics and the hardware configuration of the system.