aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1994-04-22 05:59:24 +0000
committerStu Grossman <grossman@cygnus>1994-04-22 05:59:24 +0000
commit7f772644c7633b808ff13e36d7034497f2d310d8 (patch)
tree48fab936de09e6ad9eda0606368ef1962d9f7bee /bfd
parentde04bcebc013768208f4e750476005a5aab25b53 (diff)
downloadfsf-binutils-gdb-7f772644c7633b808ff13e36d7034497f2d310d8.zip
fsf-binutils-gdb-7f772644c7633b808ff13e36d7034497f2d310d8.tar.gz
fsf-binutils-gdb-7f772644c7633b808ff13e36d7034497f2d310d8.tar.bz2
* nlmcode.h (nlm_swap_auxiliary_headers_in): Keep section table
(from CyGnUsSeCs) in more permanent memory to keep section names from getting trashed.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/nlmcode.h14
2 files changed, 10 insertions, 10 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 583288d..522e4cb 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+Thu Apr 21 22:54:22 1994 Stu Grossman (grossman at cygnus.com)
+
+ * nlmcode.h (nlm_swap_auxiliary_headers_in): Keep section table
+ (from CyGnUsSeCs) in more permanent memory to keep section names
+ from getting trashed.
+
Thu Apr 21 09:29:37 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* libelf.h (elf_obj_tdata): Add members for dynamic symbol table
diff --git a/bfd/nlmcode.h b/bfd/nlmcode.h
index 6655a6f..63b2b5c 100644
--- a/bfd/nlmcode.h
+++ b/bfd/nlmcode.h
@@ -567,7 +567,8 @@ nlm_swap_auxiliary_headers_in (abfd)
is what we want to happen. The sections from the
original file, which may be subsets of the NLM section,
can only be found using bfd_map_over_sections. */
- contents = (bfd_byte *) malloc (len);
+
+ contents = (bfd_byte *) bfd_alloc (abfd, len);
if (contents == (bfd_byte *) NULL)
{
bfd_set_error (bfd_error_no_memory);
@@ -577,10 +578,7 @@ nlm_swap_auxiliary_headers_in (abfd)
if (bfd_seek (abfd, nlm_cygnus_section_header (abfd)->offset,
SEEK_SET) != 0
|| bfd_read (contents, len, 1, abfd) != len)
- {
- free (contents);
- return false;
- }
+ return false;
p = contents;
pend = p + len;
while (p < pend)
@@ -609,10 +607,7 @@ nlm_swap_auxiliary_headers_in (abfd)
newsec = bfd_make_section_anyway (abfd, name);
if (newsec == (asection *) NULL)
- {
- free (contents);
- return false;
- }
+ return false;
newsec->_raw_size = size;
if (filepos != 0)
{
@@ -621,7 +616,6 @@ nlm_swap_auxiliary_headers_in (abfd)
}
}
- free (contents);
if (bfd_seek (abfd, pos, SEEK_SET) != 0)
return false;
}