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

Jan Beulich jbeulich@sourceware.org
Mon Nov 16 07:35:34 GMT 2026


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

commit 4ab647811ad1ff2eb00bb55d078cd052fcec3e5f
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 4fe5ee1495a..497d778f1fd 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -14012,7 +14012,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