Patent ID: 8255892

Claim:
A method for updating program code stored in a memory, the memory having a plurality of memory sectors, the method comprising the steps of: transforming at least one updated source code module into an updated program code version to be stored in a memory, which memory has stored thereon a current program code version occupying a first set of the memory sectors of the memory, wherein the updated program code version occupies a second set of memory sectors when stored in the memory; wherein the transforming step further comprises the steps of compiling the at least one source code module resulting in a number of object modules, receiving a representation of the current program code version, performing at least one optimization step adapted to decrease the number of memory sectors of the second set of memory sectors occupied by the updated code version that are different from the corresponding memory sectors of the first set of memory sectors occupied by the current program code version, and controlling the at least one optimization step by at least one optimization parameter, wherein the at least one optimization parameter includes a maximum bound on allowed padding space that a linker is allowed to introduce or a maximum number of relays that the linker is allowed to introduce; and wherein the performing at least one optimization step, further comprises the steps of generating feedback data during a linking step for linking the number of object modules, re-compiling at least a subset of the source code modules based on the feedback data and resulting in a number of modified object modules, and performing a linking step based on the number of modified object modules.