BFD_JUMP_TABLE_ARCHIVE accordingly.
* libbfd-in.h (_bfd_snarf_ar_hdr): Don't declare.
(_bfd_compute_and_write_armap): Declare.
(_bfd_generic_read_ar_hdr): Declare.
(_bfd_read_ar_hdr): Define.
(_bfd_noarchive_read_ar_hdr): Define.
(_bfd_archive_bsd_read_ar_hdr): Define.
(_bfd_archive_coff_read_ar_hdr): Define.
* archive.c: Change all callers of _bfd_snarf_ar_hdr to call
_bfd_read_ar_hdr instead.
(_bfd_generic_read_ar_hdr): Rename from _bfd_snarf_ar_hdr.
(_bfd_compute_and_write_armap): Rename from
compute_and_write_armap. Make non-static. Change all callers.
* ecoff.c (_bfd_ecoff_slurp_armap): Call _bfd_read_ar_hdr rather
than _bfd_snarf_ar_hdr.
* aout-target.h (MY_read_ar_hdr): Define if not defined.
* ieee.c (ieee_read_ar_hdr): Define.
* libecoff.h (_bfd_ecoff_read_ar_hdr): Define.
* oasys.c (oasys_read_ar_hdr): Define.
* som.c (som_read_ar_hdr): Define.
* bfd-in2.h, libbfd.h: Rebuild.
+Fri Oct 6 12:04:02 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-rs6000.c: Add full support for AIX archives. Rewrite old
+ read-only/host-only support.
+
+ * coffcode.h (coff_slurp_symbol_table): Set C_HIDEXT symbols to be
+ BSF_LOCAL.
+
+ * targets.c (bfd_target): Add _bfd_read_ar_hdr field. Modify
+ BFD_JUMP_TABLE_ARCHIVE accordingly.
+ * libbfd-in.h (_bfd_snarf_ar_hdr): Don't declare.
+ (_bfd_compute_and_write_armap): Declare.
+ (_bfd_generic_read_ar_hdr): Declare.
+ (_bfd_read_ar_hdr): Define.
+ (_bfd_noarchive_read_ar_hdr): Define.
+ (_bfd_archive_bsd_read_ar_hdr): Define.
+ (_bfd_archive_coff_read_ar_hdr): Define.
+ * archive.c: Change all callers of _bfd_snarf_ar_hdr to call
+ _bfd_read_ar_hdr instead.
+ (_bfd_generic_read_ar_hdr): Rename from _bfd_snarf_ar_hdr.
+ (_bfd_compute_and_write_armap): Rename from
+ compute_and_write_armap. Make non-static. Change all callers.
+ * ecoff.c (_bfd_ecoff_slurp_armap): Call _bfd_read_ar_hdr rather
+ than _bfd_snarf_ar_hdr.
+ * aout-target.h (MY_read_ar_hdr): Define if not defined.
+ * ieee.c (ieee_read_ar_hdr): Define.
+ * libecoff.h (_bfd_ecoff_read_ar_hdr): Define.
+ * oasys.c (oasys_read_ar_hdr): Define.
+ * som.c (som_read_ar_hdr): Define.
+ * bfd-in2.h, libbfd.h: Rebuild.
+
Thu Oct 5 14:04:07 1995 steve chamberlain <sac@slash.cygnus.com>
* peicode.c (coff_swap_filehdr_in): If symptr is
static const char *normalize PARAMS ((bfd *, const char *file));
static struct areltdata *bfd_ar_hdr_from_filesystem PARAMS ((bfd *abfd,
const char *));
-static boolean compute_and_write_armap PARAMS ((bfd *arch,
- unsigned int elength));
\f
boolean
_bfd_generic_mkarchive (abfd)
could have been moved arbitrarily.
*/
-struct areltdata *
-_bfd_snarf_ar_hdr (abfd)
+PTR
+_bfd_generic_read_ar_hdr (abfd)
bfd *abfd;
{
#ifndef errno
ared->filename[namelen] = '\0';
}
- return ared;
+ return (PTR) ared;
}
\f
/* This is an internal function; it's mainly used when indexing
if (0 > bfd_seek (archive, filepos, SEEK_SET))
return NULL;
- if ((new_areldata = _bfd_snarf_ar_hdr (archive)) == NULL)
+ if ((new_areldata = _bfd_read_ar_hdr (archive)) == NULL)
return NULL;
n_nfd = _bfd_create_empty_archive_element_shell (archive);
unsigned int parsed_size;
carsym *set;
- mapdata = _bfd_snarf_ar_hdr (abfd);
+ mapdata = _bfd_read_ar_hdr (abfd);
if (mapdata == NULL)
return false;
parsed_size = mapdata->parsed_size;
char int_buf[sizeof (long)];
unsigned int carsym_size, ptrsize, i;
- mapdata = _bfd_snarf_ar_hdr (abfd);
+ mapdata = _bfd_read_ar_hdr (abfd);
if (mapdata == NULL)
return false;
parsed_size = mapdata->parsed_size;
struct areltdata *tmp;
bfd_seek (abfd, ardata->first_file_filepos, SEEK_SET);
- tmp = _bfd_snarf_ar_hdr (abfd);
+ tmp = _bfd_read_ar_hdr (abfd);
if (tmp != NULL)
{
if (tmp->arch_header[0] == '/'
return true;
}
- mapdata = _bfd_snarf_ar_hdr (abfd);
+ mapdata = _bfd_read_ar_hdr (abfd);
if (mapdata == NULL)
return false;
return true;
}
- namedata = _bfd_snarf_ar_hdr (abfd);
+ namedata = _bfd_read_ar_hdr (abfd);
if (namedata == NULL)
return false;
if (makemap && hasobjects)
{
- if (compute_and_write_armap (arch, elength) != true)
+ if (_bfd_compute_and_write_armap (arch, elength) != true)
return false;
}
{
if (bfd_update_armap_timestamp (arch))
break;
- fprintf (stderr,
- "Warning: writing archive was slow: rewriting timestamp\n");
+ (*_bfd_error_handler)
+ ("Warning: writing archive was slow: rewriting timestamp\n");
}
while (++tries < 6);
}
\f
/* Note that the namidx for the first symbol is 0 */
-static boolean
-compute_and_write_armap (arch, elength)
+boolean
+_bfd_compute_and_write_armap (arch, elength)
bfd *arch;
unsigned int elength;
{
#if defined (__GNUG__) && (__GNUC_MINOR__ > 5)
#define TRUE_FALSE_ALREADY_DEFINED
#endif
+#ifdef MPW
+/* Pre-emptive strike - get the file with the enum. */
+#include <Types.h>
+#define TRUE_FALSE_ALREADY_DEFINED
+#endif /* MPW */
#ifndef TRUE_FALSE_ALREADY_DEFINED
typedef enum bfd_boolean {false, true} boolean;
#define BFD_TRUE_FALSE
CAT(NAME,_construct_extended_name_table),\
CAT(NAME,_truncate_arname),\
CAT(NAME,_write_armap),\
+CAT(NAME,_read_ar_hdr),\
CAT(NAME,_openr_next_archived_file),\
CAT(NAME,_generic_stat_arch_elt),\
CAT(NAME,_update_armap_timestamp)
struct orl *map,
unsigned int orl_count,
int stridx));
+ PTR (*_bfd_read_ar_hdr) PARAMS ((bfd *));
bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev));
int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *));
bfd * _bfd_look_for_bfd_in_cache PARAMS ((bfd *arch_bfd, file_ptr index));
boolean _bfd_add_bfd_to_archive_cache PARAMS ((bfd *, file_ptr, bfd *));
boolean _bfd_generic_mkarchive PARAMS ((bfd *abfd));
-struct areltdata *_bfd_snarf_ar_hdr PARAMS ((bfd *abfd));
const bfd_target *bfd_generic_archive_p PARAMS ((bfd *abfd));
boolean bfd_slurp_armap PARAMS ((bfd *abfd));
boolean bfd_slurp_bsd_armap_f2 PARAMS ((bfd *abfd));
extern boolean _bfd_construct_extended_name_table
PARAMS ((bfd *, boolean, char **, bfd_size_type *));
boolean _bfd_write_archive_contents PARAMS ((bfd *abfd));
+boolean _bfd_compute_and_write_armap PARAMS ((bfd *, unsigned int elength));
bfd *_bfd_get_elt_at_filepos PARAMS ((bfd *archive, file_ptr filepos));
bfd * _bfd_new_bfd PARAMS ((void));
boolean coff_write_armap PARAMS ((bfd *arch, unsigned int elength,
struct orl *map, unsigned int orl_count, int stridx));
+extern PTR _bfd_generic_read_ar_hdr PARAMS ((bfd *));
+
bfd * bfd_generic_openr_next_archived_file PARAMS ((bfd *archive,
bfd *last_file));
int bfd_generic_stat_arch_elt PARAMS ((bfd *, struct stat *));
+#define _bfd_read_ar_hdr(abfd) \
+ BFD_SEND (abfd, _bfd_read_ar_hdr, (abfd))
\f
/* Generic routines to use for BFD_JUMP_TABLE_GENERIC. Use
BFD_JUMP_TABLE_GENERIC (_bfd_generic). */
((boolean (*) \
PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int))) \
bfd_false)
+#define _bfd_noarchive_read_ar_hdr bfd_nullvoidptr
#define _bfd_noarchive_openr_next_archived_file \
((bfd *(*) PARAMS ((bfd *, bfd *))) bfd_nullvoidptr)
#define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt
PARAMS ((bfd *, char **, bfd_size_type *, const char **));
#define _bfd_archive_bsd_truncate_arname bfd_bsd_truncate_arname
#define _bfd_archive_bsd_write_armap bsd_write_armap
+#define _bfd_archive_bsd_read_ar_hdr _bfd_generic_read_ar_hdr
#define _bfd_archive_bsd_openr_next_archived_file \
bfd_generic_openr_next_archived_file
#define _bfd_archive_bsd_generic_stat_arch_elt \
PARAMS ((bfd *, char **, bfd_size_type *, const char **));
#define _bfd_archive_coff_truncate_arname bfd_dont_truncate_arname
#define _bfd_archive_coff_write_armap coff_write_armap
+#define _bfd_archive_coff_read_ar_hdr _bfd_generic_read_ar_hdr
#define _bfd_archive_coff_openr_next_archived_file \
bfd_generic_openr_next_archived_file
#define _bfd_archive_coff_generic_stat_arch_elt \
#define bfd_read_p(abfd) ((abfd)->direction == read_direction || (abfd)->direction == both_direction)
#define bfd_write_p(abfd) ((abfd)->direction == write_direction || (abfd)->direction == both_direction)
-void bfd_assert PARAMS ((char*,int));
+void bfd_assert PARAMS ((const char*,int));
#define BFD_ASSERT(x) \
{ if (!(x)) bfd_assert(__FILE__,__LINE__); }
extern const bfd_target * const bfd_target_vector[];
extern const bfd_target * const bfd_default_vector[];
-/* A function shared by the ECOFF and MIPS ELF backends, which have no
+/* Functions shared by the ECOFF and MIPS ELF backends, which have no
other common header files. */
#if defined(__STDC__) || defined(ALMOST_STDC)
struct ecoff_find_line;
#endif
-extern boolean
-_bfd_ecoff_locate_line
+extern boolean _bfd_ecoff_locate_line
PARAMS ((bfd *, asection *, bfd_vma, struct ecoff_debug_info * const,
const struct ecoff_debug_swap * const, struct ecoff_find_line *,
const char **, const char **, unsigned int *));
+extern boolean _bfd_ecoff_get_accumulated_pdr PARAMS ((PTR, bfd_byte *));
+extern boolean _bfd_ecoff_get_accumulated_sym PARAMS ((PTR, bfd_byte *));
+extern boolean _bfd_ecoff_get_accumulated_ss PARAMS ((PTR, bfd_byte *));
/* And more follows */
bfd * _bfd_look_for_bfd_in_cache PARAMS ((bfd *arch_bfd, file_ptr index));
boolean _bfd_add_bfd_to_archive_cache PARAMS ((bfd *, file_ptr, bfd *));
boolean _bfd_generic_mkarchive PARAMS ((bfd *abfd));
-struct areltdata *_bfd_snarf_ar_hdr PARAMS ((bfd *abfd));
const bfd_target *bfd_generic_archive_p PARAMS ((bfd *abfd));
boolean bfd_slurp_armap PARAMS ((bfd *abfd));
boolean bfd_slurp_bsd_armap_f2 PARAMS ((bfd *abfd));
extern boolean _bfd_construct_extended_name_table
PARAMS ((bfd *, boolean, char **, bfd_size_type *));
boolean _bfd_write_archive_contents PARAMS ((bfd *abfd));
+boolean _bfd_compute_and_write_armap PARAMS ((bfd *, unsigned int elength));
bfd *_bfd_get_elt_at_filepos PARAMS ((bfd *archive, file_ptr filepos));
bfd * _bfd_new_bfd PARAMS ((void));
boolean coff_write_armap PARAMS ((bfd *arch, unsigned int elength,
struct orl *map, unsigned int orl_count, int stridx));
+extern PTR _bfd_generic_read_ar_hdr PARAMS ((bfd *));
+
bfd * bfd_generic_openr_next_archived_file PARAMS ((bfd *archive,
bfd *last_file));
int bfd_generic_stat_arch_elt PARAMS ((bfd *, struct stat *));
+#define _bfd_read_ar_hdr(abfd) \
+ BFD_SEND (abfd, _bfd_read_ar_hdr, (abfd))
\f
/* Generic routines to use for BFD_JUMP_TABLE_GENERIC. Use
BFD_JUMP_TABLE_GENERIC (_bfd_generic). */
((boolean (*) \
PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int))) \
bfd_false)
+#define _bfd_noarchive_read_ar_hdr bfd_nullvoidptr
#define _bfd_noarchive_openr_next_archived_file \
((bfd *(*) PARAMS ((bfd *, bfd *))) bfd_nullvoidptr)
#define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt
PARAMS ((bfd *, char **, bfd_size_type *, const char **));
#define _bfd_archive_bsd_truncate_arname bfd_bsd_truncate_arname
#define _bfd_archive_bsd_write_armap bsd_write_armap
+#define _bfd_archive_bsd_read_ar_hdr _bfd_generic_read_ar_hdr
#define _bfd_archive_bsd_openr_next_archived_file \
bfd_generic_openr_next_archived_file
#define _bfd_archive_bsd_generic_stat_arch_elt \
PARAMS ((bfd *, char **, bfd_size_type *, const char **));
#define _bfd_archive_coff_truncate_arname bfd_dont_truncate_arname
#define _bfd_archive_coff_write_armap coff_write_armap
+#define _bfd_archive_coff_read_ar_hdr _bfd_generic_read_ar_hdr
#define _bfd_archive_coff_openr_next_archived_file \
bfd_generic_openr_next_archived_file
#define _bfd_archive_coff_generic_stat_arch_elt \
#define bfd_read_p(abfd) ((abfd)->direction == read_direction || (abfd)->direction == both_direction)
#define bfd_write_p(abfd) ((abfd)->direction == write_direction || (abfd)->direction == both_direction)
-void bfd_assert PARAMS ((char*,int));
+void bfd_assert PARAMS ((const char*,int));
#define BFD_ASSERT(x) \
{ if (!(x)) bfd_assert(__FILE__,__LINE__); }
.CAT(NAME,_construct_extended_name_table),\
.CAT(NAME,_truncate_arname),\
.CAT(NAME,_write_armap),\
+.CAT(NAME,_read_ar_hdr),\
.CAT(NAME,_openr_next_archived_file),\
.CAT(NAME,_generic_stat_arch_elt),\
.CAT(NAME,_update_armap_timestamp)
. struct orl *map,
. unsigned int orl_count,
. int stridx));
+. PTR (*_bfd_read_ar_hdr) PARAMS ((bfd *));
. bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev));
. int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
. boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *));
extern const bfd_target oasys_vec;
extern const bfd_target pc532machaout_vec;
extern const bfd_target riscix_vec;
+extern const bfd_target pmac_xcoff_vec;
extern const bfd_target rs6000coff_vec;
extern const bfd_target shcoff_vec;
/* start-sanitize-rce */
&aout_arm_big_vec,
&aout_arm_little_vec,
&riscix_vec,
+#endif
+#if 0
+ /* This has the same magic number as RS/6000. */
+ &pmac_xcoff_vec,
#endif
&rs6000coff_vec,
&shcoff_vec,