From 04831653327fc946ceec601ea70eb46c83e684a5 Mon Sep 17 00:00:00 2001 From: Jason Wright Date: Thu, 20 Sep 2001 23:26:03 +0000 Subject: From NetBSD: allow loading of kernels with bss+data > 4M --- sys/arch/sparc64/stand/ofwboot/elfXX_exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/arch/sparc64/stand/ofwboot/elfXX_exec.c') diff --git a/sys/arch/sparc64/stand/ofwboot/elfXX_exec.c b/sys/arch/sparc64/stand/ofwboot/elfXX_exec.c index e01f23abb9f..252b48e1cec 100644 --- a/sys/arch/sparc64/stand/ofwboot/elfXX_exec.c +++ b/sys/arch/sparc64/stand/ofwboot/elfXX_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elfXX_exec.c,v 1.2 2001/08/20 19:55:33 jason Exp $ */ +/* $OpenBSD: elfXX_exec.c,v 1.3 2001/09/20 23:26:02 jason Exp $ */ /* $NetBSD: elfXX_exec.c,v 1.2 2001/08/15 20:08:15 eeh Exp $ */ /* @@ -108,7 +108,7 @@ CAT3(elf, ELFSIZE, _exec)(fd, elf, entryp, ssymp, esymp) if ((phdr.p_vaddr & (4*MEG-1)) == 0) align = 4*MEG; if (phdr.p_filesz < phdr.p_memsz) - phdr.p_memsz = 4*MEG; + phdr.p_memsz = (phdr.p_memsz + 4*MEG) & ~(4*MEG-1); if (OF_claim((void *)(long)phdr.p_vaddr, phdr.p_memsz, align) == (void *)-1) panic("cannot claim memory"); -- cgit v1.2.3