\f
/* Recognize an Alpha ECOFF file. */
-static const bfd_target *
+static bfd_cleanup
alpha_ecoff_object_p (bfd *abfd)
{
- static const bfd_target *ret;
+ bfd_cleanup ret;
ret = coff_object_p (abfd);
abort ();
successful_return:
- if (reloc_vector != NULL)
- free (reloc_vector);
+ free (reloc_vector);
return data;
error_return:
- if (reloc_vector != NULL)
- free (reloc_vector);
+ free (reloc_vector);
return NULL;
}
bfd_size_type size;
bfd_byte *buf, *p;
struct bfd_in_memory *bim;
+ ufile_ptr filesize;
buf = NULL;
nbfd = _bfd_get_elt_at_filepos (archive, filepos);
goto error_return;
size = H_GET_64 (nbfd, ab);
+ /* The decompression algorithm will at most expand by eight times. */
+ filesize = bfd_get_file_size (archive);
+ if (filesize != 0 && size / 8 > filesize)
+ {
+ bfd_set_error (bfd_error_malformed_archive);
+ goto error_return;
+ }
+
if (size != 0)
{
bfd_size_type left;
n = dict[h];
else
{
- if (! bfd_bread (&n, (bfd_size_type) 1, nbfd))
+ if (bfd_bread (&n, 1, nbfd) != 1)
goto error_return;
dict[h] = n;
}
return nbfd;
error_return:
- if (buf != NULL)
- free (buf);
+ free (buf);
if (nbfd != NULL)
bfd_close (nbfd);
return NULL;
| HAS_LINENO | HAS_DEBUG
| HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
- (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE
+ | SEC_DATA | SEC_SMALL_DATA),
0, /* leading underscore */
' ', /* ar_pad_char */
15, /* ar_max_namelen */