diff options
author | 2016-05-14 18:26:39 +0000 | |
---|---|---|
committer | 2016-05-14 18:26:39 +0000 | |
commit | fdb56593d36c596da1ca5dfd8e592c14681bf89a (patch) | |
tree | c4c8e38b7b78ffc45e51892ec1eebdc8c81b2d3d | |
parent | Load the kernel at the address pre-allocated by the EFI bootloader. (diff) | |
download | wireguard-openbsd-fdb56593d36c596da1ca5dfd8e592c14681bf89a.tar.xz wireguard-openbsd-fdb56593d36c596da1ca5dfd8e592c14681bf89a.zip |
Tell the kernel where its symbols are.
-rw-r--r-- | sys/arch/armv7/stand/efiboot/exec.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/arch/armv7/stand/efiboot/exec.c b/sys/arch/armv7/stand/efiboot/exec.c index 189eb4e4b8c..f550f6c02a1 100644 --- a/sys/arch/armv7/stand/efiboot/exec.c +++ b/sys/arch/armv7/stand/efiboot/exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec.c,v 1.1 2016/05/14 17:55:15 kettenis Exp $ */ +/* $OpenBSD: exec.c,v 1.2 2016/05/14 18:26:39 kettenis Exp $ */ /* * Copyright (c) 2006, 2016 Mark Kettenis @@ -80,11 +80,11 @@ struct uboot_tag tags[2]; void run_loadfile(u_long *marks, int howto) { -#if 0 #ifdef BOOT_ELF Elf_Ehdr *elf = (Elf_Ehdr *)marks[MARK_SYM]; Elf_Shdr *shp = (Elf_Shdr *)(marks[MARK_SYM] + elf->e_shoff); - u_long esym = marks[MARK_END]; + u_long esym = marks[MARK_END] & 0x0fffffff; + u_long offset = 0; char *cp; int i; @@ -97,12 +97,14 @@ run_loadfile(u_long *marks, int howto) /* XXX Assume .data is the first writable segment. */ if (shp[i].sh_flags & SHF_WRITE) { /* XXX We have to store the virtual address. */ - esym |= shp[i].sh_addr & 0xff000000; - *(u_long *)(shp[i].sh_addr & 0x00ffffff) = esym; + esym |= shp[i].sh_addr & 0xf0000000; + *(u_long *)(LOADADDR(shp[i].sh_addr)) = esym; break; } } #endif + +#if 0 cp = (char *)0x00200000 - MAX_BOOT_STRING - 1; #define BOOT_STRING_MAGIC 0x4f425344 @@ -124,7 +126,6 @@ run_loadfile(u_long *marks, int howto) *cp++ = 's'; *cp = '\0'; - #endif tags[0].hdr.tag = ATAG_MEM; |