]> git.baikalelectronics.ru Git - kernel.git/commit
binfmt_elf: Hoist ELF program header loading to a function
authorPaul Burton <paul.burton@imgtec.com>
Thu, 11 Sep 2014 07:30:14 +0000 (08:30 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 24 Nov 2014 06:45:02 +0000 (07:45 +0100)
commit3ab84c0cee4533c4bf8d94c08a7eed6d6d688090
treec5e0bef527d102ca506e09685467e1577a2bacab
parent7d45e42f675c0dd61be427beac434d28d99b4e77
binfmt_elf: Hoist ELF program header loading to a function

load_elf_binary & load_elf_interp both load program headers from an ELF
executable in the same way, duplicating the code. This patch introduces
a helper function (load_elf_phdrs) which performs this common task &
calls it from both load_elf_binary & load_elf_interp. In addition to
reducing code duplication, this is part of preparing to load the ELF
interpreter headers earlier such that they can be examined before it's
too late to return an error from an exec syscall.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7676/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
fs/binfmt_elf.c