aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-11-19 17:36:24 +0000
committerNick Clifton <nickc@redhat.com>2020-11-19 17:36:24 +0000
commita4eba6087d4cec81f8b41477b4da56ff87b88e91 (patch)
treebaabbcc8c0610795c87b07a15a829cf2203e8283
parenta5adb8f3b40184cfe8f0bfd362ba1d37d780d62f (diff)
downloadbinutils-a4eba6087d4cec81f8b41477b4da56ff87b88e91.zip
binutils-a4eba6087d4cec81f8b41477b4da56ff87b88e91.tar.gz
binutils-a4eba6087d4cec81f8b41477b4da56ff87b88e91.tar.bz2
Fix a bug in the s390x linker when discarding all inpuit files.
PR 26918 * elf64-s390.c (elf_s390_finish_dynamic_sections): Check for the existance of an sgot output section before setting the sh_entsize.
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf64-s390.c5
2 files changed, 10 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index a23da61..2aa89d0 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2020-11-19 Nick Clifton <nickc@redhat.com>
+
+ PR 26918
+ * elf64-s390.c (elf_s390_finish_dynamic_sections): Check for the
+ existance of an sgot output section before setting the
+ sh_entsize.
+
2020-11-18 Jozef Lawrynowicz <jozef.l@mittosystems.com>
H.J. Lu <hongjiu.lu@intel.com>
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 0522850..41b19bc 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -3547,8 +3547,9 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd,
bfd_put_64 (output_bfd, (bfd_vma) 0,
htab->elf.hgot->root.u.def.section->contents + 16);
}
- elf_section_data (htab->elf.sgot->output_section)
- ->this_hdr.sh_entsize = 8;
+ if (elf_section_data (htab->elf.splt->output_section) != NULL)
+ elf_section_data (htab->elf.sgot->output_section)
+ ->this_hdr.sh_entsize = 8;
}
/* Finish dynamic symbol for local IFUNC symbols. */