]> git.ozlabs.org Git - yaboot.git/commitdiff
Allow yaboot to load relocatable kernel
authorMohan Kumar M <mohan@in.ibm.com>
Fri, 12 Dec 2008 03:31:38 +0000 (03:31 +0000)
committerTony Breeds <tony@bakeyournoodle.com>
Wed, 11 Feb 2009 23:43:56 +0000 (10:43 +1100)
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>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
second/yaboot.c

index d6e8017bae35b01be0ab916ae0eef588b8a3472f..3db7b4fe03f04b42c67adb703748246dcb37a066 100644 (file)
@@ -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_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);
 }
 
             e->e_machine         == EM_PPC64);
 }