* binutils-2_28-branch: Fix segfault when .plt section does not exist
@ 2017-02-08 2:14 Palmer Dabbelt
2017-02-08 2:14 ` [PATCH] " Palmer Dabbelt
0 siblings, 1 reply; 2+ messages in thread
From: Palmer Dabbelt @ 2017-02-08 2:14 UTC (permalink / raw)
To: gingold, binutils
Is this OK for the 2.28 branch?
[PATCH] Fix segfault when .plt section does not exist
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] Fix segfault when .plt section does not exist
2017-02-08 2:14 binutils-2_28-branch: Fix segfault when .plt section does not exist Palmer Dabbelt
@ 2017-02-08 2:14 ` Palmer Dabbelt
0 siblings, 0 replies; 2+ messages in thread
From: Palmer Dabbelt @ 2017-02-08 2:14 UTC (permalink / raw)
To: gingold, binutils; +Cc: Andrew Waterman
From: Andrew Waterman <andrew@sifive.com>
bfd/ChangeLog
2017-02-07 Andrew Waterman <andrew@sifive.com>
* elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
entry size if PLT header is written.
---
bfd/ChangeLog | 5 +++++
bfd/elfnn-riscv.c | 6 +++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 244d190..6c21e77 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2017-02-07 Andrew Waterman <andrew@sifive.com>
+
+ * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
+ entry size if PLT header is written.
+
2017-02-03 Alan Modra <amodra@gmail.com>
* elf32-hppa.c (ensure_undef_weak_dynamic): New function.
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index f414429..210007d 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -2502,10 +2502,10 @@ riscv_elf_finish_dynamic_sections (bfd *output_bfd,
for (i = 0; i < PLT_HEADER_INSNS; i++)
bfd_put_32 (output_bfd, plt_header[i], splt->contents + 4*i);
- }
- elf_section_data (splt->output_section)->this_hdr.sh_entsize
- = PLT_ENTRY_SIZE;
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize
+ = PLT_ENTRY_SIZE;
+ }
}
if (htab->elf.sgotplt)
--
2.10.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-02-08 2:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-08 2:14 binutils-2_28-branch: Fix segfault when .plt section does not exist Palmer Dabbelt
2017-02-08 2:14 ` [PATCH] " Palmer Dabbelt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).