binfmt_flat: use fixed size type for the on-disk format
authorChristoph Hellwig <hch@lst.de>
Thu, 13 Jun 2019 07:08:55 +0000 (09:08 +0200)
committerGreg Ungerer <gerg@kernel.org>
Sun, 23 Jun 2019 23:16:47 +0000 (09:16 +1000)
commit34b4664ac4824d6c7a8b29db24b18733df07b2f4
treeb94e0eccb77f806991a97477d09f30ff2ba91b1b
parent3f8b76a66e0d49e3afaba595b9762c126448e783
binfmt_flat: use fixed size type for the on-disk format

So far binfmt_flat has only been supported on 32-bit platforms, so the
variable size of the fields didn't matter.  But the upcoming RISC-V
nommu port supports 64-bit CPUs, and we now have a conflict between
the elf2flt creation tool that always uses 32-bit fields and the kernel
that uses (unsigned) long field.  Switch to the userspace view as the
rest of the binfmt_flat format is completely architecture neutral,
and binfmt_flat isn't the right binary format for huge executables to
start with.

While we're at it also ensure these fields are using __be types as
they big endian and are byte swapped when loaded.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
include/linux/flat.h