Skip to content

Commit ec758f9

Browse files
committed
parisc: add CONFIG_MLONGCALLS option to enable linkage of huge vmlinux executables
When building a 64bit kernel which includes all necessary drivers and filesystems the vmlinux kernel often gets so huge, that the linker won't be able to resolve the branch stubs. This patch overcomes this limit by providing an option to compile the kernel with the -mlong-calls compiler option. Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 1c4c659 commit ec758f9

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

‎arch/parisc/Kconfig‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,23 @@ config PREFETCH
161161
def_bool y
162162
depends on PA8X00 || PA7200
163163

164+
config MLONGCALLS
165+
bool "Enable the -mlong-calls compiler option for big kernels"
166+
def_bool y if (!MODULES)
167+
depends on PA8X00
168+
help
169+
If you configure the kernel to include many drivers built-in instead
170+
as modules, the kernel executable may become too big, so that the
171+
linker will not be able to resolve some long branches and fails to link
172+
your vmlinux kernel. In that case enabling this option will help you
173+
to overcome this limit by using the -mlong-calls compiler option.
174+
175+
Usually you want to say N here, unless you e.g. want to build
176+
a kernel which includes all necessary drivers built-in and which can
177+
be used for TFTP booting without the need to have an initrd ramdisk.
178+
179+
Enabling this option will probably slow down your kernel.
180+
164181
config 64BIT
165182
bool "64-bit kernel"
166183
depends on PA8X00

‎arch/parisc/Makefile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ ifndef CONFIG_FUNCTION_TRACER
6464
cflags-y += -ffunction-sections
6565
endif
6666

67+
# Use long jumps instead of long branches (needed if your linker fails to
68+
# link a too big vmlinux executable)
69+
cflags-$(CONFIG_MLONGCALLS) += -mlong-calls
70+
6771
# select which processor to optimise for
6872
cflags-$(CONFIG_PA7100) += -march=1.1 -mschedule=7100
6973
cflags-$(CONFIG_PA7200) += -march=1.1 -mschedule=7200

0 commit comments

Comments
 (0)