diff options
author | Paul Burton <paul.burton@mips.com> | 2018-11-08 00:14:09 +0100 |
---|---|---|
committer | Paul Burton <paul.burton@mips.com> | 2018-11-09 19:23:18 +0100 |
commit | ea6a37373f9aca4ecb98ea3a298fda57177ee6a5 (patch) | |
tree | 8a374d55b08308d32052936e3d30496d21da6acf /arch/mips/include/asm/elf.h | |
parent | MIPS: signal: Remove FP context support when CONFIG_MIPS_FP_SUPPORT=n (diff) | |
download | linux-ea6a37373f9aca4ecb98ea3a298fda57177ee6a5.tar.xz linux-ea6a37373f9aca4ecb98ea3a298fda57177ee6a5.zip |
MIPS: Avoid FP ELF checks when CONFIG_MIPS_FP_SUPPORT=n
When CONFIG_MIPS_FP_SUPPORT=n we don't support floating point, so we can
avoid needless checks of ELF headers specifying the FP ABI or NaN
encoding to use. Deselect CONFIG_ARCH_BINFMT_ELF_STATE in this case to
avoid the need for our arch_elf_pt_proc() & arch_check_elf() functions,
and stub out the mips_set_personality_nan() & mips_set_personality_fp()
functions such that SET_PERSONALITY() doesn't need to worry about any of
this.
Signed-off-by: Paul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/21011/
Cc: linux-mips@linux-mips.org
Diffstat (limited to 'arch/mips/include/asm/elf.h')
-rw-r--r-- | arch/mips/include/asm/elf.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h index 0eb1a75be105..f8f44b1a6cbb 100644 --- a/arch/mips/include/asm/elf.h +++ b/arch/mips/include/asm/elf.h @@ -481,6 +481,8 @@ struct linux_binprm; extern int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp); +#ifdef CONFIG_MIPS_FP_SUPPORT + struct arch_elf_state { int nan_2008; int fp_abi; @@ -497,19 +499,35 @@ struct arch_elf_state { .overall_fp_mode = -1, \ } -/* Whether to accept legacy-NaN and 2008-NaN user binaries. */ -extern bool mips_use_nan_legacy; -extern bool mips_use_nan_2008; - extern int arch_elf_pt_proc(void *ehdr, void *phdr, struct file *elf, bool is_interp, struct arch_elf_state *state); extern int arch_check_elf(void *ehdr, bool has_interpreter, void *interp_ehdr, struct arch_elf_state *state); +/* Whether to accept legacy-NaN and 2008-NaN user binaries. */ +extern bool mips_use_nan_legacy; +extern bool mips_use_nan_2008; + extern void mips_set_personality_nan(struct arch_elf_state *state); extern void mips_set_personality_fp(struct arch_elf_state *state); +#else /* !CONFIG_MIPS_FP_SUPPORT */ + +struct arch_elf_state; + +static inline void mips_set_personality_nan(struct arch_elf_state *state) +{ + /* no-op */ +} + +static inline void mips_set_personality_fp(struct arch_elf_state *state) +{ + /* no-op */ +} + +#endif /* !CONFIG_MIPS_FP_SUPPORT */ + #define elf_read_implies_exec(ex, stk) mips_elf_read_implies_exec(&(ex), stk) extern int mips_elf_read_implies_exec(void *elf_ex, int exstack); |