summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/bootstage.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/bootstage.c b/common/bootstage.c
index a1e09394cc..15afa24c44 100644
--- a/common/bootstage.c
+++ b/common/bootstage.c
@@ -56,6 +56,21 @@ struct bootstage_hdr {
uint32_t magic; /* Unused */
};
+int bootstage_relocate(void)
+{
+ int i;
+
+ /*
+ * Duplicate all strings. They may point to an old location in the
+ * program .text section that can eventually get trashed.
+ */
+ for (i = 0; i < BOOTSTAGE_ID_COUNT; i++)
+ if (record[i].name)
+ record[i].name = strdup(record[i].name);
+
+ return 0;
+}
+
ulong bootstage_add_record(enum bootstage_id id, const char *name,
int flags, ulong mark)
{