[binutils-gdb/binutils-2_47-branch] bfd/ELF: Fix writing of secondary reloc sections

Jan Beulich jbeulich@sourceware.org
Mon Nov 16 07:37:54 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a18e9a7ed306dcde18dbf3cacbcaa2fb17077a3e

commit a18e9a7ed306dcde18dbf3cacbcaa2fb17077a3e
Author: Antoine Damhet <adamhet@scaleway.com>
Date:   Mon Nov 16 08:33:28 2026 +0100

    bfd/ELF: Fix writing of secondary reloc sections
    
    Commit eb92a17c47ea ("bfd: move sec_info from ELF to general section
    struct") introduced a typo in '_bfd_elf_write_secondary_reloc_section'
    that made the internal relocations of secondary reloc sections
    incorrectly looked up.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34970
    Signed-off-by: Antoine Damhet <adamhet@scaleway.com>

Diff:
---
 bfd/elf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bfd/elf.c b/bfd/elf.c
index 6c31dabae63..ace602481b6 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -13984,7 +13984,7 @@ _bfd_elf_write_secondary_reloc_section (bfd *abfd, asection *sec)
 	  last_sym = NULL;
 	  last_sym_idx = 0;
 	  dst_rela = hdr->contents;
-	  src_irel = sec->sec_info;
+	  src_irel = relsec->sec_info;
 	  if (src_irel == NULL)
 	    {
 	      _bfd_error_handler


More information about the Binutils-cvs mailing list