lkml.org 
[lkml]   [2021]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] memblock: fix section mismatch warning
From
Date
On 25.02.21 14:38, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The inlining logic in clang-13 is rewritten to often not inline
> some functions that were inlined by all earlier compilers.
>
> In case of the memblock interfaces, this exposed a harmless bug
> of a missing __init annotation:
>
> WARNING: modpost: vmlinux.o(.text+0x507c0a): Section mismatch in reference from the function memblock_bottom_up() to the variable .meminit.data:memblock
> The function memblock_bottom_up() references
> the variable __meminitdata memblock.
> This is often because memblock_bottom_up lacks a __meminitdata
> annotation or the annotation of memblock is wrong.
>
> Interestingly, these annotations were present originally, but got removed
> with the explanation that the __init annotation prevents the function
> from getting inlined. I checked this again and found that while this
> is the case with clang, gcc (version 7 through 10, did not test others)
> does inline the functions regardless.

Did I understand correctly, that with this change it will not get
inlined with any version of clang? Maybe __always_inline is more
appropriate then.

(I don't see why to not inline that function, but I am obviously not a
compiler person :) )

--
Thanks,

David / dhildenb

\
 
 \ /
  Last update: 2021-02-25 14:50    [W:0.045 / U:1.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site