return arc1->ptr == arc2->ptr;
}
+/* The calloc function doesn't always take size_t (e.g. on VMS)
+ so wrap it to avoid a compile time warning. */
+
+static void *
+_bfd_calloc_wrapper (size_t a, size_t b)
+{
+ return calloc (a, b);
+}
+
/* Kind of stupid to call cons for each one, but we don't do too many. */
bfd_boolean
if (hash_table == NULL)
{
hash_table = htab_create_alloc (16, hash_file_ptr, eq_file_ptr,
- NULL, calloc, free);
+ NULL, _bfd_calloc_wrapper, free);
if (hash_table == NULL)
return FALSE;
bfd_ardata (arch_bfd)->cache = hash_table;
/* Append the relative pathname for a member of the thin archive
to the pathname of the directory containing the archive. */
-static char *
-append_relative_path (bfd *arch, char *elt_name)
+char *
+_bfd_append_relative_path (bfd *arch, char *elt_name)
{
const char *arch_name = arch->filename;
const char *base_name = lbasename (arch_name);
/* This is a proxy entry for an external file. */
if (! IS_ABSOLUTE_PATH (filename))
{
- filename = append_relative_path (archive, filename);
+ filename = _bfd_append_relative_path (archive, filename);
if (filename == NULL)
return NULL;
}
bfd *
bfd_openr_next_archived_file (bfd *archive, bfd *last_file)
{
+ bfd *abfd;
+
if ((bfd_get_format (archive) != bfd_archive)
|| (archive->direction == write_direction))
{
return NULL;
}
- return BFD_SEND (archive,
+ abfd = BFD_SEND (archive,
openr_next_archived_file, (archive, last_file));
+
+ /* Copy BFD_COMPRESS and BFD_DECOMPRESS flags. */
+ if (abfd)
+ abfd->flags |= archive->flags & (BFD_COMPRESS | BFD_DECOMPRESS);
+
+ return abfd;
}
bfd *
len = (len + 3) & ~3;
arch_eltdata (current)->extra_size = len;
- _bfd_ar_spacepad (hdr->ar_name, maxname, "#1/%u", len);
+ _bfd_ar_spacepad (hdr->ar_name, maxname, "#1/%lu", len);
}
}