Re: [PATCH] objtool: cope with pre-4.5 gcc (and non-gcc)
From: Josh Poimboeuf
Date: Mon May 16 2016 - 17:40:44 EST
On Fri, May 13, 2016 at 12:27:06AM -0600, Jan Beulich wrote:
> The kernel's unreachable() translates to __builtin_unreachable() only
> for gcc 4.5 and newer, and else expands to an infinite loop. Avoid
> "function has unreachable instruction" warnings for this case by
> inspecting the instructions immediately following the UD2. This cuts
> down the number of files getting such warnings by about 99% for me.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Thanks for the patch. I'm wondering if we can detect this situation
more precisely, maybe by adding some kind of annotation to the
unreachable() macro. Will need to think about it a little more...
--
Josh