aboutsummaryrefslogtreecommitdiff
path: root/include/relocate.h
diff options
context:
space:
mode:
authorSimon Glass2021-09-25 07:03:19 -0600
committerTom Rini2021-10-08 15:53:26 -0400
commitc5a68d29e38ce25646ee42eb49a29364aab84531 (patch)
treefdad4a07177efe25dc81af396bb078273fad519a /include/relocate.h
parent2ac00c050582389e667374bccc5cc19b4fce80f5 (diff)
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>
Diffstat (limited to 'include/relocate.h')
-rw-r--r--include/relocate.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/relocate.h b/include/relocate.h
index c4fad336128..26682da955f 100644
--- a/include/relocate.h
+++ b/include/relocate.h
@@ -57,4 +57,10 @@ static inline void *manual_reloc(void *ptr)
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_ */