how to fix section mismatch warning after inserting #pragma GCC optimize ?

Greg KH greg at
Sun Jan 23 06:11:21 EST 2022

On Sun, Jan 23, 2022 at 07:48:01PM +0900, Chan Kim wrote:
> Hello all,
> In linux 5.4.21 source code, I put
>     #pragma GCC push_options
>     #pragma GCC optimize ("O0")

Do not do that.  Bad things will happen, the kernel really does not like
this at all.

Why do you want to build the kernel with "O0"?  What problem are you
trying to solve that you think this will resolve it?

Also, 5.4.21 is very old and obsolete and known insecure.  Please use a
more modern kernel version.


greg k-h

More information about the Kernelnewbies mailing list