Add #ifdef for non-used function in overwrite only

Signed-off-by: Fabio Utzig <utzig@apache.org>
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/boot/bootutil/src/loader.c b/boot/bootutil/src/loader.c
index b03b745..c2e5006 100644
--- a/boot/bootutil/src/loader.c
+++ b/boot/bootutil/src/loader.c
@@ -210,6 +210,7 @@
  * Compute the total size of the given image.  Includes the size of
  * the TLVs.
  */
+#ifndef MCUBOOT_OVERWRITE_ONLY
 static int
 boot_read_image_size(int slot, struct image_header *hdr, uint32_t *size)
 {
@@ -242,6 +243,7 @@
     flash_area_close(fap);
     return rc;
 }
+#endif /* !MCUBOOT_OVERWRITE_ONLY */
 
 static int
 boot_read_image_header(int slot, struct image_header *out_hdr)