Skip to content

Commit

Permalink
binfmt_flat: provide a default version of flat_get_relocate_addr
Browse files Browse the repository at this point in the history
This way only the two architectures that do masking need to provide
the helper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Vladimir Murzin <vladimir.murzin@arm.com>
Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
  • Loading branch information
Christoph Hellwig authored and Greg Ungerer committed Jun 23, 2019
1 parent 2f3196d commit 02da283
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions arch/arm/include/asm/flat.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,4 @@ static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel)
#endif
}

#define flat_get_relocate_addr(rel) (rel)

#endif /* __ARM_FLAT_H__ */
1 change: 0 additions & 1 deletion arch/c6x/include/asm/flat.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel)
put_unaligned(addr, (__force u32 *)rp);
return 0;
}
#define flat_get_relocate_addr(rel) (rel)

#endif /* __ASM_C6X_FLAT_H */
1 change: 0 additions & 1 deletion arch/m68k/include/asm/flat.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel)
return put_user(addr, rp);
#endif
}
#define flat_get_relocate_addr(rel) (rel)

#define FLAT_PLAT_INIT(regs) \
do { \
Expand Down
1 change: 0 additions & 1 deletion arch/sh/include/asm/flat.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel)
put_unaligned(addr, (__force u32 *)rp);
return 0;
}
#define flat_get_relocate_addr(rel) (rel)

#define FLAT_PLAT_INIT(_r) \
do { _r->regs[0]=0; _r->regs[1]=0; _r->regs[2]=0; _r->regs[3]=0; \
Expand Down
1 change: 0 additions & 1 deletion arch/xtensa/include/asm/flat.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel)
put_unaligned(addr, (__force u32 *)rp);
return 0;
}
#define flat_get_relocate_addr(rel) (rel)

#endif /* __ASM_XTENSA_FLAT_H */
4 changes: 4 additions & 0 deletions fs/binfmt_flat.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
#include <asm/cacheflush.h>
#include <asm/page.h>

#ifndef flat_get_relocate_addr
#define flat_get_relocate_addr(rel) (rel)
#endif

/****************************************************************************/

/*
Expand Down

0 comments on commit 02da283

Please sign in to comment.