Index: external/gpl3/binutils.old/dist/bfd/elf32-ppc.c =================================================================== RCS file: /cvsroot/src/external/gpl3/binutils.old/dist/bfd/elf32-ppc.c,v retrieving revision 1.12 diff -u -p -r1.12 elf32-ppc.c --- external/gpl3/binutils.old/dist/bfd/elf32-ppc.c 10 Feb 2026 19:59:06 -0000 1.12 +++ external/gpl3/binutils.old/dist/bfd/elf32-ppc.c 15 Feb 2026 10:20:41 -0000 @@ -8018,8 +8018,14 @@ ppc_elf_relocate_section (bfd *output_bf bfd_put_32 (input_bfd, insn, p); break; } - if (htab->elf.tls_sec != NULL) - addend -= htab->elf.tls_sec->vma + TP_OFFSET; + + if (htab->elf.tls_sec != NULL && htab->elf.tls_sec->output_section != NULL) + { + /* Use the output_section's VMA as the anchor for TP-relative math + to account for any alignment-induced padding in the TLS segment. */ + addend -= htab->elf.tls_sec->output_section->vma + TP_OFFSET; + } + /* The TPREL16 relocs shouldn't really be used in shared libs or with non-local symbols as that will result in DT_TEXTREL being set, but support them anyway. */