4 ms·
No, some parts of the binary file will be unused in the final executable if you keep updating it incrementally. The linkers will do what they can to reuse all
by alexnask 6y ago
No, some parts of the binary file will be unused in the final executable if you keep updating it incrementally.
The linkers will do what they can to reuse all previously freed blocks of the file, but you can imagine a scenario where a function is updated but does not fit in the block that was previously allocated for it. In this case, a new block of the file will be allocated for this function.
If you then add a smaller function, it will occupy some portion of the old block. You can keep adding things into this block until some minimum amount of memory is reached (and as long as the declarations fit in there, obviously).
Repeating this process for all new declarations and for all the modifications of declarations, you can imagine some parts of the files will remain unused.
I hope this makes sense :)