Skip to content

Commit

Permalink
kbuild: add symbol prefix arg to kallsyms
Browse files Browse the repository at this point in the history
Commit 1f2bfbd ("kbuild: link of
vmlinux moved to a script") introduced in v3.5-rc1 broke kallsyms on
architectures which have symbol prefixes.

The --symbol-prefix argument used to be added to the KALLSYMS command
line from the architecture Makefile, however this isn't picked up by the
new scripts/link-vmlinux.sh. This resulted in symbols like
kallsyms_addresses being added which weren't correctly overriding the
weak symbols such as _kallsyms_addresses. These could then trigger
BUG_ONs in kallsyms code.

This is fixed by removing the KALLSYMS addition from the architecture
Makefile, and using CONFIG_SYMBOL_PREFIX in the link-vmlinux.sh script
to determine whether to add the --symbol-prefix argument.

Signed-off-by: James Hogan <[email protected]>
Signed-off-by: Bob Liu <[email protected]>
  • Loading branch information
amalon authored and aet00 committed Sep 11, 2012
1 parent 5088846 commit 6895f97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion arch/blackfin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ endif
KBUILD_AFLAGS += $(call cc-option,-mno-fdpic)
KBUILD_CFLAGS_MODULE += -mlong-calls
LDFLAGS += -m elf32bfin
KALLSYMS += --symbol-prefix=_

KBUILD_DEFCONFIG := BF537-STAMP_defconfig

Expand Down
7 changes: 6 additions & 1 deletion scripts/link-vmlinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,13 @@ kallsyms()
info KSYM ${2}
local kallsymopt;

if [ -n "${CONFIG_SYMBOL_PREFIX}" ]; then
kallsymopt="${kallsymopt} \
--symbol-prefix=${CONFIG_SYMBOL_PREFIX}"
fi

if [ -n "${CONFIG_KALLSYMS_ALL}" ]; then
kallsymopt=--all-symbols
kallsymopt="${kallsymopt} --all-symbols"
fi

local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \
Expand Down

0 comments on commit 6895f97

Please sign in to comment.