Skip to content

Commit

Permalink
FLAT binaries: drop BINFMT_FLAT bad header magic warning
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mike Frysinger <[email protected]>
Cc: Bernd Schmidt <[email protected]>
Acked-by: Greg Ungerer <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Mike Frysinger authored and Linus Torvalds committed Feb 15, 2008
1 parent 2cd9cdc commit e2a366d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/binfmt_flat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e2a366d

Please sign in to comment.