Re: ld.lld: error: Cannot export BSS symbol __inittext_end to startup code

From: Philip Li
Date: Mon Jun 16 2025 - 20:48:03 EST


On Mon, Jun 16, 2025 at 10:50:26AM -0700, Nathan Chancellor wrote:
> On Sun, Jun 15, 2025 at 06:13:33AM +0800, kernel test robot wrote:
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head: 8c6bc74c7f8910ed4c969ccec52e98716f98700a
> > commit: dc0a083948040ff364d065da8bb50c29f77a39ad arm64: Work around convergence issue with LLD linker
> > date: 12 days ago
> > config: arm64-randconfig-004-20250615 (https://download.01.org/0day-ci/archive/20250615/202506150602.qswx7ZzQ-lkp@xxxxxxxxx/config)
> > compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250615/202506150602.qswx7ZzQ-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/202506150602.qswx7ZzQ-lkp@xxxxxxxxx/
> >
> > All errors (new ones prefixed by >>):
> >
> > >> ld.lld: error: Cannot export BSS symbol id_aa64isar1_override to startup code
> > >> ld.lld: error: Cannot export BSS symbol id_aa64isar2_override to startup code
> > >> ld.lld: error: Cannot export BSS symbol id_aa64mmfr0_override to startup code
> > >> ld.lld: error: Cannot export BSS symbol id_aa64mmfr1_override to startup code
> > >> ld.lld: error: Cannot export BSS symbol id_aa64mmfr2_override to startup code
> > >> ld.lld: error: Cannot export BSS symbol id_aa64pfr0_override to startup code
> > >> ld.lld: error: Cannot export BSS symbol id_aa64pfr1_override to startup code
> > >> ld.lld: error: Cannot export BSS symbol id_aa64smfr0_override to startup code
> > >> ld.lld: error: Cannot export BSS symbol id_aa64zfr0_override to startup code
> > >> ld.lld: error: Cannot export BSS symbol arm64_sw_feature_override to startup code
> > >> ld.lld: error: Cannot export BSS symbol arm64_use_ng_mappings to startup code
> > >> ld.lld: error: Cannot export BSS symbol _ctype to startup code
> > >> ld.lld: error: Cannot export BSS symbol swapper_pg_dir to startup code
> > >> ld.lld: error: Cannot export BSS symbol _etext to startup code
> > >> ld.lld: error: Cannot export BSS symbol __start_rodata to startup code
> > >> ld.lld: error: Cannot export BSS symbol __inittext_begin to startup code
> > >> ld.lld: error: Cannot export BSS symbol __inittext_end to startup code
> > >> ld.lld: error: Cannot export BSS symbol __initdata_begin to startup code
> > >> ld.lld: error: Cannot export BSS symbol __initdata_end to startup code
> > >> ld.lld: error: Cannot export BSS symbol _data to startup code
>
> This version of ld.lld is from early April, which does not contain
> Fangrui's fix [1], so this is expected given the stubbing out of ASSERT
> that Ard did in commit e21560b7d33c ("arm64: Disable LLD linker
> ASSERT()s for the time being") does not happen due to the version.
> Please upgrade to a newer version of LLVM main to avoid triggering this,

Thanks Nathan, i will follow up to upgrade the clang version to avoid
wrong report.

> I can confirm that I do not see an error with a current version.
>
> [1]: https://github.com/llvm/llvm-project/commit/5859863bab7f
>
> Cheers,
> Nathan
>