Re: [PATCH 1/4] modpost: shorten warning messages in report_sec_mismatch()

From: Masahiro Yamada
Date: Wed Aug 03 2022 - 12:37:24 EST


On Wed, Aug 3, 2022 at 3:13 AM Nick Desaulniers <ndesaulniers@xxxxxxxxxx> wrote:
>
> On Mon, Aug 1, 2022 at 2:41 AM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
> >
> > Each section mismatch results in long warning messages. Too much.
>
> :(
>
> Yes; they are too verbose. That said, I have found the
> recommendations about annotations for function attributes handy in the
> past and would be sad to see them go. They remind me of "note"
> diagnostics from the compiler that add additional context to
> "warning"/"error" diagnostics on what the recommended next steps are
> for fixing them.
>
> Is there a "happy middle ground" here?

I do not know.
modpost became painfully ugly.


Moreover, the current hint is not necessarily precise.
("lacks a __initdata" in the following)



[sample code]
int dummy __initdata;
void set_dummy(void) { dummy = 1; }


[warning]
WARNING: modpost: vmlinux.o(.text+0x194412): Section mismatch in
reference from the function set_dummy() to the variable
.init.data:dummy
The function set_dummy() references
the variable __initdata dummy.
This is often because set_dummy lacks a __initdata
annotation or the annotation of dummy is wrong.




--
Best Regards


Masahiro Yamada