image: Avoid #ifdefs for manual relocation
Add a macro to handle manually relocating a pointer. Update the iamge code
to use this to avoid needing #ifdefs.
This also fixes a bug where the 'done' flag was not set.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/include/relocate.h b/include/relocate.h
index c4fad33..26682da 100644
--- a/include/relocate.h
+++ b/include/relocate.h
@@ -57,4 +57,10 @@
return ptr;
}
+#if !defined(USE_HOSTCC) && defined(CONFIG_NEEDS_MANUAL_RELOC)
+#define MANUAL_RELOC(ptr) (ptr) = manual_reloc(ptr)
+#else
+#define MANUAL_RELOC(ptr) (void)(ptr)
+#endif
+
#endif /* _RELOCATE_H_ */