* CONFIG_LD_DEAD_CODE_DATA_ELIMINATION: Section mismatch in reference from the variable via_pmu_driver to the function .init.text:pmu_init()
@ 2018-07-03 9:40 Mathieu Malaterre
2018-07-03 10:07 ` Christophe LEROY
2018-07-03 11:40 ` Mathieu Malaterre
0 siblings, 2 replies; 4+ messages in thread
From: Mathieu Malaterre @ 2018-07-03 9:40 UTC (permalink / raw)
To: Nicholas Piggin; +Cc: linuxppc-dev
Hi Nick,
Would you consider this a bug:
$ touch drivers/macintosh/via-pmu.c
$ CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=n make ARCH=powerpc
CROSS_COMPILE=powerpc-linux-gnu-
...
LD vmlinux.o
MODPOST vmlinux.o
WARNING: vmlinux.o(.data+0x216018): Section mismatch in reference from
the variable via_pmu_driver to the function .init.text:pmu_init()
The variable via_pmu_driver references
the function __init pmu_init()
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
While:
$ touch drivers/macintosh/via-pmu.c
$ CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y make ARCH=powerpc
CROSS_COMPILE=powerpc-linux-gnu-
...
AR init/built-in.a
AR built-in.a
LD vmlinux.o
MODPOST vmlinux.o
KSYM .tmp_kallsyms1.o
KSYM .tmp_kallsyms2.o
LD vmlinux
SORTEX vmlinux
SYSMAP System.map
...
Thanks for comment
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: CONFIG_LD_DEAD_CODE_DATA_ELIMINATION: Section mismatch in reference from the variable via_pmu_driver to the function .init.text:pmu_init()
2018-07-03 9:40 CONFIG_LD_DEAD_CODE_DATA_ELIMINATION: Section mismatch in reference from the variable via_pmu_driver to the function .init.text:pmu_init() Mathieu Malaterre
@ 2018-07-03 10:07 ` Christophe LEROY
2018-07-03 11:40 ` Mathieu Malaterre
1 sibling, 0 replies; 4+ messages in thread
From: Christophe LEROY @ 2018-07-03 10:07 UTC (permalink / raw)
To: Mathieu Malaterre, Nicholas Piggin; +Cc: linuxppc-dev
Le 03/07/2018 à 11:40, Mathieu Malaterre a écrit :
> Hi Nick,
>
> Would you consider this a bug:
Looks more like a feature ...
In /drivers/macintosh/adb.c you have, and it's the only place
via_pmu_driver is used.
#if defined(CONFIG_ADB_PMU) || defined(CONFIG_ADB_PMU68K)
&via_pmu_driver,
#endif
Is one of those defined in your .config ? If not then via_pmu_driver
gets eliminated hence nothing to warn on.
Christophe
>
> $ touch drivers/macintosh/via-pmu.c
> $ CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=n make ARCH=powerpc
> CROSS_COMPILE=powerpc-linux-gnu-
> ...
> LD vmlinux.o
> MODPOST vmlinux.o
> WARNING: vmlinux.o(.data+0x216018): Section mismatch in reference from
> the variable via_pmu_driver to the function .init.text:pmu_init()
> The variable via_pmu_driver references
> the function __init pmu_init()
> 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
>
> While:
>
> $ touch drivers/macintosh/via-pmu.c
> $ CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y make ARCH=powerpc
> CROSS_COMPILE=powerpc-linux-gnu-
> ...
> AR init/built-in.a
> AR built-in.a
> LD vmlinux.o
> MODPOST vmlinux.o
> KSYM .tmp_kallsyms1.o
> KSYM .tmp_kallsyms2.o
> LD vmlinux
> SORTEX vmlinux
> SYSMAP System.map
> ...
>
> Thanks for comment
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: CONFIG_LD_DEAD_CODE_DATA_ELIMINATION: Section mismatch in reference from the variable via_pmu_driver to the function .init.text:pmu_init()
2018-07-03 9:40 CONFIG_LD_DEAD_CODE_DATA_ELIMINATION: Section mismatch in reference from the variable via_pmu_driver to the function .init.text:pmu_init() Mathieu Malaterre
2018-07-03 10:07 ` Christophe LEROY
@ 2018-07-03 11:40 ` Mathieu Malaterre
2018-07-03 12:15 ` Nicholas Piggin
1 sibling, 1 reply; 4+ messages in thread
From: Mathieu Malaterre @ 2018-07-03 11:40 UTC (permalink / raw)
To: Nicholas Piggin; +Cc: linuxppc-dev, Christophe LEROY
On Tue, Jul 3, 2018 at 11:40 AM Mathieu Malaterre <malat@debian.org> wrote:
>
> Hi Nick,
>
> Would you consider this a bug:
>
> $ touch drivers/macintosh/via-pmu.c
> $ CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=n make ARCH=powerpc
> CROSS_COMPILE=powerpc-linux-gnu-
> ...
> LD vmlinux.o
> MODPOST vmlinux.o
> WARNING: vmlinux.o(.data+0x216018): Section mismatch in reference from
> the variable via_pmu_driver to the function .init.text:pmu_init()
> The variable via_pmu_driver references
> the function __init pmu_init()
> 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
>
> While:
>
> $ touch drivers/macintosh/via-pmu.c
> $ CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y make ARCH=powerpc
> CROSS_COMPILE=powerpc-linux-gnu-
> ...
> AR init/built-in.a
> AR built-in.a
> LD vmlinux.o
> MODPOST vmlinux.o
> KSYM .tmp_kallsyms1.o
> KSYM .tmp_kallsyms2.o
> LD vmlinux
> SORTEX vmlinux
> SYSMAP System.map
> ...
>
> Thanks for comment
Just to clarify I reverted 58935176ad17976b7a7f6ea25c0ceb2ca4308a30
just as to reproduce a warning. So my question (rephrased):
Is this expected that CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y inhibit
the behavior of CONFIG_DEBUG_SECTION_MISMATCH=y ?
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: CONFIG_LD_DEAD_CODE_DATA_ELIMINATION: Section mismatch in reference from the variable via_pmu_driver to the function .init.text:pmu_init()
2018-07-03 11:40 ` Mathieu Malaterre
@ 2018-07-03 12:15 ` Nicholas Piggin
0 siblings, 0 replies; 4+ messages in thread
From: Nicholas Piggin @ 2018-07-03 12:15 UTC (permalink / raw)
To: Mathieu Malaterre; +Cc: linuxppc-dev, Christophe LEROY
On Tue, 3 Jul 2018 13:40:55 +0200
Mathieu Malaterre <malat@debian.org> wrote:
> On Tue, Jul 3, 2018 at 11:40 AM Mathieu Malaterre <malat@debian.org> wrote:
> >
> > Hi Nick,
> >
> > Would you consider this a bug:
> >
> > $ touch drivers/macintosh/via-pmu.c
> > $ CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=n make ARCH=powerpc
> > CROSS_COMPILE=powerpc-linux-gnu-
> > ...
> > LD vmlinux.o
> > MODPOST vmlinux.o
> > WARNING: vmlinux.o(.data+0x216018): Section mismatch in reference from
> > the variable via_pmu_driver to the function .init.text:pmu_init()
> > The variable via_pmu_driver references
> > the function __init pmu_init()
> > 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
> >
> > While:
> >
> > $ touch drivers/macintosh/via-pmu.c
> > $ CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y make ARCH=powerpc
> > CROSS_COMPILE=powerpc-linux-gnu-
> > ...
> > AR init/built-in.a
> > AR built-in.a
> > LD vmlinux.o
> > MODPOST vmlinux.o
> > KSYM .tmp_kallsyms1.o
> > KSYM .tmp_kallsyms2.o
> > LD vmlinux
> > SORTEX vmlinux
> > SYSMAP System.map
> > ...
> >
> > Thanks for comment
>
> Just to clarify I reverted 58935176ad17976b7a7f6ea25c0ceb2ca4308a30
> just as to reproduce a warning. So my question (rephrased):
>
> Is this expected that CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y inhibit
> the behavior of CONFIG_DEBUG_SECTION_MISMATCH=y ?
Well that's a good question actually. Section mismatch
analysis is done on the throwaway vmlinux.o which is not linked
with --gc-sections (and is not a final link), so the via_pmu_driver
symbol should exist and be picked up.
I wonder if something about the -ffunction-sections is breaking
the reference detection.
Thanks,
Nick
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-07-03 12:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-03 9:40 CONFIG_LD_DEAD_CODE_DATA_ELIMINATION: Section mismatch in reference from the variable via_pmu_driver to the function .init.text:pmu_init() Mathieu Malaterre
2018-07-03 10:07 ` Christophe LEROY
2018-07-03 11:40 ` Mathieu Malaterre
2018-07-03 12:15 ` Nicholas Piggin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).