Re: [PATCH] blackfin / h8300 build error fix

From: Andrew Morton
Date: Wed Jul 30 2008 - 23:38:33 EST


On Wed, 30 Jul 2008 23:26:47 -0400 "Mike Frysinger" <vapier.adi@xxxxxxxxx> wrote:

> you cant just use straight symbol names in common header files as they
> dont take into consideration weird arch-specific ABI conventions. in
> the case of Blackfin/h8300, the ABI dictates that any C-visible
> symbols have an underscore prefixed to them. thus all symbols in
> vmlinux.lds.h need to be wrapped in VMLINUX_SYMBOL() so that each arch
> can put hide this magic in their own files.

ooh, a changelog.

This seems to be a pretty common failing. I just had to fix the same
problem in a linux-next patch:

diff -puN include/asm-generic/vmlinux.lds.h~zero-based-percpu-use-vmlinux_symbol-in-include-asm-generic-vmlinuxldsh include/asm-generic/vmlinux.lds.h
--- a/include/asm-generic/vmlinux.lds.h~zero-based-percpu-use-vmlinux_symbol-in-include-asm-generic-vmlinuxldsh
+++ a/include/asm-generic/vmlinux.lds.h
@@ -385,15 +385,15 @@
#define PERCPU(align) \
. = ALIGN(align); \
percpu : { } :percpu \
- __per_cpu_load = .; \
- .data.percpu 0 : AT(__per_cpu_load - LOAD_OFFSET) { \
+ VMLINUX_SYMBOL(__per_cpu_load) = .; \
+ .data.percpu 0 : AT(VMLINUX_SYMBOL(__per_cpu_load) - LOAD_OFFSET) { \
*(.data.percpu.first) \
*(.data.percpu.shared_aligned) \
*(.data.percpu) \
*(.data.percpu.page_aligned) \
- ____per_cpu_size = .; \
+ VMLINUX_SYMBOL(____per_cpu_size) = .; \
} \
- . = __per_cpu_load + ____per_cpu_size; \
+ . = VMLINUX_SYMBOL(__per_cpu_load) + VMLINUX_SYMBOL(____per_cpu_size); \
data : { } :data
#else
#define PERCPU(align) \
_

(haven't tested it yet).

It's going to keep happening too, unless we find some way of making x86
break when people forget to use VMLINUX_SYMBOL().
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/