aboutsummaryrefslogtreecommitdiff
path: root/bfd/archive.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-07-22 23:02:35 +0000
committerIan Lance Taylor <ian@airs.com>1996-07-22 23:02:35 +0000
commitbf9884d41d4604d287ce495d1b0b87b028805951 (patch)
treea699f84f53e048f5737b5d1c1e3a384275ed10c5 /bfd/archive.c
parent1cfe12f298b76b8c6c78a394d2a050b5f0b17dd4 (diff)
downloadgdb-bf9884d41d4604d287ce495d1b0b87b028805951.zip
gdb-bf9884d41d4604d287ce495d1b0b87b028805951.tar.gz
gdb-bf9884d41d4604d287ce495d1b0b87b028805951.tar.bz2
* elf64-mips.c: Include "aout/ar.h".
(mips_elf64_slurp_armap): New static function. (mips_elf64_write_armap): New static function. (bfd_elf64_archive_*): Define. * elfxx-target.h (bfd_elfNN_archive_p): Define if not defined. Use instead of bfd_generic_archive_p. (bfd_elfNN_write_archive_contents): Define if not defined. Use instead of _bfd_write_archive_contents. (bfd_elfNN_mkdarchive): Define if not defined. Use instead of _bfd_generic_mkarchive. (TARGET_BIG_SYM): If bfd_elfNN_archive_functions is defined, use bfd_elfNN_archive in BFD_JUMP_TABLE_ARCHIVE rather than _bfd_archive_coff. (TARGET_LITTLE_SYM): Likewise. * archive.c (bfd_slurp_armap): Check for and reject an archive map name of /SYM64/. * Makefile.in: Rebuild dependencies.
Diffstat (limited to 'bfd/archive.c')
-rw-r--r--bfd/archive.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/bfd/archive.c b/bfd/archive.c
index 50f5be7..3760410 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -1,5 +1,5 @@
/* BFD back-end for archive files (libraries).
- Copyright 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault.
This file is part of BFD, the Binary File Descriptor library.
@@ -661,9 +661,11 @@ bfd_generic_archive_p (abfd)
bfd *first;
/* This archive has a map, so we may presume that the contents
- are object files. Make sure that the first file in the
- archive can be recognized as an object file for this target.
- If not, assume that this is the wrong format.
+ are object files. Make sure that if the first file in the
+ archive can be recognized as an object file, it is for this
+ target. If not, assume that this is the wrong format. If
+ the first file is not an object file, somebody is doing
+ something weird, and we permit it so that ar -t will work.
This is done because any normal format will recognize any
normal archive, regardless of the format of the object files.
@@ -676,22 +678,13 @@ bfd_generic_archive_p (abfd)
first->target_defaulted = false;
fail = false;
- if (! bfd_check_format (first, bfd_object))
- fail = true;
- else if (first->xvec != abfd->xvec)
+ if (bfd_check_format (first, bfd_object)
+ && first->xvec != abfd->xvec)
{
- bfd_set_error (bfd_error_wrong_format);
- fail = true;
- }
- if (fail)
- {
- bfd_error_type err;
-
- err = bfd_get_error ();
(void) bfd_close (first);
bfd_release (abfd, bfd_ardata (abfd));
abfd->tdata.aout_ar_data = tdata_hold;
- bfd_set_error (err);
+ bfd_set_error (bfd_error_wrong_format);
return NULL;
}
@@ -937,6 +930,12 @@ bfd_slurp_armap (abfd)
return do_slurp_bsd_armap (abfd);
else if (!strncmp (nextname, "/ ", 16))
return do_slurp_coff_armap (abfd);
+ else if (!strncmp (nextname, "/SYM64/ ", 16))
+ {
+ /* Irix 6 archive--must be recognized by code in elf64-mips.c. */
+ bfd_set_error (bfd_error_wrong_format);
+ return false;
+ }
bfd_has_map (abfd) = false;
return true;