Fix the loading of the dynamic string table in a file without sections.
authorNick Clifton <nickc@redhat.com>
Thu, 12 Apr 2018 14:41:07 +0000 (15:41 +0100)
committerNick Clifton <nickc@redhat.com>
Thu, 12 Apr 2018 14:41:07 +0000 (15:41 +0100)
PR 23050
* readelf.c (process_dynamic_section): Correct dynamic string
table size calculation.

binutils/ChangeLog
binutils/readelf.c

index e95fa85a6c4892a3f6c54580b59ae70bb51db9a7..88e4b569acabd516677a524607f62e7de9e4848a 100644 (file)
@@ -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.
index 166dd23383e3622a3f448cb9e962f8417e191853..4b6f9fc8ac610408223530c8649bcfaab7e08ecd 100644 (file)
@@ -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)
            {