Index: kernel/arch/ia32/_link.ld.in
===================================================================
--- kernel/arch/ia32/_link.ld.in	(revision e3444229c8e3295e9e2bed75246c19263f3c51a6)
+++ kernel/arch/ia32/_link.ld.in	(revision d723a80511b6dd3f705759edc7127c26a1d91c74)
@@ -13,4 +13,6 @@
 
 SECTIONS {
+	kernel_load_address = PA2KA(BOOT_OFFSET);
+
 	.unmapped BOOT_OFFSET: AT (0) {
 		unmapped_ktext_start = .;
@@ -32,14 +34,4 @@
 		*(.rodata .rodata.*);   /* string literals */
 		*(COMMON);              /* global variables */
-		hardcoded_load_address = .;
-		LONG(PA2KA(BOOT_OFFSET));
-		hardcoded_ktext_size = .;
-		LONG((ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start));
-		hardcoded_kdata_size = .;
-		LONG((kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start));
-		hardcoded_unmapped_ktext_size = .;
-		LONG(unmapped_ktext_end - unmapped_ktext_start);
-		hardcoded_unmapped_kdata_size = .;
-		LONG(unmapped_kdata_end - unmapped_kdata_start);
 		. = ALIGN(8);
 		symbol_table = .;
@@ -68,5 +60,4 @@
 #ifdef CONFIG_SMP
 
-	_hardcoded_unmapped_size = (unmapped_ktext_end - unmapped_ktext_start) + (unmapped_kdata_end - unmapped_kdata_start);
 	ap_boot = unmapped_ap_boot - BOOT_OFFSET + AP_BOOT_OFFSET;
 	ap_gdtr = unmapped_ap_gdtr - BOOT_OFFSET + AP_BOOT_OFFSET;
Index: kernel/arch/ia32/include/arch/boot/boot.h
===================================================================
--- kernel/arch/ia32/include/arch/boot/boot.h	(revision e3444229c8e3295e9e2bed75246c19263f3c51a6)
+++ kernel/arch/ia32/include/arch/boot/boot.h	(revision d723a80511b6dd3f705759edc7127c26a1d91c74)
@@ -44,6 +44,5 @@
 #ifdef CONFIG_SMP
 
-/* This is only a symbol so the type is dummy. Obtain the value using &. */
-extern int _hardcoded_unmapped_size;
+extern uint8_t unmapped_kdata_end[];
 
 #endif /* CONFIG_SMP */
Index: kernel/arch/ia32/src/boot/multiboot.S
===================================================================
--- kernel/arch/ia32/src/boot/multiboot.S	(revision e3444229c8e3295e9e2bed75246c19263f3c51a6)
+++ kernel/arch/ia32/src/boot/multiboot.S	(revision d723a80511b6dd3f705759edc7127c26a1d91c74)
@@ -285,17 +285,6 @@
 /** Calculate unmapped address of the end of the kernel. */
 calc_kernel_end:
-	movl $KA2PA(hardcoded_load_address), %edi
-	movl (%edi), %esi
-	leal KA2PA(0)(%esi), %esi
-
-	movl $KA2PA(hardcoded_ktext_size), %edi
-	addl (%edi), %esi
-	leal KA2PA(0)(%esi), %esi
-
-	movl $KA2PA(hardcoded_kdata_size), %edi
-	addl (%edi), %esi
-	leal KA2PA(0)(%esi), %esi
-	movl %esi, kernel_end
-
+	movl $KA2PA(kdata_end), %edi
+	movl %edi, kernel_end
 	ret
 
Index: kernel/arch/ia32/src/ia32.c
===================================================================
--- kernel/arch/ia32/src/ia32.c	(revision e3444229c8e3295e9e2bed75246c19263f3c51a6)
+++ kernel/arch/ia32/src/ia32.c	(revision d723a80511b6dd3f705759edc7127c26a1d91c74)
@@ -94,7 +94,7 @@
 
 #ifdef CONFIG_SMP
+	size_t unmapped_size = (uintptr_t) unmapped_kdata_end - BOOT_OFFSET;
 	/* Copy AP bootstrap routines below 1 MB. */
-	memcpy((void *) AP_BOOT_OFFSET, (void *) BOOT_OFFSET,
-	    (size_t) &_hardcoded_unmapped_size);
+	memcpy((void *) AP_BOOT_OFFSET, (void *) BOOT_OFFSET, unmapped_size);
 #endif
 }
Index: kernel/arch/ia32/src/mm/frame.c
===================================================================
--- kernel/arch/ia32/src/mm/frame.c	(revision e3444229c8e3295e9e2bed75246c19263f3c51a6)
+++ kernel/arch/ia32/src/mm/frame.c	(revision d723a80511b6dd3f705759edc7127c26a1d91c74)
@@ -47,7 +47,4 @@
 
 #define PHYSMEM_LIMIT32  UINT64_C(0x100000000)
-
-size_t hardcoded_unmapped_ktext_size = 0;
-size_t hardcoded_unmapped_kdata_size = 0;
 
 static void init_e820_memory(pfn_t minconf, bool low)
@@ -155,7 +152,9 @@
 
 #ifdef CONFIG_SMP
+		size_t unmapped_size =
+		    (uintptr_t) unmapped_kdata_end - BOOT_OFFSET;
+
 		minconf = max(minconf,
-		    ADDR2PFN(AP_BOOT_OFFSET + hardcoded_unmapped_ktext_size +
-		    hardcoded_unmapped_kdata_size));
+		    ADDR2PFN(AP_BOOT_OFFSET + unmapped_size));
 #endif
 
@@ -168,6 +167,5 @@
 		/* Reserve AP real mode bootstrap memory */
 		frame_mark_unavailable(AP_BOOT_OFFSET >> FRAME_WIDTH,
-		    (hardcoded_unmapped_ktext_size +
-		    hardcoded_unmapped_kdata_size) >> FRAME_WIDTH);
+		    unmapped_size >> FRAME_WIDTH);
 #endif
 	}
