arm64: fix undefined reference to 'printk'
PATCH 1/1 arm64: fix undefined reference to 'printk'
The printk symbol was intended as a generic address that is always exported, however that turned out to be false with CONFIG_PRINTK=n:
ERROR: "printk" [arch/arm64/kernel/arm64-reloc-test.ko] undefined!
This changes the references to memstart_addr, which should be there regardless of configuration.
Ard Biesheuvel <[email protected]>
--- arch/arm64/kernel/reloc_test_core.c | 2 +- arch/arm64/kernel/reloc_test_syms.S | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/kernel/reloc_test_core.c +1 -1
@@ -45,7 +45,7 @@ static struct { { "R_AARCH64_MOVW_SABS_Gn", signed_movw, UL(SYM64_ABS_VAL) }, { "R_AARCH64_MOVW_UABS_Gn", unsigned_movw, UL(SYM64_ABS_VAL) }, { "R_AARCH64_ADR_PREL_PG_HI21", relative_adrp, (u64)&sym64_rel }, - { "R_AARCH64_ADR_PREL_PG_HI21", relative_adrp_far, (u64)&printk }, + { "R_AARCH64_ADR_PREL_PG_HI21", relative_adrp_far, (u64)&memstart_addr }, { "R_AARCH64_ADR_PREL_LO21", relative_adr, (u64)&sym64_rel }, { "R_AARCH64_PREL64", relative_data64, (u64)&sym64_rel }, { "R_AARCH64_PREL32", relative_data32, (u64)&sym64_rel },
arch/arm64/kernel/reloc_test_syms.S +2 -2
@@ -54,8 +54,8 @@ ENDPROC(relative_adrp) .align 12 .space 0xffc ENTRY(relative_adrp_far) - adrp x0, printk - add x0, x0, #:lo12:printk + adrp x0, memstart_addr + add x0, x0, #:lo12:memstart_addr ret ENDPROC(relative_adrp_far)
Signature · 1 line
2.9.0
Quoted 10 lines · Arnd Bergmann
The printk symbol was intended as a generic address that is always exported, however that turned out to be false with
CONFIG_PRINTK=n:ERROR: "printk" [
arch/arm64/kernel/arm64-reloc-test.ko] undefined!This changes the references to
memstart_addr, which should be there regardless of configuration.Fixes a257e02579e4 ("arm64/kernel: don't ban ADRP to work around Cortex-A53 erratum #843419")Ard Biesheuvel <[email protected]>
Quoted 37 lines
Signed-off-by Arnd Bergmann <[email protected]>--- arch/arm64/kernel/reloc_test_core.c | 2 +- arch/arm64/kernel/reloc_test_syms.S | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)arch/arm64/kernel/reloc_test_core.c +1
-1@@ -45,7 +45,7 @@ static struct { { "R_AARCH64_MOVW_SABS_Gn", signed_movw, UL(SYM64_ABS_VAL) }, { "R_AARCH64_MOVW_UABS_Gn", unsigned_movw, UL(SYM64_ABS_VAL) }, { "R_AARCH64_ADR_PREL_PG_HI21", relative_adrp, (u64)&sym64_rel }, - { "R_AARCH64_ADR_PREL_PG_HI21", relative_adrp_far, (u64)&printk }, + { "R_AARCH64_ADR_PREL_PG_HI21", relative_adrp_far, (u64)&memstart_addr }, { "R_AARCH64_ADR_PREL_LO21", relative_adr, (u64)&sym64_rel }, { "R_AARCH64_PREL64", relative_data64, (u64)&sym64_rel }, { "R_AARCH64_PREL32", relative_data32, (u64)&sym64_rel },arch/arm64/kernel/reloc_test_syms.S +2
-3@@ -54,8 +54,8 @@ ENDPROC(relative_adrp) .align 12 .space 0xffc ENTRY(relative_adrp_far) - adrp x0, printk - add x0, x0, #:lo12:printk + adrp x0, memstart_addr + add x0, x0, #:lo12:memstart_addr ret ENDPROC(relative_adrp_far) --2.9.0
PATCH v2 1/1 arm64: fix undefined reference to 'printk'
The printk symbol was intended as a generic address that is always exported, however that turned out to be false with CONFIG_PRINTK=n:
ERROR: "printk" [arch/arm64/kernel/arm64-reloc-test.ko] undefined!
This changes the references to memstart_addr, which should be there regardless of configuration.
---
v2: fix changelog as pointed out by Ard
arch/arm64/kernel/reloc_test_core.c | 2 +- arch/arm64/kernel/reloc_test_syms.S | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/kernel/reloc_test_core.c +1 -1
@@ -45,7 +45,7 @@ static struct { { "R_AARCH64_MOVW_SABS_Gn", signed_movw, UL(SYM64_ABS_VAL) }, { "R_AARCH64_MOVW_UABS_Gn", unsigned_movw, UL(SYM64_ABS_VAL) }, { "R_AARCH64_ADR_PREL_PG_HI21", relative_adrp, (u64)&sym64_rel }, - { "R_AARCH64_ADR_PREL_PG_HI21", relative_adrp_far, (u64)&printk }, + { "R_AARCH64_ADR_PREL_PG_HI21", relative_adrp_far, (u64)&memstart_addr }, { "R_AARCH64_ADR_PREL_LO21", relative_adr, (u64)&sym64_rel }, { "R_AARCH64_PREL64", relative_data64, (u64)&sym64_rel }, { "R_AARCH64_PREL32", relative_data32, (u64)&sym64_rel },
arch/arm64/kernel/reloc_test_syms.S +2 -2
@@ -54,8 +54,8 @@ ENDPROC(relative_adrp) .align 12 .space 0xffc ENTRY(relative_adrp_far) - adrp x0, printk - add x0, x0, #:lo12:printk + adrp x0, memstart_addr + add x0, x0, #:lo12:memstart_addr ret ENDPROC(relative_adrp_far)
Signature · 1 line
2.9.0
Quoted 11 lines · Arnd Bergmann
The printk symbol was intended as a generic address that is always exported, however that turned out to be false with
CONFIG_PRINTK=n:ERROR: "printk" [
arch/arm64/kernel/arm64-reloc-test.ko] undefined!This changes the references to
memstart_addr, which should be there regardless of configuration.Fixes a257e02579e4 ("arm64/kernel: don't ban ADRP to work around Cortex-A53 erratum #843419")Acked-by Ard Biesheuvel <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Quoted 6 lines
---
v2: fix changelog as pointed out by Ardarch/arm64/kernel/reloc_test_core.c | 2 +- arch/arm64/kernel/reloc_test_syms.S | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Cheers, I've picked this up now. Sorry for the delay.
Will