diff mbox

Allow yaboot to load relocatable kernel

Message ID 20081212133138.GA9720@in.ibm.com
State Accepted
Headers show

Commit Message

Mohan Kumar M Dec. 12, 2008, 1:31 p.m. UTC
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 <mohan@in.ibm.com>
---
 second/yaboot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Paul Mackerras Dec. 15, 2008, 4:14 a.m. UTC | #1
M. Mohan Kumar writes:

> 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 <mohan@in.ibm.com>

Acked-by: Paul Mackerras <paulus@samba.org>
Mohan Kumar M Feb. 11, 2009, 6:02 a.m. UTC | #2
On Monday 15 December 2008 9:44:59 am Paul Mackerras wrote:
> M. Mohan Kumar writes:
> > 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 <mohan@in.ibm.com>
>
> Acked-by: Paul Mackerras <paulus@samba.org>

Hi Paul,
Any update on this?
diff mbox

Patch

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);
 }