xtensa: Fix section mismatch between memblock_reserve and mem_reserve
PATCH 1/1 xtensa: Fix section mismatch between memblock_reserve and mem_reserve
Since commit 9012d011660ea5cf2 ("compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING"), xtensa:tinyconfig fails to build with section mismatch errors.
WARNING: vmlinux.o(.text.unlikely+0x68): Section mismatch in reference
from the function ___pa()
to the function .meminit.text:memblock_reserve()
WARNING: vmlinux.o(.text.unlikely+0x74): Section mismatch in reference
from the function mem_reserve()
to the function .meminit.text:memblock_reserve()
FATAL: modpost: Section mismatches detected.
This was not seen prior to the above mentioned commit because mem_reserve() was always inlined.
Mark mem_reserve(() as __init_memblock to have it reside in the same section as memblock_reserve().
--- arch/xtensa/kernel/setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/xtensa/kernel/setup.c +2 -1
@@ -310,7 +310,8 @@ extern char _SecondaryResetVector_text_start;extern char _SecondaryResetVector_text_end;#endif -static inline int mem_reserve (unsigned long start,unsigned long end) +static inline int __init_memblock mem_reserve(unsigned long start, +unsigned long end) {return memblock_reserve (start, end - start); }
Signature · 1 line
2.7.4
Max Filippov
maintainerHi Guenter,
Quoted 16 lines · Guenter Roeck
Since commit
9012d011660ea5cf2("compiler: allow all arches to enableCONFIG_OPTIMIZE_INLINING"), xtensa:tinyconfig fails to build with section mismatch errors.WARNING:
vmlinux.o(.text.unlikely+0x68): Section mismatch in reference
from the function___pa()
to the function .meminit.text:memblock_reserve()
WARNING:vmlinux.o(.text.unlikely+0x74): Section mismatch in reference
from the functionmem_reserve()
to the function .meminit.text:memblock_reserve()
FATAL: modpost: Section mismatches detected.This was not seen prior to the above mentioned commit because
mem_reserve()was always inlined.
Quoted 7 lines
Mark mem_reserve(() as
__init_memblockto have it reside in the same section asmemblock_reserve().Signed-off-by Guenter Roeck <[email protected]>--- arch/xtensa/kernel/setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Thank you for this fix! Applied to my xtensa tree.
Signature · 2 lines
Thanks. -- Max