Commit 981dca69 authored by Simon Glass's avatar Simon Glass
Browse files

x86: Support skipping relocation for EFI



When running as an EFI application we must skip relocation. Add support for
this in the x86 relocation code.
Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
parent 08aeb8b5
...@@ -28,6 +28,8 @@ int copy_uboot_to_ram(void) ...@@ -28,6 +28,8 @@ int copy_uboot_to_ram(void)
{ {
size_t len = (size_t)&__data_end - (size_t)&__text_start; size_t len = (size_t)&__data_end - (size_t)&__text_start;
if (gd->flags & GD_FLG_SKIP_RELOC)
return 0;
memcpy((void *)gd->relocaddr, (void *)&__text_start, len); memcpy((void *)gd->relocaddr, (void *)&__text_start, len);
return 0; return 0;
...@@ -38,6 +40,8 @@ int clear_bss(void) ...@@ -38,6 +40,8 @@ int clear_bss(void)
ulong dst_addr = (ulong)&__bss_start + gd->reloc_off; ulong dst_addr = (ulong)&__bss_start + gd->reloc_off;
size_t len = (size_t)&__bss_end - (size_t)&__bss_start; size_t len = (size_t)&__bss_end - (size_t)&__bss_start;
if (gd->flags & GD_FLG_SKIP_RELOC)
return 0;
memset((void *)dst_addr, 0x00, len); memset((void *)dst_addr, 0x00, len);
return 0; return 0;
...@@ -58,6 +62,8 @@ int do_elf_reloc_fixups(void) ...@@ -58,6 +62,8 @@ int do_elf_reloc_fixups(void)
/* The size of the region of u-boot that runs out of RAM. */ /* The size of the region of u-boot that runs out of RAM. */
uintptr_t size = (uintptr_t)&__bss_end - (uintptr_t)&__text_start; uintptr_t size = (uintptr_t)&__bss_end - (uintptr_t)&__text_start;
if (gd->flags & GD_FLG_SKIP_RELOC)
return 0;
if (re_src == re_end) if (re_src == re_end)
panic("No relocation data"); panic("No relocation data");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment