This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Fix the loading of the dynamic string table in a file without sections.
- From: Nick Clifton <nickc at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 12 Apr 2018 14:41:56 -0000
- Subject: [binutils-gdb] Fix the loading of the dynamic string table in a file without sections.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=86c6c6df007cee29f4a723df1a6af1889183fb2e
commit 86c6c6df007cee29f4a723df1a6af1889183fb2e
Author: Nick Clifton <nickc@redhat.com>
Date: Thu Apr 12 15:41:07 2018 +0100
Fix the loading of the dynamic string table in a file without sections.
PR 23050
* readelf.c (process_dynamic_section): Correct dynamic string
table size calculation.
Diff:
---
binutils/ChangeLog | 6 ++++++
binutils/readelf.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index e95fa85..88e4b56 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2018-04-12 Nick Clifton <nickc@redhat.com>
+
+ PR 23050
+ * readelf.c (process_dynamic_section): Correct dynamic string
+ table size calculation.
+
2018-04-11 Alan Modra <amodra@gmail.com>
* ieee.c: Remove i960 support.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 166dd23..4b6f9fc 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -9639,7 +9639,7 @@ process_dynamic_section (Filedata * filedata)
if (archive_file_offset != 0)
str_tab_len = archive_file_size - offset;
else
- str_tab_len = filedata->file_size;
+ str_tab_len = filedata->file_size - offset;
if (str_tab_len < 1)
{