aboutsummaryrefslogtreecommitdiff
path: root/bfd/peicode.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-12-01 19:48:10 +0000
committerIan Lance Taylor <ian@airs.com>1995-12-01 19:48:10 +0000
commit58142f101dd3256f4741f60a6b25672d79b91371 (patch)
treee7ca6dd97a327093be2076160bebd1baaf20d8a4 /bfd/peicode.h
parent2eec871057c921ceb38fb0b7f3cd78e84b700808 (diff)
downloadgdb-58142f101dd3256f4741f60a6b25672d79b91371.zip
gdb-58142f101dd3256f4741f60a6b25672d79b91371.tar.gz
gdb-58142f101dd3256f4741f60a6b25672d79b91371.tar.bz2
* libbfd.c (bfd_malloc, bfd_realloc): New functions.
(bfd_zmalloc): Return PTR, not char *. Take size_t, not bfd_size_type. * libbfd-in.h (bfd_malloc, bfd_realloc): Declare. (bfd_zmalloc): Change declaration. * libbfd.h: Rebuild. * Many files: Use bfd_malloc and bfd_realloc rather than malloc and realloc. Don't set bfd_error_no_memory if they fail.
Diffstat (limited to 'bfd/peicode.h')
-rw-r--r--bfd/peicode.h23
1 files changed, 7 insertions, 16 deletions
diff --git a/bfd/peicode.h b/bfd/peicode.h
index 79c427e..8b66942 100644
--- a/bfd/peicode.h
+++ b/bfd/peicode.h
@@ -1160,13 +1160,10 @@ pe_print_idata(abfd, vfile)
bfd_byte *data = 0;
int offset;
- data = (bfd_byte *) malloc ((size_t) bfd_section_size (abfd,
- rel_section));
+ data = (bfd_byte *) bfd_malloc ((size_t) bfd_section_size (abfd,
+ rel_section));
if (data == NULL && bfd_section_size (abfd, rel_section) != 0)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
datasize = bfd_section_size (abfd, rel_section);
bfd_get_section_contents (abfd,
@@ -1204,13 +1201,10 @@ pe_print_idata(abfd, vfile)
if (bfd_section_size (abfd, section) == 0)
return true;
- data = (bfd_byte *) malloc ((size_t) bfd_section_size (abfd, section));
+ data = (bfd_byte *) bfd_malloc ((size_t) bfd_section_size (abfd, section));
datasize = bfd_section_size (abfd, section);
if (data == NULL && datasize != 0)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
bfd_get_section_contents (abfd,
section,
@@ -1363,13 +1357,10 @@ pe_print_pdata(abfd, vfile)
if (bfd_section_size (abfd, section) == 0)
return true;
- data = (bfd_byte *) malloc ((size_t) bfd_section_size (abfd, section));
+ data = (bfd_byte *) bfd_malloc ((size_t) bfd_section_size (abfd, section));
datasize = bfd_section_size (abfd, section);
if (data == NULL && datasize != 0)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
bfd_get_section_contents (abfd,
section,