diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2016-05-23 19:22:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-23 20:04:14 -0400 |
commit | f43edca7ed08fc02279f2a62015da5cb6aa0ad61 (patch) | |
tree | fe1204e7c7a65ee6c623532aff17779a5b6d07b8 /fs/Kconfig.binfmt | |
parent | ededb49a9aa54960fce35c705d505d409f5b5483 (diff) |
ELF/MIPS build fix
CONFIG_MIPS32_N32=y but CONFIG_BINFMT_ELF disabled results in the
following linker errors:
arch/mips/built-in.o: In function `elf_core_dump':
binfmt_elfn32.c:(.text+0x23dbc): undefined reference to `elf_core_extra_phdrs'
binfmt_elfn32.c:(.text+0x246e4): undefined reference to `elf_core_extra_data_size'
binfmt_elfn32.c:(.text+0x248d0): undefined reference to `elf_core_write_extra_phdrs'
binfmt_elfn32.c:(.text+0x24ac4): undefined reference to `elf_core_write_extra_data'
CONFIG_MIPS32_O32=y but CONFIG_BINFMT_ELF disabled results in the following
linker errors:
arch/mips/built-in.o: In function `elf_core_dump':
binfmt_elfo32.c:(.text+0x28a04): undefined reference to `elf_core_extra_phdrs'
binfmt_elfo32.c:(.text+0x29330): undefined reference to `elf_core_extra_data_size'
binfmt_elfo32.c:(.text+0x2951c): undefined reference to `elf_core_write_extra_phdrs'
binfmt_elfo32.c:(.text+0x29710): undefined reference to `elf_core_write_extra_data'
This is because binfmt_elfn32 and binfmt_elfo32 are using symbols from
elfcore but for these configurations elfcore will not be built.
Fixed by making elfcore selectable by a separate config symbol which
unlike the current mechanism can also be used from other directories
than kernel/, then having each flavor of ELF that relies on elfcore.o,
select it in Kconfig, including CONFIG_MIPS32_N32 and CONFIG_MIPS32_O32
which fixes this issue.
Link: http://lkml.kernel.org/r/20160520141705.GA1913@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Cc: "Maciej W. Rozycki" <macro@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/Kconfig.binfmt')
-rw-r--r-- | fs/Kconfig.binfmt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt index 2d0cbbd14cfc..72c03354c14b 100644 --- a/fs/Kconfig.binfmt +++ b/fs/Kconfig.binfmt | |||
@@ -1,6 +1,7 @@ | |||
1 | config BINFMT_ELF | 1 | config BINFMT_ELF |
2 | bool "Kernel support for ELF binaries" | 2 | bool "Kernel support for ELF binaries" |
3 | depends on MMU && (BROKEN || !FRV) | 3 | depends on MMU && (BROKEN || !FRV) |
4 | select ELFCORE | ||
4 | default y | 5 | default y |
5 | ---help--- | 6 | ---help--- |
6 | ELF (Executable and Linkable Format) is a format for libraries and | 7 | ELF (Executable and Linkable Format) is a format for libraries and |
@@ -26,6 +27,7 @@ config BINFMT_ELF | |||
26 | config COMPAT_BINFMT_ELF | 27 | config COMPAT_BINFMT_ELF |
27 | bool | 28 | bool |
28 | depends on COMPAT && BINFMT_ELF | 29 | depends on COMPAT && BINFMT_ELF |
30 | select ELFCORE | ||
29 | 31 | ||
30 | config ARCH_BINFMT_ELF_STATE | 32 | config ARCH_BINFMT_ELF_STATE |
31 | bool | 33 | bool |
@@ -34,6 +36,7 @@ config BINFMT_ELF_FDPIC | |||
34 | bool "Kernel support for FDPIC ELF binaries" | 36 | bool "Kernel support for FDPIC ELF binaries" |
35 | default y | 37 | default y |
36 | depends on (FRV || BLACKFIN || (SUPERH32 && !MMU) || C6X) | 38 | depends on (FRV || BLACKFIN || (SUPERH32 && !MMU) || C6X) |
39 | select ELFCORE | ||
37 | help | 40 | help |
38 | 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 |
39 | segments of a binary to be located in memory independently of each | 42 | segments of a binary to be located in memory independently of each |
@@ -43,6 +46,11 @@ config BINFMT_ELF_FDPIC | |||
43 | 46 | ||
44 | It is also possible to run FDPIC ELF binaries on MMU linux also. | 47 | It is also possible to run FDPIC ELF binaries on MMU linux also. |
45 | 48 | ||
49 | config ELFCORE | ||
50 | bool | ||
51 | help | ||
52 | This option enables kernel/elfcore.o. | ||
53 | |||
46 | config CORE_DUMP_DEFAULT_ELF_HEADERS | 54 | config CORE_DUMP_DEFAULT_ELF_HEADERS |
47 | bool "Write ELF core dumps with partial segments" | 55 | bool "Write ELF core dumps with partial segments" |
48 | default y | 56 | default y |