aboutsummaryrefslogtreecommitdiff
path: root/ld/ldmisc.c
diff options
context:
space:
mode:
authorDavid MacKenzie <djm@cygnus>1994-02-17 18:12:17 +0000
committerDavid MacKenzie <djm@cygnus>1994-02-17 18:12:17 +0000
commit5bcb7f28e189de403b9efaffe57fec3221f9d16e (patch)
treeea8d833210cf45dde1f377c32ffaad66ac236683 /ld/ldmisc.c
parent7681bc7b30b1ec5006484d892121ce6c0059442a (diff)
downloadgdb-5bcb7f28e189de403b9efaffe57fec3221f9d16e.zip
gdb-5bcb7f28e189de403b9efaffe57fec3221f9d16e.tar.gz
gdb-5bcb7f28e189de403b9efaffe57fec3221f9d16e.tar.bz2
* ldlang.c, ldmain.c, ldmisc.c: Use bfd_get_error and
bfd_set_error and new error names.
Diffstat (limited to 'ld/ldmisc.c')
-rw-r--r--ld/ldmisc.c64
1 files changed, 6 insertions, 58 deletions
diff --git a/ld/ldmisc.c b/ld/ldmisc.c
index 94d87f0..4239600 100644
--- a/ld/ldmisc.c
+++ b/ld/ldmisc.c
@@ -1,5 +1,5 @@
/* ldmisc.c
- Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1991, 92, 93, 94 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
@@ -170,7 +170,7 @@ vfinfo(fp, fmt, arg)
case 'E':
/* current bfd error or errno */
- fprintf(fp, bfd_errmsg(bfd_error));
+ fprintf(fp, bfd_errmsg(bfd_get_error ()));
break;
case 'I':
@@ -237,7 +237,7 @@ vfinfo(fp, fmt, arg)
unsigned int symbol_count;
symsize = get_symtab_upper_bound (abfd);
- asymbols = (asymbol **) ldmalloc (symsize);
+ asymbols = (asymbol **) xmalloc (symsize);
symbol_count = bfd_canonicalize_symtab (abfd, asymbols);
if (entry != (lang_input_statement_type *) NULL)
{
@@ -280,16 +280,7 @@ vfinfo(fp, fmt, arg)
}
if (fatal == true)
- {
- if (output_filename)
- {
- if (output_bfd && output_bfd->iostream)
- fclose((FILE *)(output_bfd->iostream));
- if (delete_output_file_on_failure)
- unlink (output_filename);
- }
- exit(1);
- }
+ xexit(1);
}
/* Format info message and print on stdout. */
@@ -370,7 +361,7 @@ concat (s1, s2, s3)
size_t len1 = strlen (s1);
size_t len2 = strlen (s2);
size_t len3 = strlen (s3);
- char *result = ldmalloc (len1 + len2 + len3 + 1);
+ char *result = xmalloc (len1 + len2 + len3 + 1);
if (len1 != 0)
memcpy(result, s1, len1);
@@ -383,55 +374,12 @@ concat (s1, s2, s3)
return result;
}
-
-PTR
-ldmalloc (size)
- size_t size;
-{
- PTR result = malloc ((int)size);
-
- if (result == (char *)NULL && size != 0)
- einfo("%F%P: virtual memory exhausted\n");
-
- return result;
-}
-
-PTR
-xmalloc (size)
- int size;
-{
- return ldmalloc ((size_t) size);
-}
-
-
-PTR
-ldrealloc (ptr, size)
- PTR ptr;
- size_t size;
-{
- PTR result = realloc (ptr, (int)size);
-
- if (result == (char *)NULL && size != 0)
- einfo("%F%P: virtual memory exhausted\n");
-
- return result;
-}
-
-PTR
-xrealloc (ptr, size)
- PTR ptr;
- int size;
-{
- return ldrealloc (ptr, (size_t) size);
-}
-
-
char *
buystring (x)
CONST char *CONST x;
{
size_t l = strlen(x)+1;
- char *r = ldmalloc(l);
+ char *r = xmalloc(l);
memcpy(r, x,l);
return r;
}