[U-Boot] [PATCH v2 26/47] x86: Support skipping relocation for EFI

Bin Meng bmeng.cn at gmail.com
Tue Aug 4 06:19:40 CEST 2015


On Fri, Jul 31, 2015 at 11:31 PM, Simon Glass <sjg at chromium.org> wrote:
> When running as an EFI application we must skip relocation. Add support for
> this in the x86 relocation code.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> Changes in v2:
> - Return early in copy_uboot_to_ram() and clear_bbs() when relocation disabled
>
>  arch/x86/lib/relocate.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c
> index 1a62142..9e748d2 100644
> --- a/arch/x86/lib/relocate.c
> +++ b/arch/x86/lib/relocate.c
> @@ -28,6 +28,8 @@ int copy_uboot_to_ram(void)
>  {
>         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);
>
>         return 0;
> @@ -38,6 +40,8 @@ int clear_bss(void)
>         ulong dst_addr = (ulong)&__bss_start + gd->reloc_off;
>         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);
>
>         return 0;
> @@ -58,6 +62,8 @@ int do_elf_reloc_fixups(void)
>         /* The size of the region of u-boot that runs out of RAM. */
>         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)
>                 panic("No relocation data");
>
> --

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>


More information about the U-Boot mailing list