From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Ll5TO-0005Yl-Hi for mharc-grub-devel@gnu.org; Sat, 21 Mar 2009 13:59:06 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ll5TN-0005Ye-4O for grub-devel@gnu.org; Sat, 21 Mar 2009 13:59:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ll5TH-0005Y8-Jp for grub-devel@gnu.org; Sat, 21 Mar 2009 13:59:03 -0400 Received: from [199.232.76.173] (port=41358 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ll5TH-0005Y5-ES for grub-devel@gnu.org; Sat, 21 Mar 2009 13:58:59 -0400 Received: from fg-out-1718.google.com ([72.14.220.155]:21250) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ll5TG-00033u-TZ for grub-devel@gnu.org; Sat, 21 Mar 2009 13:58:59 -0400 Received: by fg-out-1718.google.com with SMTP id l27so181856fgb.7 for ; Sat, 21 Mar 2009 10:58:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=DE4XkHS1MeKrxCS5j1I9Uszlvh+f5Fh+2WTlwaOBkLQ=; b=MPBWSLyGrYShwTNeDVQzOYLJo/apTg8040q+jbxZq9mvUtmeZlwhuCtR94S6+950ZX ECm1EOpDoYYVEYzCeJJpo+fLOH8yEs6QyZZiQGFYNnr+pZ4Vth5T4rvMaOcMvFq0NWMq hHzY5J81GnHYhgHQdDHL4AegMqPljo/1zKSt4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=d0Wck3BgpOp2XQ6LCvpqCnWipXDnnXRjz8ymHgPZ2OYLtjRiVXysTmAUjBkUMxaFw4 VI+wxq1rD/zEKu74y5hbINedIsWA8ZwqXldCKdCqkvCN0Qot/QS83iR3BRL9f3E6sVl0 mvQkZoNjuBPd9cSOVyGBJoP6vFLHdBX0VMKIs= Received: by 10.86.66.19 with SMTP id o19mr1327677fga.24.1237658336646; Sat, 21 Mar 2009 10:58:56 -0700 (PDT) Received: from ?192.168.1.25? (217-154.203-62.cust.bluewin.ch [62.203.154.217]) by mx.google.com with ESMTPS id 4sm958805fgg.0.2009.03.21.10.58.55 (version=SSLv3 cipher=RC4-MD5); Sat, 21 Mar 2009 10:58:56 -0700 (PDT) Message-ID: <49C52AE2.5070202@gmail.com> Date: Sat, 21 Mar 2009 18:58:58 +0100 From: phcoder User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: The development of GRUB 2 References: <49B82B65.3080506@gmail.com> <20090313191442.GC17068@thorin> <49BAC506.2030006@gmail.com> <20090313.134505.185970759.davem@davemloft.net> <49BAC797.9010200@gmail.com> <20090318101227.GB20072@thorin> <49C0F690.7060305@gmail.com> <20090321174629.GB18284@thorin> In-Reply-To: <20090321174629.GB18284@thorin> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: ELF bugfixes X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2009 17:59:05 -0000 Robert Millan wrote: > On Wed, Mar 18, 2009 at 02:26:40PM +0100, phcoder wrote: >> Robert Millan wrote: >>> On Fri, Mar 13, 2009 at 09:52:39PM +0100, phcoder wrote: >>>> - grub_multiboot_payload_entry_offset = ehdr->e_entry - phdr(lowest_segment)->p_vaddr; >>>> + for (i = 0; i < ehdr->e_phnum; i++) >>>> + if (phdr(i)->p_vaddr <= ehdr->e_entry + && phdr(i)->p_vaddr + >>>> phdr(i)->p_memsz > ehdr->e_entry) >>>> + grub_multiboot_payload_entry_offset = (ehdr->e_entry - phdr(i)->p_vaddr) >>>> + + (phdr(i)->p_paddr - phdr(lowest_segment)->p_paddr); >>> You need to handle the case in which grub_multiboot_payload_entry_offset is left >>> uninitialized (it needs to be initialized each time the multiboot command is >>> run, not just when the module is loaded). >>> >> module? actually it's when loading image. Perhaps you mean that >> additional error check is necessary > > I meant GRUB's multiboot.mod, not the payload's module. Sorry I wasn't clear. > With this error check if grub_multiboot_payload_entry_offset it can happen only if no image is loaded. And actually grub_multiboot_payload_entry_offset is set to 0 at multiboot.mod load So I don't really understand the problem -- Regards Vladimir 'phcoder' Serbinenko