summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2017-08-11 00:53:39 -0400
committerNicolas Pitre <nicolas.pitre@linaro.org>2017-09-10 19:31:46 -0400
commit382e67aec6a7eea8ed4403e86950b468a191c468 (patch)
tree74be0a8304e29a5663419343a3cf62ac5b91ade7 /fs
parent50b2b2e691cd4ff30331ba9a6156b29a07b60f90 (diff)
ARM: enable elf_fdpic on systems with an MMU
Provide the necessary changes to be able to execute ELF-FDPIC binaries on ARM systems with an MMU. The default for CONFIG_BINFMT_ELF_FDPIC is also set to n if the regular ELF loader is already configured so not to force FDPIC support on everyone. Given that CONFIG_BINFMT_ELF depends on CONFIG_MMU, this means CONFIG_BINFMT_ELF_FDPIC will still default to y when !MMU. Signed-off-by: Nicolas Pitre <nico@linaro.org> Acked-by: Mickael GUENE <mickael.guene@st.com> Tested-by: Vincent Abriou <vincent.abriou@st.com> Tested-by: Andras Szemzo <szemzo.andras@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/Kconfig.binfmt4
-rw-r--r--fs/binfmt_elf_fdpic.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt
index 6ef70ce8e976..58c2bbd385ad 100644
--- a/fs/Kconfig.binfmt
+++ b/fs/Kconfig.binfmt
@@ -34,8 +34,8 @@ config ARCH_BINFMT_ELF_STATE
34 34
35config BINFMT_ELF_FDPIC 35config BINFMT_ELF_FDPIC
36 bool "Kernel support for FDPIC ELF binaries" 36 bool "Kernel support for FDPIC ELF binaries"
37 default y 37 default y if !BINFMT_ELF
38 depends on ((ARM && !MMU) || FRV || BLACKFIN || (SUPERH32 && !MMU) || C6X) 38 depends on (ARM || FRV || BLACKFIN || (SUPERH32 && !MMU) || C6X)
39 select ELFCORE 39 select ELFCORE
40 help 40 help
41 ELF FDPIC binaries are based on ELF, but allow the individual load 41 ELF FDPIC binaries are based on ELF, but allow the individual load
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index cf93a4fad012..692e2a1fd2bb 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -377,6 +377,11 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
377 executable_stack); 377 executable_stack);
378 if (retval < 0) 378 if (retval < 0)
379 goto error; 379 goto error;
380#ifdef ARCH_HAS_SETUP_ADDITIONAL_PAGES
381 retval = arch_setup_additional_pages(bprm, !!interpreter_name);
382 if (retval < 0)
383 goto error;
384#endif
380#endif 385#endif
381 386
382 /* load the executable and interpreter into memory */ 387 /* load the executable and interpreter into memory */