]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
s390: Check sreldynrelro in elf_s390_finish_dynamic_symbol
authorJens Remus <jremus@linux.ibm.com>
Fri, 14 Nov 2025 08:42:13 +0000 (09:42 +0100)
committerJens Remus <jremus@linux.ibm.com>
Fri, 14 Nov 2025 08:42:13 +0000 (09:42 +0100)
Add check for sreldynrelro being NULL, introduced by commit 5474d94f03ae
("dynrelro section for read-only dynamic symbols copied into
executable") in elf32-s390.c function elf_s390_finish_dynamic_symbol,
also to its elf64-s390.c counterpart.

Found while inspecting and cleaning up differences between elf32-s390.c
and elf64-s390.c.

bfd/
* elf64-s390.c (elf_s390_finish_dynamic_symbol): Add
sreldynrelro check from elf32-s390.c.

Fixes: 5474d94f03ae ("dynrelro section for read-only dynamic symbols copied into executable")
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
bfd/elf64-s390.c

index f72df9f4e12282c514da5f1a9336a3119ee3b243..f5a80e73f11353dbbe734c2b34e771521d0434af 100644 (file)
@@ -3773,7 +3773,8 @@ elf_s390_finish_dynamic_symbol (bfd *output_bfd,
       if (h->dynindx == -1
          || (h->root.type != bfd_link_hash_defined
              && h->root.type != bfd_link_hash_defweak)
-         || htab->elf.srelbss == NULL)
+         || htab->elf.srelbss == NULL
+         || htab->elf.sreldynrelro == NULL)
        abort ();
 
       rela.r_offset = (h->root.u.def.value