/*******************************************************************/
 /* bootm - boot application image from image in memory */
 /*******************************************************************/
-static int relocated = 0;
 
 int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        ulong           load_end = 0;
        int             ret;
        boot_os_fn      *boot_fn;
+#ifndef CONFIG_RELOC_FIXUP_WORKS
+       static int relocated = 0;
 
        /* relocate boot function table */
        if (!relocated) {
                                boot_os[i] += gd->reloc_off;
                relocated = 1;
        }
+#endif
 
        /* determine if we have a sub command */
        if (argc > 1) {
 
        "Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur",
 };
 
+#ifdef CONFIG_RELOC_FIXUP_WORKS
+#define RELOC(a)       a
+#else
 #define RELOC(a)       ((typeof(a))((unsigned long)(a) + gd->reloc_off))
+#endif
 
 int mk_date (char *, struct rtc_time *);
 
 
  IAV(120), IAV(121), IAV(122), IAV(123), IAV(124), IAV(125), IAV(126), IAV(127)
 };
 
+#ifndef CONFIG_RELOC_FIXUP_WORKS
 void malloc_bin_reloc (void)
 {
        unsigned long *p = (unsigned long *)(&av_[2]);
                *p++ += gd->reloc_off;
        }
 }
+#endif
 
 ulong mem_malloc_start = 0;
 ulong mem_malloc_end = 0;
 
 
 void env_relocate (void)
 {
+#ifndef CONFIG_RELOC_FIXUP_WORKS
        DEBUGF ("%s[%d] offset = 0x%lx\n", __FUNCTION__,__LINE__,
                gd->reloc_off);
+#endif
 
 #ifdef CONFIG_AMIGAONEG3SE
        enable_nvram();
         * The environment buffer is embedded with the text segment,
         * just relocate the environment pointer
         */
+#ifndef CONFIG_RELOC_FIXUP_WORKS
        env_ptr = (env_t *)((ulong)env_ptr + gd->reloc_off);
+#endif
        DEBUGF ("%s[%d] embedded ENV at %p\n", __FUNCTION__,__LINE__,env_ptr);
 #else
        /*
 
 }
 
 #ifdef __U_BOOT__
+#ifndef CONFIG_RELOC_FIXUP_WORKS
 static void u_boot_hush_reloc(void)
 {
        unsigned long addr;
                r->literal = (char *)addr;
        }
 }
+#endif
 
 int u_boot_hush_start(void)
 {
                top_vars->next = 0;
                top_vars->flg_export = 0;
                top_vars->flg_read_only = 1;
+#ifndef CONFIG_RELOC_FIXUP_WORKS
                u_boot_hush_reloc();
+#endif
        }
        return 0;
 }
 
 {
        for (; table->id >= 0; ++table) {
                if (table->id == id)
-#ifdef USE_HOSTCC
+#if defined(USE_HOSTCC) || defined(CONFIG_RELOC_FIXUP_WORKS)
                        return table->lname;
 #else
                        return table->lname + gd->reloc_off;
        fprintf (stderr, "\n");
 #else
        for (t = table; t->id >= 0; ++t) {
+#ifdef CONFIG_RELOC_FIXUP_WORKS
+               if (t->sname && strcmp(t->sname, name) == 0)
+#else
                if (t->sname && strcmp(t->sname + gd->reloc_off, name) == 0)
+#endif
                        return (t->id);
        }
        debug ("Invalid %s Type: %s\n", table_name, name);
 
 
 int serial_register (struct serial_device *dev)
 {
+#ifndef CONFIG_RELOC_FIXUP_WORKS
        dev->init += gd->reloc_off;
        dev->setbrg += gd->reloc_off;
        dev->getc += gd->reloc_off;
        dev->tstc += gd->reloc_off;
        dev->putc += gd->reloc_off;
        dev->puts += gd->reloc_off;
+#endif
 
        dev->next = serial_devices;
        serial_devices = dev;
 
 
 int stdio_init (void)
 {
-#ifndef CONFIG_ARM     /* already relocated for current ARM implementation */
+#if !defined(CONFIG_ARM) && !defined(CONFIG_RELOC_FIXUP_WORKS)
+       /* already relocated for current ARM implementation */
        ulong relocation_offset = gd->reloc_off;
        int i;
 
                stdio_names[i] = (char *) (((ulong) stdio_names[i]) +
                                                relocation_offset);
        }
-#endif
+#endif /* !ARM && !CONFIG_RELOC_FIXUP_WORKS */
 
        /* Initialize the list */
        INIT_LIST_HEAD(&(devs.list));
 
        block_dev_desc_t* (*reloc_get_dev)(int dev);
 
        while (drvr->name) {
-               reloc_get_dev = drvr->get_dev + gd->reloc_off;
+               reloc_get_dev = drvr->get_dev;
+#ifndef CONFIG_RELOC_FIXUP_WORKS
+               reloc_get_dev += gd->reloc_off;
+#endif
                if (strncmp(ifname, drvr->name, strlen(drvr->name)) == 0)
                        return reloc_get_dev(dev);
                drvr++;
 
                if (nand_scan(mtd, maxchips) == 0) {
                        if (!mtd->name)
                                mtd->name = (char *)default_nand_name;
+#ifndef CONFIG_RELOC_FIXUP_WORKS
                        else
                                mtd->name += gd->reloc_off;
+#endif
 
 #ifdef CONFIG_MTD_DEVICE
                        /*
 
 static int __init compr_init(struct ubifs_compressor *compr)
 {
        ubifs_compressors[compr->compr_type] = compr;
+
+#ifndef CONFIG_RELOC_FIXUP_WORKS
        ubifs_compressors[compr->compr_type]->name += gd->reloc_off;
        ubifs_compressors[compr->compr_type]->capi_name += gd->reloc_off;
        ubifs_compressors[compr->compr_type]->decompress += gd->reloc_off;
+#endif
+
        return 0;
 }
 
 
 int post_run (char *name, int flags);
 int post_info (char *name);
 int post_log (char *format, ...);
+#ifndef CONFIG_RELOC_FIXUP_WORKS
 void post_reloc (void);
+#endif
 unsigned long post_time_ms (unsigned long base);
 
 extern struct post_test post_list[];
 
        return 0;
 }
 
+#ifndef CONFIG_RELOC_FIXUP_WORKS
 void post_reloc (void)
 {
        unsigned int i;
                }
        }
 }
+#endif
 
 
 /*