Commit 5d7d18f5 authored by David Howells's avatar David Howells Committed by Sam Ravnborg

kbuild: make it possible for the linker to discard local symbols from vmlinux

Make it possible for the linker to discard local symbols from vmlinux as
they cause vmlinux to balloon when CONFIG_KALLSYMS=y and they cause
dump_stack() and get_wchan() to produce useless information under some
circumstances.

With this we add a config option (CONFIG_STRIP_ASM_SYMS) that will cause
the build to supply -X to the linker to tell it to strip temporary local
symbols.

This doesn't seem to cause gdb any problems.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 0fa3a88c
...@@ -597,6 +597,10 @@ LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ ...@@ -597,6 +597,10 @@ LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
LDFLAGS_vmlinux += -X
endif
# Default kernel image to build when no specific target is given. # Default kernel image to build when no specific target is given.
# KBUILD_IMAGE may be overruled on the command line or # KBUILD_IMAGE may be overruled on the command line or
# set in the environment # set in the environment
......
...@@ -808,6 +808,14 @@ config KALLSYMS_EXTRA_PASS ...@@ -808,6 +808,14 @@ config KALLSYMS_EXTRA_PASS
you wait for kallsyms to be fixed. you wait for kallsyms to be fixed.
config STRIP_ASM_SYMS
bool "Strip assembler-generated symbols during link"
default n
help
Strip internal assembler-generated symbols during a link (symbols
that look like '.Lxxx') so they don't pollute the output of
get_wchan() and suchlike.
config HOTPLUG config HOTPLUG
bool "Support for hot-pluggable devices" if EMBEDDED bool "Support for hot-pluggable devices" if EMBEDDED
default y default y
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment