blackfin / h8300 build error fix
PATCH 1/1 blackfin / h8300 build error fix
init/main.c:781: undefined reference to `___early_initcall_end'
--- include/asm-generic/vmlinux.lds.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/asm-generic/vmlinux.lds.h +1 -1
@@ -362,7 +362,7 @@#define INITCALLS \ *(.initcallearly.init) \ - __early_initcall_end = .; \ + VMLINUX_SYMBOL(__early_initcall_end) = .; \ *(.initcall0.init) \ *(.initcall0s.init) \ *(.initcall1.init) \
Signature · 5 lines
1.5.6.3 -- Yoshinori Sato <[email protected]>
Quoted 22 lines · Yoshinori Sato
init/main.c:781: undefined reference to `___early_initcall_end'Signed-off-by Yoshinori Sato <[email protected]>--- include/asm-generic/vmlinux.lds.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)include/asm-generic/vmlinux.lds.h +1
-2@@ -362,7 +362,7 @@#define INITCALLS \ *(.initcallearly.init) \ - __early_initcall_end = .; \ + VMLINUX_SYMBOL(__early_initcall_end) = .; \ *(.initcall0.init) \ *(.initcall0s.init) \ *(.initcall1.init) \ --
Quoted 1 line
1.5.6.3
nice catch, thanks ... looks like BUG_TABLE, TRACEDATA, and PERCPU are also broken, but blackfin/etc... arent using those which is why we havent noticed yet ...
-mike
At Wed, 30 Jul 2008 12:11:37 -0400,
Quoted 16 lines · Mike Frysinger
Quoted 14 lines · Yoshinori Sato
init/main.c:781: undefined reference to `___early_initcall_end'Signed-off-by Yoshinori Sato <[email protected]>--- include/asm-generic/vmlinux.lds.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)include/asm-generic/vmlinux.lds.h +0
-0@@ -362,7 +362,7 @@
Quoted 14 lines
Quoted 9 lines
include/asm-generic/vmlinux.lds.h +1
-2#define INITCALLS \ *(.initcallearly.init) \ - __early_initcall_end = .; \ + VMLINUX_SYMBOL(__early_initcall_end) = .; \ *(.initcall0.init) \ *(.initcall0s.init) \ *(.initcall1.init) \ --1.5.6.3
nice catch, thanks ... looks like
BUG_TABLE, TRACEDATA, and PERCPU are also broken, but blackfin/etc... arent using those which is why we havent noticed yet ...
-mike
Thanks.
I fixed same.
include/asm-generic/vmlinux.lds.h | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
include/asm-generic/vmlinux.lds.h +7 -7
@@ -333,9 +333,9 @@#define BUG_TABLE \ . = ALIGN(8); \ __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \ - __start___bug_table = .; \ + VMLINUX_SYMBOL(__start___bug_table) = .; \ *(__bug_table) \ - __stop___bug_table = .; \ + VMLINUX_SYMBOL(__stop___bug_table) = .; \ }#else #define BUG_TABLE
@@ -345,9 +345,9 @@#define TRACEDATA \ . = ALIGN(4); \ .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) { \ - __tracedata_start = .; \ + VMLINUX_SYMBOL(__tracedata_start) = .; \ *(.tracedata) \ - __tracedata_end = .; \ + VMLINUX_SYMBOL(__tracedata_end) = .; \ }#else #define TRACEDATA
@@ -362,7 +362,7 @@#define INITCALLS \ *(.initcallearly.init) \ - __early_initcall_end = .; \ + VMLINUX_SYMBOL(__early_initcall_end) = .; \ *(.initcall0.init) \ *(.initcall0s.init) \ *(.initcall1.init) \
@@ -383,9 +383,9 @@#define PERCPU (align) \ . = ALIGN(align); \ - __per_cpu_start = .; \ + VMLINUX_SYMBOL(__per_cpu_start) = .; \ .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \ *(.data.percpu) \ *(.data.percpu.shared_aligned) \ } \ - __per_cpu_end = .; + VMLINUX_SYMBOL(__per_cpu_end) = .;
Signature · 5 lines
1.5.6.3 -- Yoshinori Sato <[email protected]>
Quoted 46 lines · On Wed, 30 Jul 2008 15:22:38 -0400 Yoshinori Sato <[email protected]>…
At Wed, 30 Jul 2008 12:11:37 -0400,
Quoted 16 lines · Mike Frysinger
Quoted 14 lines · Yoshinori Sato
init/main.c:781: undefined reference to `___early_initcall_end'Signed-off-by Yoshinori Sato <[email protected]>--- include/asm-generic/vmlinux.lds.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)include/asm-generic/vmlinux.lds.h +0
-0@@ -362,7 +362,7 @@Quoted 14 lines
Quoted 9 lines
include/asm-generic/vmlinux.lds.h +1
-2#define INITCALLS \ *(.initcallearly.init) \ - __early_initcall_end = .; \ + VMLINUX_SYMBOL(__early_initcall_end) = .; \ *(.initcall0.init) \ *(.initcall0s.init) \ *(.initcall1.init) \ --1.5.6.3
nice catch, thanks ... looks like
BUG_TABLE, TRACEDATA, and PERCPU are also broken, but blackfin/etc... arent using those which is why we havent noticed yet ...
-mikeThanks.
I fixed same.Signed-off-by Yoshinori Sato <[email protected]>include/asm-generic/vmlinux.lds.h | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)include/asm-generic/vmlinux.lds.h +0
-0
include/asm-generic/vmlinux.lds.h line 339
Quoted 9 lines
include/asm-generic/vmlinux.lds.h +2
-2@@ -333,9 +333,9 @@#define BUG_TABLE \ . = ALIGN(8); \ __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \ - __start___bug_table = .; \ + VMLINUX_SYMBOL(__start___bug_table) = .; \ *(__bug_table) \ - __stop___bug_table = .; \ + VMLINUX_SYMBOL(__stop___bug_table) = .; \ }
Sorry, but I haven't been following this topic very well and I rather dislike plucking unchangelogged patches out of the middle of email discussions.
If there's some patch which I should be applying then please resend it, with a meaningful title, a description of what it does, etc.
Thanks.
Re: [PATCH] Missing symbol prefix on vmlinux.lds.h
Sorry.
I got error ARCH=h8300.init/main.c:781: undefined reference to `___early_initcall_end'
Same problem have__start___bug_table__stop___bug_table__tracedata_start__tracedata_end__per_cpu_start__per_cpu_end
If define symbol in vmlinux.lds, Use VMLINUX_SYMBOL macro. VMLINUX_SYMBOL is add prefix charactor.
--- include/asm-generic/vmlinux.lds.h | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
include/asm-generic/vmlinux.lds.h +7 -7
@@ -333,9 +333,9 @@#define BUG_TABLE \ . = ALIGN(8); \ __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \ - __start___bug_table = .; \ + VMLINUX_SYMBOL(__start___bug_table) = .; \ *(__bug_table) \ - __stop___bug_table = .; \ + VMLINUX_SYMBOL(__stop___bug_table) = .; \ }#else #define BUG_TABLE
@@ -345,9 +345,9 @@#define TRACEDATA \ . = ALIGN(4); \ .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) { \ - __tracedata_start = .; \ + VMLINUX_SYMBOL(__tracedata_start) = .; \ *(.tracedata) \ - __tracedata_end = .; \ + VMLINUX_SYMBOL(__tracedata_end) = .; \ }#else #define TRACEDATA
@@ -362,7 +362,7 @@#define INITCALLS \ *(.initcallearly.init) \ - __early_initcall_end = .; \ + VMLINUX_SYMBOL(__early_initcall_end) = .; \ *(.initcall0.init) \ *(.initcall0s.init) \ *(.initcall1.init) \
@@ -383,9 +383,9 @@#define PERCPU (align) \ . = ALIGN(align); \ - __per_cpu_start = .; \ + VMLINUX_SYMBOL(__per_cpu_start) = .; \ .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \ *(.data.percpu) \ *(.data.percpu.shared_aligned) \ } \ - __per_cpu_end = .; + VMLINUX_SYMBOL(__per_cpu_end) = .;
Signature · 5 lines
1.5.6.3 -- Yoshinori Sato <[email protected]>
Re: [PATCH] Missing symbol prefix on vmlinux.lds.h
Quoted 28 lines · On Wed, 30 Jul 2008 20:26:24 -0400 Yoshinori Sato <[email protected]>…
Sorry.
I got error ARCH=h8300.
init/main.c:781: undefined reference to `___early_initcall_end'Same problem have
__start___bug_table__stop___bug_table__tracedata_start__tracedata_end__per_cpu_start__per_cpu_endIf define symbol in
vmlinux.lds, UseVMLINUX_SYMBOLmacro.VMLINUX_SYMBOLis add prefix charactor.Signed-off-by Yoshinori Sato <[email protected]>--- include/asm-generic/vmlinux.lds.h | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)include/asm-generic/vmlinux.lds.h +0
-0@@ -333,9 +333,9 @@#define BUG_TABLE \
include/asm-generic/vmlinux.lds.h line 341
Quoted 10 lines
include/asm-generic/vmlinux.lds.h +2
-2. = ALIGN(8); \ __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \ - __start___bug_table = .; \ + VMLINUX_SYMBOL(__start___bug_table) = .; \ *(__bug_table ) \ - __stop___bug_table = .; \ + VMLINUX_SYMBOL(__stop___bug_table) = .; \ }#else #define BUG_TABLE
Strange. The code you're fixing there was added by
commit 7664c5a1da4711bb6383117f51b94c8dc8f3f1cd
Author: Jeremy Fitzhardinge <[email protected]>
Date: Fri Dec 8 02:36:19 2006 -0800
[PATCH] Generic BUG implementation
over a year ago. I doubt if h8300 has been broken for that long, so something else must have triggered this failure.
Do you know what it was?
Re: [PATCH] Missing symbol prefix on vmlinux.lds.h
At Wed, 30 Jul 2008 19:06:59 -0700,
Quoted 48 lines · Andrew Morton
Quoted 28 lines · On Wed, 30 Jul 2008 20:26:24 -0400 Yoshinori Sato <[email protected]>…
Sorry.
I got error ARCH=h8300.
init/main.c:781: undefined reference to `___early_initcall_end'Same problem have
__start___bug_table__stop___bug_table__tracedata_start__tracedata_end__per_cpu_start__per_cpu_endIf define symbol in
vmlinux.lds, UseVMLINUX_SYMBOLmacro.VMLINUX_SYMBOLis add prefix charactor.Signed-off-by Yoshinori Sato <[email protected]>--- include/asm-generic/vmlinux.lds.h | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)include/asm-generic/vmlinux.lds.h +0
-0@@ -333,9 +333,9 @@#define BUG_TABLE \include/asm-generic/vmlinux.lds.h line 341
Quoted 10 lines
include/asm-generic/vmlinux.lds.h +2
-2. = ALIGN(8); \ __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \ - __start___bug_table = .; \ + VMLINUX_SYMBOL(__start___bug_table) = .; \ *(__bug_table ) \ - __stop___bug_table = .; \ + VMLINUX_SYMBOL(__stop___bug_table) = .; \ }#else #define BUG_TABLE Strange. The code you're fixing there was added by
commit
7664c5a1da4711bb6383117f51b94c8dc8f3f1cd
Author: Jeremy Fitzhardinge <[email protected]>
Date: Fri Dec 8 02:36:19 2006 -0800
Quoted 7 lines
[PATCH] Generic BUG implementation
over a year ago. I doubt if h8300 has been broken for that long, so something else must have triggered this failure.
Do you know what it was?
I don't know.
Check it.
Signature · 2 lines
Yoshinori Sato <[email protected]>
Quoted 59 lines · Andrew Morton
Quoted 44 lines · On Wed, 30 Jul 2008 15:22:38 -0400 Yoshinori Sato wrote:
Quoted 15 lines · At Wed, 30 Jul 2008 12:11:37 -0400 Mike Frysinger wrote:
Quoted 14 lines · Yoshinori Sato
init/main.c:781: undefined reference to `___early_initcall_end'Signed-off-by Yoshinori Sato <[email protected]>--- include/asm-generic/vmlinux.lds.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)include/asm-generic/vmlinux.lds.h +0
-0@@ -362,7 +362,7 @@Quoted 14 lines
Quoted 9 lines
include/asm-generic/vmlinux.lds.h +1
-2#define INITCALLS \ *(.initcallearly.init) \ - __early_initcall_end = .; \ + VMLINUX_SYMBOL(__early_initcall_end) = .; \ *(.initcall0.init) \ *(.initcall0s.init) \ *(.initcall1.init) \ --1.5.6.3
nice catch, thanks ... looks like
BUG_TABLE, TRACEDATA, and PERCPU are also broken, but blackfin/etc... arent using those which is why we havent noticed yet ...
-mikeThanks.
I fixed same.Signed-off-by Yoshinori Sato <[email protected]>include/asm-generic/vmlinux.lds.h | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)include/asm-generic/vmlinux.lds.h +0
-0include/asm-generic/vmlinux.lds.h line 339
Quoted 9 lines
include/asm-generic/vmlinux.lds.h +2
-2@@ -333,9 +333,9 @@#define BUG_TABLE \ . = ALIGN(8); \ __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \ - __start___bug_table = .; \ + VMLINUX_SYMBOL(__start___bug_table) = .; \ *(__bug_table) \ - __stop___bug_table = .; \ + VMLINUX_SYMBOL(__stop___bug_table) = .; \ }Sorry, but I haven't been following this topic very well and I rather dislike plucking unchangelogged patches out of the middle of email discussions.
Quoted 2 lines
If there's some patch which I should be applying then please resend it, with a meaningful title, a description of what it does, etc.
i thought the fix was self-evident ;)
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.
-mike
Quoted 6 lines · On Wed, 30 Jul 2008 23:26:47 -0400 "Mike Frysinger" <[email protected]>…
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.hneed to be wrapped inVMLINUX_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:
include/asm-generic/vmlinux.lds.h renamed from include/asm-generic/vmlinux.lds.h~zero-based-percpu-use-vmlinux_symbol-in-include-asm-generic-vmlinuxldsh +4 -4
@@ -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().
Quoted 8 lines · Andrew Morton
Quoted 6 lines · On Wed, 30 Jul 2008 23:26:47 -0400 "Mike Frysinger" 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.hneed to be wrapped inVMLINUX_SYMBOL()so that each arch can put hide this magic in their own files.
Quoted 4 lines
ooh, a changelog.
This seems to be a pretty common failing. I just had to fix the same problem in a linux-next patch:
PERCPU is broken in mainline currently as well ... but it looks like there's extended stuff in linux-next now
Quoted 2 lines
It's going to keep happening too, unless we find some way of making x86 break when people forget to use
VMLINUX_SYMBOL().
i pondered it briefly when i saw Yoshinori's original e-mail, but nothing pretty came to mind
-mike