Skip to content

improper alignment for relocation R_AARCH64_LDST64_ABS_LO12_NC, not aligned to 8 bytes #1204

@nathanchance

Description

@nathanchance

Initial report: https://lists.01.org/hyperkitty/list/[email protected]/message/SL4BJYFFYAEBCWMPBSNYMHNP7JLESXUJ/

Reported-by: kernel test robot <[email protected]>

On Linux v5.10-rc6:

$ curl -LSs https://lists.01.org/hyperkitty/list/[email protected]/message/SL4BJYFFYAEBCWMPBSNYMHNP7JLESXUJ/attachment/2/config.gz | gzip -d > out/.config

$ make -skj"$(nproc)" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- LLVM=1 O=out olddefconfig vmlinux
ld.lld: error: main.c:(function device_uncache_fw_images_work: .text+0x1614): improper alignment for relocation R_AARCH64_LDST64_ABS_LO12_NC: 0xFFFFFFC010C711D9 is not aligned to 8 bytes
...

As it turns out, this is not an ld.lld issue but a clang issue, specifically one introduced in clang 12 according to my bisect:

$ git bisect log
# bad: [173bb3c2eb094920708ab8f61dae2fe22d331773] [lldb] Refactor GetDeviceSupportDirectoryNames and GetPlatformName (NFC)
# good: [7ab7b979d29e1e43701cf690f5cf1903740f50e3] Bump the trunk major version to 12
git bisect start '173bb3c2eb094920708ab8f61dae2fe22d331773' 'llvmorg-12-init'
# bad: [f835779160ec30340676918915526615a07e826e] [APFloat] multiplySignificand - always pass IEEEFloat as const reference. NFCI.
git bisect bad f835779160ec30340676918915526615a07e826e
# bad: [4d5fdff43488445746dfea4cf0a5621cfd838c01] [InstCombine] add tests for copysign; NFC
git bisect bad 4d5fdff43488445746dfea4cf0a5621cfd838c01
# bad: [9ebeac678855a1bc2492a9630f0300518e2755dc] [ConstantRange][CVP] Make use of abs poison flag
git bisect bad 9ebeac678855a1bc2492a9630f0300518e2755dc
# bad: [6b55a95898e98664164caae4aba7c5e24fd1a05e] [DebugInfo] Emit DW_OP_implicit_value for Floating point constants
git bisect bad 6b55a95898e98664164caae4aba7c5e24fd1a05e
# bad: [fd50e7c06d79e3afe913495eae1759ebf5514ccf] [lldb][NFC] Make some RegularExpression constructor calls less verbose
git bisect bad fd50e7c06d79e3afe913495eae1759ebf5514ccf
# bad: [b0bc77380d8ca6c4b5037d0437b5d3a15b0c3f6f] [ORC] Add more explicit casts to fix a narrowing conversion errors.
git bisect bad b0bc77380d8ca6c4b5037d0437b5d3a15b0c3f6f
# bad: [46c921003c2ce5f1cdc4de9ef613eb001980780c] [clangd] Always retrieve ProjectInfo from Base in OverlayCDB
git bisect bad 46c921003c2ce5f1cdc4de9ef613eb001980780c
# good: [8b85f68ee2ddd983c027adbda9567f06d25b3c51] [lldb/Test] Remove custom tearDownHooks from GDB Remote tests
git bisect good 8b85f68ee2ddd983c027adbda9567f06d25b3c51
# good: [537b16e9b8da97054663daf638a6c55026af2fe4] [OpenMP 5.0] Codegen support to pass user-defined mapper functions to runtime
git bisect good 537b16e9b8da97054663daf638a6c55026af2fe4
# good: [ae74387fc0fd0866766dad877c844e35a3932a51] [MasmParser] Remove unused method emitStructValue to silence warning
git bisect good ae74387fc0fd0866766dad877c844e35a3932a51
# bad: [1c93671e594d075cb0008dc4f33d863611af9ab9] [flang] Fix shared library builds for lib/Lower.
git bisect bad 1c93671e594d075cb0008dc4f33d863611af9ab9
# good: [1067d3e176ea7b0b1942c163bf8c6c90107768c1] Revert "[NFCI] createCFGSimplificationPass(): migrate to also take SimplifyCFGOptions"
git bisect good 1067d3e176ea7b0b1942c163bf8c6c90107768c1
# bad: [5658002b80c105f715b8deb495b2d4443ddf9914] AMDGPU/GlobalISel: Select G_FREEZE
git bisect bad 5658002b80c105f715b8deb495b2d4443ddf9914
# bad: [90798e09e29012fe316565ea04a1f848c5e40e6e] Re-enable "[InstCombine] Simplify boolean Phis with const inputs using CFG"
git bisect bad 90798e09e29012fe316565ea04a1f848c5e40e6e
# first bad commit: [90798e09e29012fe316565ea04a1f848c5e40e6e] Re-enable "[InstCombine] Simplify boolean Phis with const inputs using CFG"
$ make -skj"$(nproc)" ARCH=arm64 CC=clang CROSS_COMPILE=aarch64-linux-gnu- O=out olddefconfig vmlinux
...
drivers/base/firmware_loader/main.o: in function `device_uncache_fw_images_work':
main.c:(.text+0x1614): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `__start_builtin_fw' defined in .rodata section in .tmp_vmlinux.kallsyms1
aarch64-linux-gnu-ld: main.c:(.text+0x1614): warning: one possible cause of this error is that the symbol is being referenced in the indicated code as if it had a larger alignment than was declared where it was defined
...

I tried to narrow down the Linux configuration file relative to defconfig with config-bisect.pl but did not have any luck. I can try to take a whack at that after the new year if it is relevant.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions