Skip to content

Commit 1d52dca

Browse files
Christoph HellwigGreg Ungerer
authored andcommitted
binfmt_flat: remove flat_old_ram_flag
Instead add a Kconfig variable that only h8300 selects. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
1 parent 02da283 commit 1d52dca

File tree

10 files changed

+6
-8
lines changed

10 files changed

+6
-8
lines changed

arch/arm/include/asm/flat.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <linux/uaccess.h>
1010

1111
#define flat_argvp_envp_on_stack() 1
12-
#define flat_old_ram_flag(flags) (flags)
1312

1413
static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags,
1514
u32 *addr, u32 *persistent)

arch/c6x/include/asm/flat.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <asm/unaligned.h>
66

77
#define flat_argvp_envp_on_stack() 0
8-
#define flat_old_ram_flag(flags) (flags)
98
static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags,
109
u32 *addr, u32 *persistent)
1110
{

arch/h8300/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
config H8300
33
def_bool y
44
select ARCH_32BIT_OFF_T
5+
select BINFMT_FLAT_OLD_ALWAYS_RAM
56
select GENERIC_ATOMIC64
67
select HAVE_UID16
78
select VIRT_TO_BUS

arch/h8300/include/asm/flat.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <asm/unaligned.h>
1010

1111
#define flat_argvp_envp_on_stack() 1
12-
#define flat_old_ram_flag(flags) 1
1312

1413
/*
1514
* on the H8 a couple of the relocations have an instruction in the

arch/m68k/include/asm/flat.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <linux/uaccess.h>
1010

1111
#define flat_argvp_envp_on_stack() 1
12-
#define flat_old_ram_flag(flags) (flags)
1312
static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags,
1413
u32 *addr, u32 *persistent)
1514
{

arch/microblaze/include/asm/flat.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <asm/unaligned.h>
1515

1616
#define flat_argvp_envp_on_stack() 0
17-
#define flat_old_ram_flag(flags) (flags)
1817

1918
/*
2019
* Microblaze works a little differently from other arches, because

arch/sh/include/asm/flat.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <asm/unaligned.h>
1313

1414
#define flat_argvp_envp_on_stack() 0
15-
#define flat_old_ram_flag(flags) (flags)
1615
static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags,
1716
u32 *addr, u32 *persistent)
1817
{

arch/xtensa/include/asm/flat.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <asm/unaligned.h>
66

77
#define flat_argvp_envp_on_stack() 0
8-
#define flat_old_ram_flag(flags) (flags)
98
static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags,
109
u32 *addr, u32 *persistent)
1110
{

fs/Kconfig.binfmt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ config BINFMT_FLAT
9797
help
9898
Support uClinux FLAT format binaries.
9999

100+
config BINFMT_FLAT_OLD_ALWAYS_RAM
101+
bool
102+
100103
config BINFMT_ZFLAT
101104
bool "Enable ZFLAT support"
102105
depends on BINFMT_FLAT

fs/binfmt_flat.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,8 @@ static int load_flat_file(struct linux_binprm *bprm,
488488
* fix up the flags for the older format, there were all kinds
489489
* of endian hacks, this only works for the simple cases
490490
*/
491-
if (rev == OLD_FLAT_VERSION && flat_old_ram_flag(flags))
491+
if (rev == OLD_FLAT_VERSION &&
492+
(flags || IS_ENABLED(CONFIG_BINFMT_FLAT_OLD_ALWAYS_RAM)))
492493
flags = FLAT_FLAG_RAM;
493494

494495
#ifndef CONFIG_BINFMT_ZFLAT

0 commit comments

Comments
 (0)