NetBSD Problem Report #38603
From martin@duskware.de Wed May 7 09:17:57 2008
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by narn.NetBSD.org (Postfix) with ESMTP id D137E63B293
for <gnats-bugs@gnats.netbsd.org>; Wed, 7 May 2008 09:17:56 +0000 (UTC)
Message-Id: <20080507023722.AC02A63B293@narn.NetBSD.org>
Date: Wed, 7 May 2008 02:37:22 +0000 (UTC)
From: abutter.gao@gmail.com
Reply-To: abutter.gao@gmail.com
To: netbsd-bugs-owner@NetBSD.org
Subject: unreasonable calculation of esym in multiboot.c on i386/amd64 platform perhaps
X-Send-Pr-Version: www-1.0
>Number: 38603
>Category: port-i386
>Synopsis: unreasonable calculation of esym in multiboot.c on i386/amd64 platform perhaps
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: port-i386-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed May 07 09:20:00 +0000 2008
>Originator: Gao Ya'nan
>Release: NetBSD-current
>Organization:
>Environment:
None
>Description:
After multiboot.c rev-1.15, the esym calculation is like this:
*RELOC(int *, &esym) = (int)(symstart + symsize + strsize + KERNBASE);
But, perhaps there is still a problem. if the strtab is copied prior to the symtab, the esym is above the "lowest 'free' address after the tables" and we will waste some momeoy when the result of "end + symsize + strsize" is near the page boundary.
>How-To-Repeat:
I just get is by the source code, so, sorry.
>Fix:
Actually, the "lowest 'free' address after the tables" is just the "end + symsize + strsize", because we only copy symsize and strsize bytes behind the end.
so the esym calculation should be like this:
*RELOC(int *, &esym) = (int)(end + symsize + strsize);
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.