From patchwork Fri Dec 12 13:31:38 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohan Kumar M X-Patchwork-Id: 22980 Return-Path: X-Original-To: yaboot-devel@ozlabs.org Delivered-To: yaboot-devel@ozlabs.org Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.145]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e5.ny.us.ibm.com", Issuer "Equifax" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id DEB13DE05A for ; Sat, 13 Dec 2008 00:31:45 +1100 (EST) Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e5.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id mBCDUx6M015256 for ; Fri, 12 Dec 2008 08:30:59 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mBCDVe64178514 for ; Fri, 12 Dec 2008 08:31:40 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mBCDV8t8004880 for ; Fri, 12 Dec 2008 08:31:08 -0500 Received: from explorer.in.ibm.com ([9.124.31.24]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id mBCDV7tb004846; Fri, 12 Dec 2008 08:31:08 -0500 Received: by explorer.in.ibm.com (Postfix, from userid 500) id 3FE02244EDF; Fri, 12 Dec 2008 19:01:38 +0530 (IST) Date: Fri, 12 Dec 2008 19:01:38 +0530 From: "M. Mohan Kumar" To: yaboot-devel@ozlabs.org Subject: [PATCH] Allow yaboot to load relocatable kernel Message-ID: <20081212133138.GA9720@in.ibm.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Cc: paulus@samba.org, maneesh@in.ibm.com X-BeenThere: yaboot-devel@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: mohan@in.ibm.com List-Id: Technical and development discussion regarding yaboot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Dec 2008 13:31:47 -0000 PPC64 relocatable kernels (built with CONFIG_RELOCATABLE=y) have the type of ET_DYN. But yaboot code won't load the kernel if the ELF type is not ET_EXEC. Attached patch adds support to yaboot to load relocatable kernels also (ie load ET_DYN type also) Signed-off-by: M. Mohan Kumar Acked-by: Paul Mackerras --- second/yaboot.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/second/yaboot.c b/second/yaboot.c index d6e8017..3db7b4f 100644 --- a/second/yaboot.c +++ b/second/yaboot.c @@ -1606,7 +1606,7 @@ is_elf64(loadinfo_t *loadinfo) e->e_ident[EI_MAG3] == ELFMAG3 && e->e_ident[EI_CLASS] == ELFCLASS64 && e->e_ident[EI_DATA] == ELFDATA2MSB && - e->e_type == ET_EXEC && + (e->e_type == ET_EXEC || e->e_type == ET_DYN) && e->e_machine == EM_PPC64); }