summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornaddy <naddy@openbsd.org>2018-10-26 15:00:54 +0000
committernaddy <naddy@openbsd.org>2018-10-26 15:00:54 +0000
commite2bb53a12de7b9f8d5335535bd984bf7b18f73e0 (patch)
tree108b42591f3a3092ab4e6a22dfe4a06b23c8b6d6
parentMake it clear that `if_bridgeport' is dereferenced in the ioctl path (diff)
downloadwireguard-openbsd-e2bb53a12de7b9f8d5335535bd984bf7b18f73e0.tar.xz
wireguard-openbsd-e2bb53a12de7b9f8d5335535bd984bf7b18f73e0.zip
With lld the calculation of the entry point was wrong since
LOADADDR(.text) is only available after the description of the text section. Instead simply use ENTRY(start) like we do on amd64. The bootloader strips the high bits from the entry point address already, so using the virtual address as the entry point address works. with/ok kettenis@
-rw-r--r--sys/arch/i386/conf/ld.script6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/arch/i386/conf/ld.script b/sys/arch/i386/conf/ld.script
index 269318dde62..7760974c2b8 100644
--- a/sys/arch/i386/conf/ld.script
+++ b/sys/arch/i386/conf/ld.script
@@ -1,4 +1,4 @@
-/* $OpenBSD: ld.script,v 1.9 2018/04/11 15:44:08 bluhm Exp $ */
+/* $OpenBSD: ld.script,v 1.10 2018/10/26 15:00:54 naddy Exp $ */
/*
* Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org>
@@ -41,9 +41,7 @@ __ALIGN_SIZE = 0x1000;
__kernel_base_virt = 0xd0200000 + SIZEOF_HEADERS;
__kernel_base_phys = __kernel_base_virt & 0xfffffff;
-/* We use physical address to jump to kernel */
-start_phys = LOADADDR(.text) + (start - __kernel_base_virt);
-ENTRY(start_phys)
+ENTRY(start)
SECTIONS
{
__kernel_text_virt = __kernel_base_virt;