Updated soruces in bfd/* to compile cleanly with -Wc++-compat.
* bfd/aoutx.h: Add casts. * bfd/archive.c: Add casts. * bfd/archive64.c: Add casts. * bfd/archures.c: Add casts. * bfd/bfd-in2.h: Regenerated. * bfd/bfd.c: Add casts. (enum bfd_direction): Move out to top level. * bfd/bfdio.c: Add casts. * bfd/binary.c: Add casts. * bfd/cache.c (cache_bseek,cache_bread_1,cache_bwrite): Updated parameter to use enum value instead of int. * bfd/coffcode.h: Add casts. * bfd/coffgen.c: Add casts. * bfd/cofflink.c: Add casts. * bfd/compress.c: Add casts. * bfd/dwarf1.c: Add casts. * bfd/dwarf2.c: Add casts. (struct dwarf2_debug): Rename member bfd to bfd_ptr. Update code to use new name. * bfd/elf-attrs.c: Add casts. * bfd/elf-bfd.h (elf_link_virtual_table_entry): Gives name to anonymous struct. (union gotplt_union, struct elf_link_virtual_table_entry): Move to top level. * bfd/elf-eh-frame.c: Add casts. * bfd/elf-strtab.c: Add casts. * bfd/elf.c: Add casts. (_bfd_elm_make_Section_from_phdr): Change argument name from typename to type_name. * bfd/elf32-i386.c: Add casts. * bfd/elf64-x86-64.c: Add casts. * bfd/elfcode.h: Add casts. * bfd/elfcore.h: Add casts. * bfd/elflink.c: Add casts. * bfd/format.c: Add casts. * bfd/hash.c: Add casts. * bfd/ihex.c: Add casts. * bfd/libaout.h (enum aout_subformat, enum aout_magic): Move to top level. * bfd/libbfd.c: Add casts. * bfd/linker.c: Add casts. * bfd/merge.c: Add casts. * bfd/opncls.c: Add casts. * bfd/peXXigen.c: Add casts. * bfd/peicode.h: Add casts. * bfd/reloc.c: Add casts. * bfd/section.c: Add casts. * bfd/simple.c: Add casts. * bfd/srec.c: Add casts. * bfd/stabs.c: Add casts. * bfd/syms.c: Add casts. * bfd/targets.c: Add casts. * bfd/tekhex.c: Add casts. * bfd/verilog.c: Add casts. * include/bfdlink.h (struct bfd_link_hash_common_entry): Move to top level.
This commit is contained in:
parent
b1dfe69a90
commit
a50b1753d4
48 changed files with 713 additions and 574 deletions
|
@ -215,8 +215,8 @@ write_value (bfd *abfd, bfd_byte *buf, bfd_vma value, int width)
|
|||
static int
|
||||
cie_eq (const void *e1, const void *e2)
|
||||
{
|
||||
const struct cie *c1 = e1;
|
||||
const struct cie *c2 = e2;
|
||||
const struct cie *c1 = (const struct cie *) e1;
|
||||
const struct cie *c2 = (const struct cie *) e2;
|
||||
|
||||
if (c1->hash == c2->hash
|
||||
&& c1->length == c2->length
|
||||
|
@ -246,7 +246,7 @@ cie_eq (const void *e1, const void *e2)
|
|||
static hashval_t
|
||||
cie_hash (const void *e)
|
||||
{
|
||||
const struct cie *c = e;
|
||||
const struct cie *c = (const struct cie *) e;
|
||||
return c->hash;
|
||||
}
|
||||
|
||||
|
@ -529,12 +529,13 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
|
|||
REQUIRE (skip_bytes (&buf, end, hdr_length - 4));
|
||||
}
|
||||
|
||||
sec_info = bfd_zmalloc (sizeof (struct eh_frame_sec_info)
|
||||
+ (num_entries - 1) * sizeof (struct eh_cie_fde));
|
||||
sec_info = (struct eh_frame_sec_info *)
|
||||
bfd_zmalloc (sizeof (struct eh_frame_sec_info)
|
||||
+ (num_entries - 1) * sizeof (struct eh_cie_fde));
|
||||
REQUIRE (sec_info);
|
||||
|
||||
/* We need to have a "struct cie" for each CIE in this section. */
|
||||
local_cies = bfd_zmalloc (num_cies * sizeof (*local_cies));
|
||||
local_cies = (struct cie *) bfd_zmalloc (num_cies * sizeof (*local_cies));
|
||||
REQUIRE (local_cies);
|
||||
|
||||
/* FIXME: octets_per_byte. */
|
||||
|
@ -848,8 +849,8 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
|
|||
unsigned int cnt;
|
||||
bfd_byte *p;
|
||||
|
||||
this_inf->set_loc = bfd_malloc ((set_loc_count + 1)
|
||||
* sizeof (unsigned int));
|
||||
this_inf->set_loc = (unsigned int *)
|
||||
bfd_malloc ((set_loc_count + 1) * sizeof (unsigned int));
|
||||
REQUIRE (this_inf->set_loc);
|
||||
this_inf->set_loc[0] = set_loc_count;
|
||||
p = insns;
|
||||
|
@ -1055,7 +1056,7 @@ find_merged_cie (bfd *abfd, asection *sec,
|
|||
if (new_cie == NULL)
|
||||
{
|
||||
/* Keep CIE_INF and record it in the hash table. */
|
||||
new_cie = malloc (sizeof (struct cie));
|
||||
new_cie = (struct cie *) malloc (sizeof (struct cie));
|
||||
if (new_cie == NULL)
|
||||
return cie_inf;
|
||||
|
||||
|
@ -1246,7 +1247,7 @@ _bfd_elf_eh_frame_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED,
|
|||
|
||||
if (sec->sec_info_type != ELF_INFO_TYPE_EH_FRAME)
|
||||
return offset;
|
||||
sec_info = elf_section_data (sec)->sec_info;
|
||||
sec_info = (struct eh_frame_sec_info *) elf_section_data (sec)->sec_info;
|
||||
|
||||
if (offset >= sec->rawsize)
|
||||
return offset - sec->rawsize + sec->size;
|
||||
|
@ -1336,13 +1337,13 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
|
|||
->elf_backend_eh_frame_address_size (abfd, sec));
|
||||
BFD_ASSERT (ptr_size != 0);
|
||||
|
||||
sec_info = elf_section_data (sec)->sec_info;
|
||||
sec_info = (struct eh_frame_sec_info *) elf_section_data (sec)->sec_info;
|
||||
htab = elf_hash_table (info);
|
||||
hdr_info = &htab->eh_info;
|
||||
|
||||
if (hdr_info->table && hdr_info->array == NULL)
|
||||
hdr_info->array
|
||||
= bfd_malloc (hdr_info->fde_count * sizeof(*hdr_info->array));
|
||||
hdr_info->array = (struct eh_frame_array_ent *)
|
||||
bfd_malloc (hdr_info->fde_count * sizeof(*hdr_info->array));
|
||||
if (hdr_info->array == NULL)
|
||||
hdr_info = NULL;
|
||||
|
||||
|
@ -1629,8 +1630,8 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
|
|||
static int
|
||||
vma_compare (const void *a, const void *b)
|
||||
{
|
||||
const struct eh_frame_array_ent *p = a;
|
||||
const struct eh_frame_array_ent *q = b;
|
||||
const struct eh_frame_array_ent *p = (const struct eh_frame_array_ent *) a;
|
||||
const struct eh_frame_array_ent *q = (const struct eh_frame_array_ent *) b;
|
||||
if (p->initial_loc > q->initial_loc)
|
||||
return 1;
|
||||
if (p->initial_loc < q->initial_loc)
|
||||
|
@ -1681,7 +1682,7 @@ _bfd_elf_write_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info)
|
|||
size = EH_FRAME_HDR_SIZE;
|
||||
if (hdr_info->array && hdr_info->array_count == hdr_info->fde_count)
|
||||
size += 4 + hdr_info->fde_count * 8;
|
||||
contents = bfd_malloc (size);
|
||||
contents = (bfd_byte *) bfd_malloc (size);
|
||||
if (contents == NULL)
|
||||
return FALSE;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue