prplos/toolchain/gcc/patches-11.x
Felix Fietkau 6489f3ef89 toolchain/gcc: prevent the use of LDRD/STRD on ARMv5TE
These instructions are for 64-bit load/store. On ARMv5TE, the CPU
requires addresses to be aligned to 64-bit. When misaligned, behavior is
undefined (effectively either loads the same word twice on LDRD, or
corrupts surrounding memory on STRD).

On ARMv6 and newer, unaligned access is safe.

Removing these instructions for ARMv5TE is necessary, because GCC
ignores alignment information in pointers and does unsafe optimizations
that have shown up as bugs in various places.

This patch was originally added more than 11 years ago in commit b050f87d13,
but got lost 6 years ago, when gcc 9.1 was added in 88c07c6552.

This primarily affects the kirkwood and ixp4xx targets

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit c1c11120069b8e04ad4b0c6e815d2e3421944933)
2025-07-22 12:05:09 +02:00
..
002-case_insensitive.patch
010-documentation.patch
011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch
020-Include-safe-ctype.h-after-C-standard-headers-to-avo.patch
110-Fix-MIPS-PR-84790.patch
230-musl_libssp.patch
300-mips_Os_cpu_rtx_cost_model.patch
400-libsanitizer-cherry-pick-9cf13067cb5088626ba7-from-u.patch
700-RISCV-Inline-subword-atomic-ops.patch
701-riscv-linux-Don-t-add-latomic-with-pthread.patch
800-arm_v5te_no_ldrd_strd.patch toolchain/gcc: prevent the use of LDRD/STRD on ARMv5TE 2025-07-22 12:05:09 +02:00
810-arm-softfloat-libgcc.patch
820-libgcc_pic.patch
840-armv4_pass_fix-v4bx_to_ld.patch
850-use_shared_libgcc.patch
851-libgcc_no_compat.patch
870-ppc_no_crtsavres.patch
881-no_tm_section.patch
900-bad-mips16-crt.patch
910-mbsd_multi.patch
920-specs_nonfatal_getenv.patch
931-libffi-fix-MIPS-softfloat-build-issue.patch
960-gotools-fix-compilation-when-making-cross-compiler.patch
970-macos_arm64-building-fix.patch
980-fix-build-error-with-Xcode-16.3.patch toolchain: gcc: fix build error with Xcode 16.3 2025-06-12 10:51:01 +02:00