Rebase to commit f85ff0c4bce

This commit is contained in:
Nick Clifton 2026-06-25 14:24:54 +01:00
commit c5ce1de980
3 changed files with 7 additions and 153 deletions

View file

@ -1,152 +1,3 @@
--- binutils.orig/bfd/elfnn-aarch64.c 2026-04-17 09:16:32.707242517 +0100
+++ binutils-with-gold-2.46.50-48997323b0f/bfd/elfnn-aarch64.c 2026-06-04 12:50:40.994231960 +0100
@@ -5392,9 +5392,11 @@ aarch64_tls_transition (bfd *input_bfd,
static bfd_vma
dtpoff_base (struct bfd_link_info *info)
{
+ asection * tls = elf_hash_table (info)->tls_sec;
+
/* If tls_sec is NULL, we should have signalled an error already. */
- BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL);
- return elf_hash_table (info)->tls_sec->vma;
+ BFD_ASSERT (tls != NULL);
+ return tls->vma;
}
/* Return the base VMA address which should be subtracted from real addresses
@@ -5403,14 +5405,13 @@ dtpoff_base (struct bfd_link_info *info)
static bfd_vma
tpoff_base (struct bfd_link_info *info)
{
- struct elf_link_hash_table *htab = elf_hash_table (info);
-
+ asection * tls = elf_hash_table (info)->tls_sec;
+
/* If tls_sec is NULL, we should have signalled an error already. */
- BFD_ASSERT (htab->tls_sec != NULL);
+ BFD_ASSERT (tls != NULL);
- bfd_vma base = align_power ((bfd_vma) TCB_SIZE,
- htab->tls_sec->alignment_power);
- return htab->tls_sec->vma - base;
+ bfd_vma base = align_power ((bfd_vma) TCB_SIZE, tls->alignment_power);
+ return tls->vma - base;
}
static bfd_vma *
@@ -6497,7 +6498,7 @@ elfNN_aarch64_final_link_relocate (reloc
break;
case BFD_RELOC_AARCH64_TLS_DTPREL:
- if (input_section->flags & SEC_ALLOC)
+ if (input_section->flags & SEC_ALLOC || elf_hash_table (info)->tls_sec == NULL)
return bfd_reloc_notsupported;
value -= dtpoff_base (info);
value += rel->r_addend;
@@ -7272,6 +7273,17 @@ elfNN_aarch64_relocate_section (bfd *out
}
else if (indx == 0)
{
+ if (elf_hash_table (info)->tls_sec == NULL)
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB(%pA+%#" PRIx64 "): "
+ "unresolvable %s relocation against symbol `%s'"),
+ input_bfd, input_section, (uint64_t) rel->r_offset, howto->name,
+ h->root.root.string);
+ return false;
+ }
+
bfd_put_NN (output_bfd,
relocation - dtpoff_base (info),
globals->root.sgot->contents + off
@@ -7301,6 +7313,17 @@ elfNN_aarch64_relocate_section (bfd *out
}
else
{
+ if (elf_hash_table (info)->tls_sec == NULL)
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB(%pA+%#" PRIx64 "): "
+ "unresolvable %s relocation against symbol `%s'"),
+ input_bfd, input_section, (uint64_t) rel->r_offset, howto->name,
+ h->root.root.string);
+ return false;
+ }
+
bfd_put_NN (output_bfd, (bfd_vma) 1,
globals->root.sgot->contents + off);
bfd_put_NN (output_bfd,
@@ -7342,7 +7365,20 @@ elfNN_aarch64_relocate_section (bfd *out
Elf_Internal_Rela rela;
if (indx == 0)
- rela.r_addend = relocation - dtpoff_base (info);
+ {
+ if (elf_hash_table (info)->tls_sec == NULL)
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB(%pA+%#" PRIx64 "): "
+ "unresolvable %s relocation against symbol `%s'"),
+ input_bfd, input_section, (uint64_t) rel->r_offset, howto->name,
+ h->root.root.string);
+ return false;
+ }
+
+ rela.r_addend = relocation - dtpoff_base (info);
+ }
else
rela.r_addend = 0;
@@ -7360,8 +7396,21 @@ elfNN_aarch64_relocate_section (bfd *out
globals->root.sgot->contents + off);
}
else
- bfd_put_NN (output_bfd, relocation - tpoff_base (info),
- globals->root.sgot->contents + off);
+ {
+ if (elf_hash_table (info)->tls_sec == NULL)
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB(%pA+%#" PRIx64 "): "
+ "unresolvable %s relocation against symbol `%s'"),
+ input_bfd, input_section, (uint64_t) rel->r_offset, howto->name,
+ h->root.root.string);
+ return false;
+ }
+
+ bfd_put_NN (output_bfd, relocation - tpoff_base (info),
+ globals->root.sgot->contents + off);
+ }
symbol_got_offset_mark (input_bfd, h, r_symndx);
}
@@ -7399,7 +7448,20 @@ elfNN_aarch64_relocate_section (bfd *out
+ off + globals->sgotplt_jump_table_size);
if (indx == 0)
- rela.r_addend = relocation - dtpoff_base (info);
+ {
+ if (elf_hash_table (info)->tls_sec == NULL)
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB(%pA+%#" PRIx64 "): "
+ "unresolvable %s relocation against symbol `%s'"),
+ input_bfd, input_section, (uint64_t) rel->r_offset, howto->name,
+ h->root.root.string);
+ return false;
+ }
+
+ rela.r_addend = relocation - dtpoff_base (info);
+ }
/* Allocate the next available slot in the PLT reloc
section to hold our R_AARCH64_TLSDESC, the next
--- binutils.orig/ld/testsuite/ld-elf/tls.exp 2026-06-04 15:04:55.967170259 +0100
+++ binutils-with-gold-2.46.50-48997323b0f/ld/testsuite/ld-elf/tls.exp 2026-06-04 15:08:11.936031107 +0100
@@ -66,6 +66,7 @@ run_ld_link_tests [list \

View file

@ -7,7 +7,7 @@ Name: binutils%{?_with_debug:-debug}
# The variable %%{source} (see below) should be set to indicate which of these
# origins is being used.
Version: 2.46.50
Release: 11%{?dist}
Release: 12%{?dist}
License: GPL-3.0-or-later AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND BSD-3-Clause AND GFDL-1.3-or-later AND GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.0-or-later
URL: https://sourceware.org/binutils
@ -133,7 +133,7 @@ URL: https://sourceware.org/binutils
# correctly. Note %%(echo) is used because you cannot directly set a
# spec variable to a hexadecimal string value.
%define commit_id %(echo "48997323b0f")
%define commit_id %(echo "f85ff0c4bce")
#----End of Configure Options------------------------------------------------
@ -348,7 +348,7 @@ Patch19: binutils-gold-empty-dwp.patch
# Lifetime: Permanent.
Patch20: binutils-ld-default-z-text.patch
# Purpose: AArch64: Always process IFUNCS as such even if not in an allocated section.
# Purpose: AArch64: Expect the PR34165 linker test to fail.
# Lifetime: Fixed soon.
Patch21: binutils-aarch64-ifuncs.patch
@ -1513,6 +1513,9 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Thu Jun 25 2026 Nick Clifton <nickc@redhat.com> - 2.46.50-12
- Rebase to commit f85ff0c4bce
* Thu Jun 11 2026 Nick Clifton <nickc@redhat.com> - 2.46.50-11
- Fix linker testsuite problem for Risc-V.

View file

@ -1,2 +1,2 @@
SHA512 (binutils-with-gold-2.46.50-48997323b0f.tar.xz) = 5aa0bb70d61d70fb30565c42b770841ce9de65c9bb635f427e53762941dcc659ccfec9a227952745754b5bf8519b51d50df9f6ac051176c635bdbf429d7bc284
SHA512 (binutils-with-gold-2.46.50-f85ff0c4bce.tar.xz) = 8dd6f2dcb7d097c5e26793957f62f6209090fe037eb481e29ad6d3757aa75d4cabab662f13ec6238282c930b37df0492ae0495c5956c57140c826678d1977400
SHA512 (binutils-2.19.50.0.1-output-format.sed) = 2f8686b0c8af13c98cda056824c2820416f6e2d003f70b78ccf5314525b9ee3684d421dfa83e638a2d42d06ea4d4bdaf5226b64d6ec26f7ff59c44ffb2a23dd2