Re: [PATCH 2/2] modpost: skip ELF local symbols by default during section mismatch check

From: Paul Walmsley
Date: Wed Nov 14 2018 - 14:30:49 EST


Hello Masahiro,

On Tue, 13 Nov 2018, Masahiro Yamada wrote:

Hi Paul,

On Sat, Oct 20, 2018 at 10:21 PM Paul Walmsley <paul.walmsley@xxxxxxxxxx> wrote:

During development of a serial console driver with a RISC-V toolchain,
the following modpost warning appeared:

----
WARNING: vmlinux.o(.data+0x19b10): Section mismatch in reference from the variable .LANCHOR1 to the function .init.text:sifive_serial_console_setup()
The variable .LANCHOR1 references
the function __init sifive_serial_console_setup()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
----

Could you provide me a little more information to reproduce it?

I tried your dev/paulw/serial-v4.19-rc7,
but I could not get that warning.

I used risc64-linux-gcc (GCC 7.3, 8.1) from kernel.org

I observed this issue with gcc 8.2:

riscv64-unknown-linux-gnu-gcc (crosstool-NG 1.23.0.534-710c8) 8.2.0

This toolchain was built with mainline crosstool-NG:

https://github.com/crosstool-ng/crosstool-ng

using the "riscv64-unknown-linux-gnu" sample configuration.


- Paul