LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [patch] FLAT binaries: drop BINFMT_FLAT bad header magic warning
@ 2008-02-11 17:35 Mike Frysinger
  2008-02-13  2:13 ` Greg Ungerer
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2008-02-11 17:35 UTC (permalink / raw)
  To: gerg; +Cc: linux-kernel, bernds_cb1

The warning issued by fs/binfmt_flat.c when the format handler is given a
non-FLAT and non-script executable is annoying to say the least when working
with FDPIC ELF objects.  If you build a kernel that supports both FLAT and
FDPIC ELFs on no-mmu, every time you execute an FDPIC ELF, the kernel spits
out this message.  While I understand a lot of newcomers to the no-mmu world
screw up generation of FLAT binaries, this warning is not usable for systems
that support more than just FLAT.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Bernd Schmidt <bernds_cb1@t-online.de>
CC: Greg Ungerer <gerg@snapgear.com>
---
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index d8a02f1..0498b18 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -443,12 +443,12 @@ static int load_flat_file(struct linux_binprm * bprm,
 
 	if (strncmp(hdr->magic, "bFLT", 4)) {
 		/*
+		 * Previously, here was a printk to tell people
+		 *   "BINFMT_FLAT: bad header magic".
+		 * But for the kernel which also use ELF FD-PIC format, this
+		 * error message is confusing.
 		 * because a lot of people do not manage to produce good
-		 * flat binaries,  we leave this printk to help them realise
-		 * the problem.  We only print the error if its not a script file
 		 */
-		if (strncmp(hdr->magic, "#!", 2))
-			printk("BINFMT_FLAT: bad header magic\n");
 		ret = -ENOEXEC;
 		goto err;
 	}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] FLAT binaries: drop BINFMT_FLAT bad header magic warning
  2008-02-11 17:35 [patch] FLAT binaries: drop BINFMT_FLAT bad header magic warning Mike Frysinger
@ 2008-02-13  2:13 ` Greg Ungerer
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Ungerer @ 2008-02-13  2:13 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: linux-kernel, bernds_cb1


Mike Frysinger wrote:
> The warning issued by fs/binfmt_flat.c when the format handler is given a
> non-FLAT and non-script executable is annoying to say the least when working
> with FDPIC ELF objects.  If you build a kernel that supports both FLAT and
> FDPIC ELFs on no-mmu, every time you execute an FDPIC ELF, the kernel spits
> out this message.  While I understand a lot of newcomers to the no-mmu world
> screw up generation of FLAT binaries, this warning is not usable for systems
> that support more than just FLAT.

I don't have a problem with this.

Acked-by: Greg Ungerer <gerg@snapgear.com>


> Signed-off-by: Jie Zhang <jie.zhang@analog.com>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> CC: Bernd Schmidt <bernds_cb1@t-online.de>
> CC: Greg Ungerer <gerg@snapgear.com>
> ---
> diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
> index d8a02f1..0498b18 100644
> --- a/fs/binfmt_flat.c
> +++ b/fs/binfmt_flat.c
> @@ -443,12 +443,12 @@ static int load_flat_file(struct linux_binprm * bprm,
>  
>  	if (strncmp(hdr->magic, "bFLT", 4)) {
>  		/*
> +		 * Previously, here was a printk to tell people
> +		 *   "BINFMT_FLAT: bad header magic".
> +		 * But for the kernel which also use ELF FD-PIC format, this
> +		 * error message is confusing.
>  		 * because a lot of people do not manage to produce good
> -		 * flat binaries,  we leave this printk to help them realise
> -		 * the problem.  We only print the error if its not a script file
>  		 */
> -		if (strncmp(hdr->magic, "#!", 2))
> -			printk("BINFMT_FLAT: bad header magic\n");
>  		ret = -ENOEXEC;
>  		goto err;
>  	}
> 

-- 
------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     gerg@snapgear.com
Secure Computing Corporation                PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-13  2:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-11 17:35 [patch] FLAT binaries: drop BINFMT_FLAT bad header magic warning Mike Frysinger
2008-02-13  2:13 ` Greg Ungerer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).