.
. {* The text of the symbol. The name is left alone, and not copied; the
. application may not alter it. *}
-. CONST char *name;
+. const char *name;
.
. {* The value of the symbol. This really should be a union of a
. numeric value with a pointer, since some flags indicate that
struct section_to_type
{
- CONST char *section;
+ const char *section;
char type;
};
/* Map section names to POSIX/BSD single-character symbol types.
This table is probably incomplete. It is sorted for convenience of
adding entries. Since it is so short, a linear search is used. */
-static CONST struct section_to_type stt[] =
+static const struct section_to_type stt[] =
{
{"*DEBUG*", 'N'},
{".bss", 'b'},
coff_section_type (s)
const char *s;
{
- CONST struct section_to_type *t;
+ const struct section_to_type *t;
for (t = &stt[0]; t->section; t++)
if (!strncmp (s, t->section, strlen (t->section)))
if (storage < 0)
goto error_return;
- syms = (asymbol **) bfd_malloc ((size_t) storage);
+ syms = (asymbol **) bfd_malloc ((bfd_size_type) storage);
if (syms == NULL)
goto error_return;
bfd_byte *last_stab = NULL;
bfd_size_type stroff;
struct indexentry *indexentry;
- char *directory_name, *file_name;
+ char *file_name;
+ char *directory_name;
int saw_fun;
*pfound = false;
arelent **reloc_vector;
int i;
char *name;
- char *file_name;
- char *directory_name;
char *function_name;
+ bfd_size_type amt = sizeof *info;
- info = (struct stab_find_info *) bfd_zalloc (abfd, sizeof *info);
+ info = (struct stab_find_info *) bfd_zalloc (abfd, amt);
if (info == NULL)
return false;
if (info->stabs == NULL || info->strs == NULL)
return false;
- if (! bfd_get_section_contents (abfd, info->stabsec, info->stabs, 0,
- stabsize)
- || ! bfd_get_section_contents (abfd, info->strsec, info->strs, 0,
- strsize))
+ if (! bfd_get_section_contents (abfd, info->stabsec, info->stabs,
+ (bfd_vma) 0, stabsize)
+ || ! bfd_get_section_contents (abfd, info->strsec, info->strs,
+ (bfd_vma) 0, strsize))
return false;
/* If this is a relocateable object file, we have to relocate
reloc_size = bfd_get_reloc_upper_bound (abfd, info->stabsec);
if (reloc_size < 0)
return false;
- reloc_vector = (arelent **) bfd_malloc (reloc_size);
+ reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size);
if (reloc_vector == NULL && reloc_size != 0)
return false;
reloc_count = bfd_canonicalize_reloc (abfd, info->stabsec, reloc_vector,
val &= r->howto->src_mask;
sym = *r->sym_ptr_ptr;
val += sym->value + sym->section->vma + r->addend;
- bfd_put_32 (abfd, val, info->stabs + r->address);
+ bfd_put_32 (abfd, (bfd_vma) val, info->stabs + r->address);
}
}
return true;
++info->indextablesize;
- info->indextable = ((struct indexentry *)
- bfd_alloc (abfd,
- (sizeof (struct indexentry)
- * info->indextablesize)));
+ amt = info->indextablesize;
+ amt *= sizeof (struct indexentry);
+ info->indextable = (struct indexentry *) bfd_alloc (abfd, amt);
if (info->indextable == NULL)
return false;
++i;
info->indextablesize = i;
- qsort (info->indextable, i, sizeof (struct indexentry), cmpindexentry);
+ qsort (info->indextable, (size_t) i, sizeof (struct indexentry),
+ cmpindexentry);
*pinfo = (PTR) info;
}
{
if (info->filename != NULL)
free (info->filename);
- info->filename = (char *) bfd_malloc (dirlen +
- strlen (file_name)
- + 1);
+ info->filename = (char *) bfd_malloc ((bfd_size_type) dirlen
+ + strlen (file_name) + 1);
if (info->filename == NULL)
return false;
strcpy (info->filename, directory_name);