]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
fix seg fault in reloc reading code
authorNick Clifton <nickc@redhat.com>
Sun, 11 Feb 2001 22:14:01 +0000 (22:14 +0000)
committerNick Clifton <nickc@redhat.com>
Sun, 11 Feb 2001 22:14:01 +0000 (22:14 +0000)
binutils/ChangeLog
binutils/readelf.c

index 23d4df10d32a5370d85b81a251ddba614a2518ad..045e11a5efed28910b9edff507bf26e24e1a28c1 100644 (file)
@@ -1,3 +1,9 @@
+2001-02-11  Nick Clifton  <nickc@redhat.com>
+
+       * readelf.c (dump_relocations): Free corrected allocated
+       array.
+       (process_unwind): Fix compile time warning.
+
 2001-02-10  Nick Clifton  <nickc@redhat.com>
 
        * binutils.texi: Document new --unwind option to readelf.
index 1f18a05487b941fef06eb9e52fe6232e29d844bb..923403a73429c7ae82a435a0e9181bb03c115d73 100644 (file)
@@ -997,7 +997,10 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela)
       putchar ('\n');
     }
 
-  free (relas);
+  if (is_rela)
+    free (relas);
+  else
+    free (rels);
 
   return 1;
 }
@@ -3412,7 +3415,7 @@ process_unwind (file)
        printf ("'%s'", SECTION_NAME (unwsec));
 
       printf (_(" at offset 0x%lx contains %lu entries:\n"),
-             unwsec->sh_offset, unwsec->sh_size / (3 * addr_size));
+             unwsec->sh_offset, (unsigned long) (unwsec->sh_size / (3 * addr_size)));
 
       (void) slurp_ia64_unwind_table (file, & aux, unwsec);