diff options
author | James Hogan <james@albanarts.com> | 2012-09-06 17:11:25 -0400 |
---|---|---|
committer | Bob Liu <lliubbo@gmail.com> | 2012-09-10 22:25:12 -0400 |
commit | 6895f97e15895625e03c95df904d92befdac7118 (patch) | |
tree | bf5a5902426ef3073e1d8812d5fdb3f93a888398 | |
parent | 50888469bda11bcff306893bbaff21f25894be0b (diff) |
kbuild: add symbol prefix arg to kallsyms
Commit 1f2bfbd00e466ff3489b2ca5cc75b1cccd14c123 ("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 <james.hogan@imgtec.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
-rw-r--r-- | arch/blackfin/Makefile | 1 | ||||
-rw-r--r-- | scripts/link-vmlinux.sh | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile index d3d7e64ca96..66cf00095b8 100644 --- a/arch/blackfin/Makefile +++ b/arch/blackfin/Makefile | |||
@@ -20,7 +20,6 @@ endif | |||
20 | KBUILD_AFLAGS += $(call cc-option,-mno-fdpic) | 20 | KBUILD_AFLAGS += $(call cc-option,-mno-fdpic) |
21 | KBUILD_CFLAGS_MODULE += -mlong-calls | 21 | KBUILD_CFLAGS_MODULE += -mlong-calls |
22 | LDFLAGS += -m elf32bfin | 22 | LDFLAGS += -m elf32bfin |
23 | KALLSYMS += --symbol-prefix=_ | ||
24 | 23 | ||
25 | KBUILD_DEFCONFIG := BF537-STAMP_defconfig | 24 | KBUILD_DEFCONFIG := BF537-STAMP_defconfig |
26 | 25 | ||
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 4629038c9e5..df48dda8a2d 100644 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh | |||
@@ -74,8 +74,13 @@ kallsyms() | |||
74 | info KSYM ${2} | 74 | info KSYM ${2} |
75 | local kallsymopt; | 75 | local kallsymopt; |
76 | 76 | ||
77 | if [ -n "${CONFIG_SYMBOL_PREFIX}" ]; then | ||
78 | kallsymopt="${kallsymopt} \ | ||
79 | --symbol-prefix=${CONFIG_SYMBOL_PREFIX}" | ||
80 | fi | ||
81 | |||
77 | if [ -n "${CONFIG_KALLSYMS_ALL}" ]; then | 82 | if [ -n "${CONFIG_KALLSYMS_ALL}" ]; then |
78 | kallsymopt=--all-symbols | 83 | kallsymopt="${kallsymopt} --all-symbols" |
79 | fi | 84 | fi |
80 | 85 | ||
81 | local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \ | 86 | local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \ |