One embodiment of the present invention provides a method and a system for
patching a set of objects containing references. The system uses a
location structure to keep track of the locations of references within
the set of objects. During the patching process, the system converts the
references within the set objects from an absolute form into an
offset-based form, where offsets are computed with respect to base
addresses of objects. The system then applies an offset-based patch to
the set of objects and to the location structure using a binary-patching
technique. After applying the patch, the system converts the references
in the set of objects back into absolute form. By using an offset-based
patch, the system reduces the number of reference changes that need to be
specified in the patch, thereby reducing the size of the patch.