Re: arch/loongarch/kernel/alternative.o: warning: objtool: apply_alternatives+0xa0: unreachable instruction

From: Tiezhu Yang
Date: Mon Jul 22 2024 - 05:33:59 EST


On 07/22/2024 12:38 PM, kernel test robot wrote:
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7846b618e0a4c3e08888099d1d4512722b39ca99
commit: cb8a2ef0848ca80d67d6d56e2df757cfdf6b3355 LoongArch: Add ORC stack unwinder support
date: 4 months ago
config: loongarch-randconfig-001-20240722 (https://download.01.org/0day-ci/archive/20240722/202407221208.6SSBeN9H-lkp@xxxxxxxxx/config)
compiler: loongarch64-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240722/202407221208.6SSBeN9H-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407221208.6SSBeN9H-lkp@xxxxxxxxx/


A quick test shows that the objtool warnings are related with compiler
optimization level, it uses -Os (CONFIG_CC_OPTIMIZE_FOR_SIZE=y) rather
than the default -O2 (CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set)
in the randconfig. I will keep digging.

Thanks,
Tiezhu