From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 26 Oct 2006 15:56:53 -0700 From: "Mark A. Greer" To: "Mark A. Greer" Subject: Re: [RFC] bootwrapper: prevent fdt from being overwritten by kernel Message-ID: <20061026225653.GA20233@mag.az.mvista.com> References: <20061026225045.GA19839@mag.az.mvista.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20061026225045.GA19839@mag.az.mvista.com> Cc: linuxppc-dev , Paul Mackerras List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thu, Oct 26, 2006 at 03:50:45PM -0700, Mark A. Greer wrote: > diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c > index 234bb5b..4927c17 100644 > --- a/arch/powerpc/boot/main.c > +++ b/arch/powerpc/boot/main.c > @@ -169,7 +169,7 @@ static int is_elf32(void *hdr) > return 1; > } > > -static void prep_kernel(unsigned long *a1, unsigned long *a2) > +static void get_elfheader(void) > { > int len; > > @@ -186,11 +186,13 @@ static void prep_kernel(unsigned long *a > sizeof(elfheader)); > > if (!is_elf64(elfheader) && !is_elf32(elfheader)) { > - printf("Error: not a valid PPC32 or PPC64 ELF file!\n\r"); > exit(); > } > - if (platform_ops.image_hdr) > - platform_ops.image_hdr(elfheader); > +} > + > +static void prep_kernel(unsigned long *a1, unsigned long *a2) > +{ > + int len; Oops, the "if (!is_elf64(elfheader) && !is_elf32(elfheader)) {" check should stay in prep_kernel. Mark