https://sourceware.org/bugzilla/show_bug.cgi?id=34200

            Bug ID: 34200
           Summary: AArch64: --fix-cortex-a53-843419 errata workaround
                    seems incomplete
           Product: binutils
           Version: 2.46
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: [email protected]
  Target Milestone: ---

Hi all,

After updating my Raspberry Pi 3B to NixOS 26.05, I found out that pihole-ftl
6.6.2 was segfaulting(https://github.com/NixOS/nixpkgs/issues/526286) directly
after starting the binary. This binary was built with GCC 15.2.0 and "-O3
-funroll-loops" for aarch64.

After playing around with the crash and testing the binary against an earlier
kernel version and against a earlier GCC version, I found that the crash
disappeared with the earlier GCC 14 version.
Then I read the first time about "--fix-cortex-a53-843419" and found out that
this flag was not enabled for the packages from the binary cache.

Using Claude Code to inspect the objdumps, I found out that ld(bfd)'s
"--fix-cortex-a53-843419" workaround was inserting stubs that lead to shifting
of later code, but any ADRP instruction that such a shift moved onto another
page offset "0xff8/0xffc" could form a new erratum sequence that was never
re-scanned and therefore never patched leading to the crash on my machine.

After inspecting LLVM's lld implementation of the erratum workaround, I saw
that they were applying the workaround in multiple passes.

After realizing that, I built the binary with GCC 15.2 and lld as a linker and
the problem disappeared.

I have created a "XFAIL: ld-aarch64/erratum843419-incomplete" test using Claude
Code but I would need someone of the aarch64 maintainers to help me with the
implementation of the fix.

best regards,
Fabian

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to