Skip to content

Thin LTO causes relocation R_AARCH64_CALL26 out of range #1550

@emojifreak

Description

@emojifreak

This could be a duplicate of #1394. When the kernel is too big, relocation out of range looks natural. On the other hand, CONFIG_RELOCATABLE=n should prevent such errors.

Besides, allyesconfig for arm64 leaves many modules disabled. This is because CONFIG_ARCH_*, CONFIG_*_MBOX and CONFIG_*_FIRMWARE are left disabled. Building a too big kernel needs manual configuration.

With the attached .config or reproducing script, linux 5.16-rc5 with CONFIG_RELOCATABLE=n causes the following build error:

  LD      .tmp_vmlinux.kallsyms1
ld.lld: error: /var/tmp/tmp28/arm64/linux-5.16-rc5/drivers/net/ieee802154/adf7242.c:1263:(.text.adf7242_probe.0874045d102581664d600c7fc975d828+0x600): relocation R_AARCH64_CALL26 out of range: -134240376 is not in [-134217728, 134217727]
ld.lld: error: ./include/linux/refcount.h:227:(.text.__xfrm_state_lookup+0x1A4): relocation R_AARCH64_CALL26 out of range: -134253716 is not in [-134217728, 134217727]
ld.lld: error: ./include/linux/rcupdate.h:688:(.text.xfrm_replay_timer_handler.b959a7adba8b272d70e4565e7224e33c+0xB0): relocation R_AARCH64_CALL26 out of range: -134218960 is not in [-134217728, 134217727]
ld.lld: error: /var/tmp/tmp28/arm64/linux-5.16-rc5/drivers/net/ieee802154/adf7242.c:1280:(.text.adf7242_probe.0874045d102581664d600c7fc975d828+0x954): relocation R_AARCH64_CALL26 out of range: -134241228 is not in [-134217728, 134217727]
ld.lld: error: /var/tmp/tmp28/arm64/linux-5.16-rc5/drivers/net/ieee802154/adf7242.c:1250:(.text.adf7242_probe.0874045d102581664d600c7fc975d828+0x154C): relocation R_AARCH64_CALL26 out of range: -134244260 is not in [-134217728, 134217727]
ld.lld: error: /var/tmp/tmp28/arm64/linux-5.16-rc5/drivers/net/ieee802154/adf7242.c:1167:(.text.adf7242_debugfs_init+0x68): relocation R_AARCH64_CALL26 out of range: -134247904 is not in [-134217728, 134217727]
ld.lld: error: /var/tmp/tmp28/arm64/linux-5.16-rc5/drivers/net/ieee802154/ca8210.c:770:(.text.ca8210_spi_transfer_complete.7aa2a2ad9f21168c06e534838d7c2b4a+0x780): relocation R_AARCH64_CALL26 out of range: -134289224 is not in [-134217728, 134217727]
ld.lld: error: /var/tmp/tmp28/arm64/linux-5.16-rc5/drivers/net/ieee802154/ca8210.c:770:(.text.ca8210_spi_transfer_complete.7aa2a2ad9f21168c06e534838d7c2b4a+0xDE0): relocation R_AARCH64_CALL26 out of range: -134290856 is not in [-134217728, 134217727]
ld.lld: error: ./include/linux/uaccess.h:200:(.text.ca8210_test_int_user_read.7aa2a2ad9f21168c06e534838d7c2b4a+0x35C): relocation R_AARCH64_CALL26 out of range: -134297908 is not in [-134217728, 134217727]
ld.lld: error: ./include/linux/uaccess.h:192:(.text.ca8210_test_int_user_write.7aa2a2ad9f21168c06e534838d7c2b4a+0x114): relocation R_AARCH64_CALL26 out of range: -134299548 is not in [-134217728, 134217727]
ld.lld: error: ./include/linux/rculist.h:157:(.text.hwsim_del_edge_nl.b824ffb7c1ef339108359d6dfbdb103e+0x420): relocation R_AARCH64_CALL26 out of range: -134344664 is not in [-134217728, 134217727]
ld.lld: error: ./include/linux/rculist.h:157:(.text.hwsim_add_one+0x868): relocation R_AARCH64_CALL26 out of range: -134349088 is not in [-134217728, 134217727]
ld.lld: error: ./include/linux/list.h:148:(.text.hwsim_del+0x48): relocation R_AARCH64_CALL26 out of range: -134357184 is not in [-134217728, 134217727]
ld.lld: error: ./include/linux/rculist.h:157:(.text.hwsim_del+0x110): relocation R_AARCH64_CALL26 out of range: -134357384 is not in [-134217728, 134217727]
ld.lld: error: /var/tmp/tmp28/arm64/linux-5.16-rc5/drivers/net/wwan/wwan_core.c:332:(.text.__wwan_port_dev_assign_name+0x10C): relocation R_AARCH64_CALL26 out of range: -134362708 is not in [-134217728, 134217727]
ld.lld: error: /var/tmp/tmp28/arm64/linux-5.16-rc5/drivers/net/wwan/wwan_core.c:960:(.text.wwan_register_ops+0x28C): relocation R_AARCH64_CALL26 out of range: -134366036 is not in [-134217728, 134217727]
ld.lld: error: /var/tmp/tmp28/arm64/linux-5.16-rc5/drivers/net/wwan/wwan_core.c:131:(.text.wwan_dev_name_match.dbd604d2a4f5b0e6b0fe8fe0e9224f26+0x60): relocation R_AARCH64_CALL26 out of range: -134373736 is not in [-134217728, 134217727]
ld.lld: error: ./include/linux/uaccess.h:200:(.text.wwan_port_fops_read.dbd604d2a4f5b0e6b0fe8fe0e9224f26+0x274): relocation R_AARCH64_CALL26 out of range: -134374492 is not in [-134217728, 134217727]
ld.lld: error: ./include/linux/uaccess.h:192:(.text.wwan_port_fops_write.dbd604d2a4f5b0e6b0fe8fe0e9224f26+0xD4): relocation R_AARCH64_CALL26 out of range: -134375084 is not in [-134217728, 134217727]
ld.lld: error: ./include/linux/uaccess.h:192:(.text.wwan_port_fops_at_ioctl+0xAC): relocation R_AARCH64_CALL26 out of range: -134381892 is not in [-134217728, 134217727]
ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
make[1]: *** [Makefile:1161: vmlinux] Error 1
make: *** [Makefile:1140: autoksyms_recursive] Error 2
make: Target 'all' not remade because of errors.

clang-build-arch28.sh.gz
config.txt.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    [ARCH] arm64This bug impacts ARCH=arm64[BUG] UntriagedSomething isn't working[FEATURE] LTORelated to building the kernel with LLVM Link Time Optimization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions