diff options
author | David MacKenzie <djm@cygnus> | 1994-02-03 00:25:30 +0000 |
---|---|---|
committer | David MacKenzie <djm@cygnus> | 1994-02-03 00:25:30 +0000 |
commit | cef35d488209227385e0aa9ab92ebf5a861c3780 (patch) | |
tree | 3e79235f8af64d3e5f7320fbfa578141fc04d8b9 /binutils/ar.c | |
parent | b4bd2c92c50c3219a38f24e311688302dc886388 (diff) | |
download | gdb-cef35d488209227385e0aa9ab92ebf5a861c3780.zip gdb-cef35d488209227385e0aa9ab92ebf5a861c3780.tar.gz gdb-cef35d488209227385e0aa9ab92ebf5a861c3780.tar.bz2 |
* nlmconv.c (main), objcopy.c (copy_file): Print matching formats
if ambiguous match.
* nm.c (display_file), size.c (display_bfd): Eliminate gotos.
Print matching formats if there is an ambiguous match. Use
bfd_nonfatal instead of hardcoded error message if nothing matches.
* arsup.c, ar.c, objdump.c: Use bfd_get_filename instead of
abfd->filename.
* nm.c (display_archive): New function, from code in display_file.
(display_rel_file): Renamed from do_one_rel_file.
* size.c: Indent.
(display_archive): New function from code in display_file.
(display_file): Check bfd_close error return.
* strings.c (strings_object_file): Check bfd_check_format
error return.
* strings.c, objdump.c, size.c: Use bfd_nonfatal instead of bfd_perror.
* bucomm.c: Delete references to exit_handler. It wasn't set
anywhere, and now that we're using the libiberty xmalloc, it
wouldn't always get called before exiting.
(list_matching_formats): Function moved from objdump.c.
* bucomm.h: Declare it.
* objdump.c (disassemble_data): Move some variable decls closer to
their use. Add some comments. Replace a nested block with a
return.
Diffstat (limited to 'binutils/ar.c')
-rw-r--r-- | binutils/ar.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/binutils/ar.c b/binutils/ar.c index ec6b508..32d1de1 100644 --- a/binutils/ar.c +++ b/binutils/ar.c @@ -502,10 +502,10 @@ print_contents(abfd) struct stat buf; long size; if (bfd_stat_arch_elt(abfd, &buf) != 0) - fatal("internal stat error on %s", abfd->filename); + fatal("internal stat error on %s", bfd_get_filename (abfd)); if (verbose) - printf("\n<member %s>\n\n", abfd->filename); + printf("\n<member %s>\n\n", bfd_get_filename (abfd)); bfd_seek(abfd, 0, SEEK_SET); @@ -552,20 +552,20 @@ extract_file(abfd) long size; struct stat buf; if (bfd_stat_arch_elt(abfd, &buf) != 0) - fatal("internal stat error on %s", abfd->filename); + fatal("internal stat error on %s", bfd_get_filename (abfd)); size = buf.st_size; if (verbose) - printf("x - %s\n", abfd->filename); + printf("x - %s\n", bfd_get_filename (abfd)); bfd_seek(abfd, 0, SEEK_SET); ostream = 0; if (size == 0) { /* Seems like an abstraction violation, eh? Well it's OK! */ - ostream = fopen(abfd->filename, FOPEN_WB); + ostream = fopen(bfd_get_filename (abfd), FOPEN_WB); if (!ostream) { - perror(abfd->filename); + perror(bfd_get_filename (abfd)); exit(1); } } else @@ -581,9 +581,9 @@ extract_file(abfd) /* See comment above; this saves disk arm motion */ if (!ostream) { /* Seems like an abstraction violation, eh? Well it's OK! */ - ostream = fopen(abfd->filename, FOPEN_WB); + ostream = fopen(bfd_get_filename (abfd), FOPEN_WB); if (!ostream) { - perror(abfd->filename); + perror(bfd_get_filename (abfd)); exit(1); } } @@ -592,27 +592,27 @@ extract_file(abfd) } fclose(ostream); - chmod(abfd->filename, buf.st_mode); + chmod(bfd_get_filename (abfd), buf.st_mode); if (preserve_dates) { #ifdef POSIX_UTIME struct utimbuf tb; tb.actime = buf.st_mtime; tb.modtime = buf.st_mtime; - utime(abfd->filename, &tb); /* FIXME check result */ + utime(bfd_get_filename (abfd), &tb); /* FIXME check result */ #else /* ! POSIX_UTIME */ #ifdef USE_UTIME long tb[2]; tb[0] = buf.st_mtime; tb[1] = buf.st_mtime; - utime(abfd->filename, tb); /* FIXME check result */ + utime(bfd_get_filename (abfd), tb); /* FIXME check result */ #else /* ! USE_UTIME */ struct timeval tv[2]; tv[0].tv_sec = buf.st_mtime; tv[0].tv_usec = 0; tv[1].tv_sec = buf.st_mtime; tv[1].tv_usec = 0; - utimes(abfd->filename, tv); /* FIXME check result */ + utimes(bfd_get_filename (abfd), tv); /* FIXME check result */ #endif /* ! USE_UTIME */ #endif /* ! POSIX_UTIME */ } |