reloc_nil (bfd *abfd ATTRIBUTE_UNUSED,
arelent *reloc ATTRIBUTE_UNUSED,
asymbol *sym ATTRIBUTE_UNUSED,
- void * data ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED,
asection *sec ATTRIBUTE_UNUSED,
bfd *output_bfd ATTRIBUTE_UNUSED,
char **error_message ATTRIBUTE_UNUSED)
On output we will set the lnnoptr field and force the
alignment. */
sec = bfd_get_section_by_name (abfd, _PDATA);
- if (sec != (asection *) NULL)
+ if (sec != NULL)
{
bfd_size_type size;
static bool
alpha_ecoff_bad_format_hook (bfd *abfd ATTRIBUTE_UNUSED,
- void * filehdr)
+ void *filehdr)
{
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
specific information. */
static void *
-alpha_ecoff_mkobject_hook (bfd *abfd, void * filehdr, void * aouthdr)
+alpha_ecoff_mkobject_hook (bfd *abfd, void *filehdr, void *aouthdr)
{
- void * ecoff;
+ void *ecoff;
ecoff = _bfd_ecoff_mkobject_hook (abfd, filehdr, aouthdr);
if (ecoff != NULL)
{
- struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
+ struct internal_filehdr *internal_f = filehdr;
/* Set additional BFD flags according to the object type from the
machine specific file header flags. */
static void
alpha_ecoff_swap_reloc_in (bfd *abfd,
- void * ext_ptr,
+ void *ext_ptr,
struct internal_reloc *intern)
{
- const RELOC *ext = (RELOC *) ext_ptr;
+ const RELOC *ext = ext_ptr;
intern->r_vaddr = H_GET_64 (abfd, ext->r_vaddr);
intern->r_symndx = H_GET_32 (abfd, ext->r_symndx);
static void
alpha_ecoff_swap_reloc_out (bfd *abfd,
const struct internal_reloc *intern,
- void * dst)
+ void *dst)
{
- RELOC *ext = (RELOC *) dst;
+ RELOC *ext = dst;
long symndx;
unsigned char size;
abfd, intern->r_type);
bfd_set_error (bfd_error_bad_value);
rptr->addend = 0;
- rptr->howto = NULL;
+ rptr->howto = NULL;
return;
}
long reloc_size;
arelent **reloc_vector;
long reloc_count;
- bfd *output_bfd = relocatable ? abfd : (bfd *) NULL;
+ bfd *output_bfd = relocatable ? abfd : NULL;
bfd_vma gp;
bool gp_undefined;
bfd_vma stack[RELOC_STACKSIZE];
if (reloc_size == 0)
return data;
- reloc_vector = (arelent **) bfd_malloc (reloc_size);
+ reloc_vector = bfd_malloc (reloc_size);
if (reloc_vector == NULL)
goto error_return;
bfd_vma lo;
/* Make up a value. */
- lo = (bfd_vma) -1;
+ lo = -1;
for (sec = abfd->sections; sec != NULL; sec = sec->next)
{
if (sec->vma < lo
h = bfd_link_hash_lookup (link_info->hash, "_gp", false, false,
true);
- if (h == (struct bfd_link_hash_entry *) NULL
+ if (h == NULL
|| h->type != bfd_link_hash_defined)
gp_undefined = true;
else
alpha_type = ALPHA_R_SREL64;
break;
default:
- return (reloc_howto_type *) NULL;
+ return NULL;
}
return &alpha_howto_table[alpha_type];
hsec = h->root.u.def.section;
name = bfd_section_name (hsec->output_section);
- r_symndx = (unsigned long) -1;
+ r_symndx = -1ul;
switch (name[1])
{
case 'A':
break;
}
- if (r_symndx == (unsigned long) -1)
+ if (r_symndx == -1ul)
abort ();
/* Add the section VMA and the symbol value. */
/* Change the symndx value to the right one for
the output BFD. */
r_symndx = h->indx;
- if (r_symndx == (unsigned long) -1)
+ if (r_symndx == -1ul)
{
/* Caller must give an error. */
r_symndx = 0;
bfd *input_bfd,
asection *input_section,
bfd_byte *contents,
- void * external_relocs)
+ void *external_relocs)
{
asection **symndx_to_section, *lita_sec;
struct ecoff_link_hash_entry **sym_hashes;
the appropriate section. This is faster than looking up the
section by name each time. */
symndx_to_section = ecoff_data (input_bfd)->symndx_to_section;
- if (symndx_to_section == (asection **) NULL)
+ if (symndx_to_section == NULL)
{
amt = NUM_RELOC_SECTIONS * sizeof (asection *);
- symndx_to_section = (asection **) bfd_alloc (input_bfd, amt);
+ symndx_to_section = bfd_alloc (input_bfd, amt);
if (!symndx_to_section)
return false;
lita_sec_data = ecoff_section_data (input_bfd, lita_sec);
if (lita_sec_data == NULL)
{
- amt = sizeof (struct ecoff_section_tdata);
- lita_sec_data = ((struct ecoff_section_tdata *)
- bfd_zalloc (input_bfd, amt));
+ lita_sec_data = bfd_zalloc (input_bfd, sizeof (*lita_sec_data));
lita_sec->used_by_bfd = lita_sec_data;
}
lita_size = lita_sec->size;
if (gp == 0
- || lita_vma < gp - 0x8000
+ || lita_vma < gp - 0x8000
|| lita_vma + lita_size >= gp + 0x8000)
{
/* Either gp hasn't been set at all or the current gp
{
(*info->callbacks->warning) (info,
_("using multiple gp values"),
- (char *) NULL, output_bfd,
- (asection *) NULL, (bfd_vma) 0);
+ NULL, output_bfd, NULL, 0);
ecoff_data (output_bfd)->issued_multiple_gp_warning = true;
}
if (lita_vma < gp - 0x8000)
BFD_ASSERT (bfd_header_little_endian (output_bfd));
BFD_ASSERT (bfd_header_little_endian (input_bfd));
- ext_rel = (struct external_reloc *) external_relocs;
+ ext_rel = external_relocs;
ext_rel_end = ext_rel + input_section->reloc_count;
for (; ext_rel < ext_rel_end; ext_rel++)
{
relocated. */
(*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, (bfd_vma) 0, true);
+ input_section, 0, true);
addend = 0;
}
}
above. */
(*info->callbacks->unattached_reloc)
(info, h->root.root.string,
- input_bfd, input_section, (bfd_vma) 0);
+ input_bfd, input_section, 0);
}
addend = alpha_convert_external_reloc (output_bfd, info,
name = bfd_section_name (symndx_to_section[r_symndx]);
(*info->callbacks->reloc_overflow)
(info, NULL, name, alpha_howto_table[r_type].name,
- (bfd_vma) 0, input_bfd, input_section,
- r_vaddr - input_section->vma);
+ 0, input_bfd, input_section, r_vaddr - input_section->vma);
}
break;
case bfd_reloc_outofrange:
struct areltdata *ret;
struct ar_hdr *h;
- ret = (struct areltdata *) _bfd_generic_read_ar_hdr_mag (abfd, ARFZMAG);
+ ret = _bfd_generic_read_ar_hdr_mag (abfd, ARFZMAG);
if (ret == NULL)
return NULL;
struct ar_hdr *hdr;
bfd_byte ab[8];
bfd_size_type size;
- bfd_byte *buf, *p;
+ bfd_byte *buf;
struct bfd_in_memory *bim;
ufile_ptr filesize;
return nbfd;
}
- tdata = (struct areltdata *) nbfd->arelt_data;
+ tdata = nbfd->arelt_data;
hdr = (struct ar_hdr *) tdata->arch_header;
if (strncmp (hdr->ar_fmag, ARFZMAG, 2) != 0)
return nbfd;
if (size != 0)
{
+ bfd_byte *p;
bfd_size_type left;
bfd_byte dict[4096];
unsigned int h;
- bfd_byte b;
- buf = (bfd_byte *) bfd_malloc (size);
+ buf = bfd_malloc (size);
if (buf == NULL)
goto error_return;
p = buf;
next eight bytes in the output stream. */
memset (dict, 0, sizeof dict);
h = 0;
- while (bfd_read (&b, 1, nbfd) == 1)
+ do
{
- unsigned int i;
+ bfd_byte b;
+ if (bfd_read (&b, 1, nbfd) != 1)
+ goto error_return;
- for (i = 0; i < 8; i++, b >>= 1)
+ for (unsigned int i = 0; i < 8; i++, b >>= 1)
{
bfd_byte n;
h ^= n;
h &= sizeof dict - 1;
}
-
- if (left == 0)
- break;
}
- if (left != 0)
- goto error_return;
+ while (left != 0);
}
/* Now the uncompressed file contents are in buf. */
- bim = ((struct bfd_in_memory *)
- bfd_malloc ((bfd_size_type) sizeof (struct bfd_in_memory)));
+ bim = bfd_malloc (sizeof (*bim));
if (bim == NULL)
goto error_return;
bim->size = size;
bim->buffer = buf;
nbfd->mtime_set = true;
- nbfd->mtime = strtol (hdr->ar_date, (char **) NULL, 10);
+ nbfd->mtime = strtol (hdr->ar_date, NULL, 10);
nbfd->flags |= BFD_IN_MEMORY;
nbfd->iostream = bim;
which is the uncompressed size. We need the compressed size. */
t = (struct areltdata *) last_file->arelt_data;
h = (struct ar_hdr *) t->arch_header;
- size = strtol (h->ar_size, (char **) NULL, 10);
+ size = strtol (h->ar_size, NULL, 10);
/* Pad to an even boundary...
Note that last_file->origin can be odd in the case of
carsym *entry;
entry = bfd_ardata (abfd)->symdefs + sym_index;
- return alpha_ecoff_get_elt_at_filepos (abfd, entry->file_offset,
- NULL);
+ return alpha_ecoff_get_elt_at_filepos (abfd, entry->file_offset, NULL);
}
static void