1. A segmented linker for generating from an original binary file an upgraded binary file suitable for replacing a copy of the original binary file installed in a target device, wherein the segmented linker receives as inputs a plurality of objects, the original binary file, and a memory map input file associated with a target device and wherein the segmented linker preserves in the upgraded binary file at least some of the spatial locality of reference of code in the original binary file.