From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1OYcVh-000494-8s for mharc-grub-devel@gnu.org; Tue, 13 Jul 2010 06:14:45 -0400 Received: from [140.186.70.92] (port=43912 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OYcVa-00041q-KT for grub-devel@gnu.org; Tue, 13 Jul 2010 06:14:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OYcVL-0001F0-9L for grub-devel@gnu.org; Tue, 13 Jul 2010 06:14:27 -0400 Received: from ozlabs.org ([203.10.76.45]:40287) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OYcVK-0001Ee-VE for grub-devel@gnu.org; Tue, 13 Jul 2010 06:14:23 -0400 Received: by ozlabs.org (Postfix, from userid 1010) id 57E1CB6F16; Tue, 13 Jul 2010 20:14:21 +1000 (EST) Date: Tue, 13 Jul 2010 20:12:42 +1000 From: Anton Blanchard To: The development of GNU GRUB Message-ID: <20100713101242.GA15491@kryten> References: <20100713054523.GC10155@kryten> <4C3C3018.3080508@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C3C3018.3080508@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] Fix for relocatable PowerPC kernels X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jul 2010 10:14:42 -0000 Hi, > Is building as ET_DYN supported upstream? We previously had reports of > building system of some distros to be plainly borked and usualy the > distro fixed their building system pretty fast. If upstream supports > ET_DYN, then this patch is accepted with no further questions. But if > it's a borked building system it may have subtle bugs and allowing it > would probably just suppress an early symptom of other problems. This is supported upstream on a number of architectures, for example the PowerPC configuration option is: config RELOCATABLE bool "Build a relocatable kernel" help This builds a kernel image that is capable of running anywhere in the RMA (real memory area) at any 16k-aligned base address. The kernel is linked as a position-independent executable (PIE) and contains dynamic relocations which are processed early in the bootup process. One use is for the kexec on panic case where the recovery kernel must live at a different physical address than the primary kernel. Regards, Anton > > 2010-07-13 Anton Blanchard > > > > * loader/powerpc/ieee1275/linux.c (grub_cmd_linux): Do not reject > > ET_DYN files. > > > > Index: grub/loader/powerpc/ieee1275/linux.c > > =================================================================== > > --- grub.orig/loader/powerpc/ieee1275/linux.c 2010-07-11 12:05:16.443242734 +1000 > > +++ grub/loader/powerpc/ieee1275/linux.c 2010-07-12 14:56:20.301991065 +1000 > > @@ -220,7 +220,7 @@ grub_cmd_linux (grub_command_t cmd __att > > if (! elf) > > goto out; > > > > - if (elf->ehdr.ehdr32.e_type != ET_EXEC) > > + if (elf->ehdr.ehdr32.e_type != ET_EXEC && elf->ehdr.ehdr32.e_type != ET_DYN) > > { > > grub_error (GRUB_ERR_UNKNOWN_OS, > > "this ELF file is not of the right type");