diff options
author | Christoph Hellwig <[email protected]> | 2020-06-07 21:42:40 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2020-06-08 11:05:58 -0700 |
commit | 48304f7994d74ef8fddde3ff27ce41aa61453d39 (patch) | |
tree | 6cc168311b6600036c1f9595361018d644c4e05b | |
parent | a1e81f9654eef650d3ee35c94a8cab00b5cd379c (diff) |
exec: only build read_code when needed
Only build read_code when binary formats that use it are built into the
kernel.
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Cc: Alexander Viro <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | fs/exec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/exec.c b/fs/exec.c index 93ff1c4c7ebb..88260ec0ac34 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1053,6 +1053,8 @@ out: } EXPORT_SYMBOL_GPL(kernel_read_file_from_fd); +#if defined(CONFIG_HAVE_AOUT) || defined(CONFIG_BINFMT_FLAT) || \ + defined(CONFIG_BINFMT_ELF_FDPIC) ssize_t read_code(struct file *file, unsigned long addr, loff_t pos, size_t len) { ssize_t res = vfs_read(file, (void __user *)addr, len, &pos); @@ -1061,6 +1063,7 @@ ssize_t read_code(struct file *file, unsigned long addr, loff_t pos, size_t len) return res; } EXPORT_SYMBOL(read_code); +#endif /* * Maps the mm_struct mm into the current task struct. |