[PATCH 1/2] bfd: Fix writing of secondary reloc sections

Antoine Damhet adamhet@scaleway.com
Mon Nov 9 12:31:46 GMT 2026


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>
---
 bfd/elf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bfd/elf.c b/bfd/elf.c
index e6699a5ffc90..b5c02e8f33fd 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

-- 
2.56.0



More information about the Binutils mailing list