{
if (coff_section_data (abfd, sec) == NULL)
{
- bfd_size_type amt = sizeof (struct coff_section_tdata);
+ size_t amt = sizeof (struct coff_section_tdata);
sec->used_by_bfd = bfd_zalloc (abfd, amt);
if (sec->used_by_bfd == NULL)
_bfd_xcoff_bfd_link_hash_table_create (bfd *abfd)
{
struct xcoff_link_hash_table *ret;
- bfd_size_type amt = sizeof (* ret);
+ size_t amt = sizeof (* ret);
ret = bfd_zmalloc (amt);
if (ret == NULL)
if (*pp == NULL)
{
struct xcoff_import_file *n;
- bfd_size_type amt = sizeof (* n);
+ size_t amt = sizeof (*n);
n = bfd_alloc (info->output_bfd, amt);
if (n == NULL)
{
bfd_byte *linenos;
- amt = linesz * o->lineno_count;
- linenos = bfd_malloc (amt);
+ if (bfd_seek (abfd, o->line_filepos, SEEK_SET) != 0)
+ goto error_return;
+ if (_bfd_mul_overflow (linesz, o->lineno_count, &amt))
+ {
+ bfd_set_error (bfd_error_file_too_big);
+ goto error_return;
+ }
+ linenos = _bfd_malloc_and_read (abfd, amt, amt);
if (linenos == NULL)
goto error_return;
reloc_info[o->target_index].linenos = linenos;
- if (bfd_seek (abfd, o->line_filepos, SEEK_SET) != 0
- || bfd_bread (linenos, amt, abfd) != amt)
- goto error_return;
}
}
{
char *fnname;
struct xcoff_link_hash_entry *hfn;
- bfd_size_type amt;
+ size_t amt;
amt = strlen (h->root.root.string) + 2;
fnname = bfd_malloc (amt);
{
struct xcoff_link_hash_entry *h = (struct xcoff_link_hash_entry *) harg;
struct xcoff_link_size_list *n;
- bfd_size_type amt;
+ size_t amt;
if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour)
return TRUE;
xcoff_build_ldsym (struct xcoff_loader_info *ldinfo,
struct xcoff_link_hash_entry *h)
{
- bfd_size_type amt;
+ size_t amt;
/* Warn if this symbol is exported but not defined. */
if ((h->flags & XCOFF_EXPORT) != 0
bfd *sub;
struct bfd_strtab_hash *debug_strtab;
bfd_byte *debug_contents = NULL;
- bfd_size_type amt;
+ size_t amt;
if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour)
{
{
struct xcoff_toc_rel_hash *n;
struct xcoff_link_section_info *si;
- bfd_size_type amt;
+ size_t amt;
amt = sizeof (* n);
n = bfd_alloc (flinfo->output_bfd, amt);