+2005-10-06 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * elf32-arm.c (elf32_arm_check_relocs): Avoid aliasing warnings from
+ GCC.
+ (elf32_arm_size_dynamic_sections): Likewise.
+ * ecofflink.c (bfd_ecoff_debug_one_external): Likewise.
+ * elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
+ * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
+ * elf32-m68k.c (elf_m68k_check_relocs): Likewise.
+ * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
+ * elf32-s390.c (elf_s390_check_relocs): Likewise.
+ (elf_s390_size_dynamic_sections): Likewise.
+ * elf32-sh.c (sh_elf_check_relocs): Likewise.
+ * elf64-ppc.c (ppc64_elf_check_relocs, dec_dynrel_count)
+ (ppc64_elf_size_dynamic_sections): Likewise.
+ * elf64-s390.c (elf_s390_check_relocs): Likewise.
+ (elf_s390_size_dynamic_sections): Likewise.
+ * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Likewise.
+ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
+ (_bfd_sparc_elf_size_dynamic_sections): Likewise.
+ * ieee.c (ieee_slurp_section_data): Likewise.
+ * oasys.c (oasys_slurp_section_data): Likewise.
+
2005-10-04 Bob Wilson <bob.wilson@acm.org>
* archive.c: Add missing SUBSECTION for documentation.
- (char *) debug->external_ext)
< (symhdr->iextMax + 1) * external_ext_size)
{
- if (! ecoff_add_bytes ((char **) &debug->external_ext,
- (char **) &debug->external_ext_end,
+ char *external_ext = debug->external_ext;
+ char *external_ext_end = debug->external_ext_end;
+ if (! ecoff_add_bytes ((char **) &external_ext,
+ (char **) &external_ext_end,
(symhdr->iextMax + 1) * (size_t) external_ext_size))
return FALSE;
+ debug->external_ext = external_ext;
+ debug->external_ext_end = external_ext_end;
}
esym->asym.iss = symhdr->issExtMax;
easily. Oh well. */
asection *s;
+ void *vpp;
+
s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
sec, r_symndx);
if (s == NULL)
return FALSE;
- head = ((struct elf32_arm_relocs_copied **)
- &elf_section_data (s)->local_dynrel);
+ vpp = &elf_section_data (s)->local_dynrel;
+ head = (struct elf32_arm_relocs_copied **) vpp;
}
p = *head;
{
struct elf32_arm_relocs_copied *p;
- for (p = *((struct elf32_arm_relocs_copied **)
- &elf_section_data (s)->local_dynrel);
- p != NULL;
- p = p->next)
+ for (p = elf_section_data (s)->local_dynrel; p != NULL; p = p->next)
{
if (!bfd_is_abs_section (p->section)
&& bfd_is_abs_section (p->section->output_section))
easily. Oh well. */
asection *sr;
+ void *vpp;
+
sr = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
sec, r_symndx);
if (sr == NULL)
return FALSE;
- hdh_head = ((struct elf32_hppa_dyn_reloc_entry **)
- &elf_section_data (sr)->local_dynrel);
+ vpp = &elf_section_data (sr)->local_dynrel;
+ hdh_head = (struct elf32_hppa_dyn_reloc_entry **) vpp;
}
hdh_p = *hdh_head;
else
{
asection *s;
+ void *vpp;
/* Track dynamic relocs needed for local syms too. */
s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
if (s == NULL)
return FALSE;
- head = ((struct elf_m32r_dyn_relocs **)
- &elf_section_data (s)->local_dynrel);
+ vpp = &elf_section_data (s)->local_dynrel;
+ head = (struct elf_m32r_dyn_relocs **) vpp;
}
p = *head;
else
{
asection *s;
+ void *vpp;
+
s = (bfd_section_from_r_symndx
(abfd, &elf_m68k_hash_table (info)->sym_sec,
sec, r_symndx));
if (s == NULL)
return FALSE;
- head = ((struct elf_m68k_pcrel_relocs_copied **)
- &elf_section_data (s)->local_dynrel);
+ vpp = &elf_section_data (s)->local_dynrel;
+ head = (struct elf_m68k_pcrel_relocs_copied **) vpp;
}
for (p = *head; p != NULL; p = p->next)
easily. Oh well. */
asection *s;
+ void *vpp;
+
s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
sec, r_symndx);
if (s == NULL)
return FALSE;
- head = ((struct ppc_elf_dyn_relocs **)
- &elf_section_data (s)->local_dynrel);
+ vpp = &elf_section_data (s)->local_dynrel;
+ head = (struct ppc_elf_dyn_relocs **) vpp;
}
p = *head;
We really need local syms available to do this
easily. Oh well. */
asection *s;
+ void *vpp;
s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
sec, r_symndx);
if (s == NULL)
return FALSE;
- head = ((struct elf_s390_dyn_relocs **)
- &elf_section_data (s)->local_dynrel);
+ vpp = &elf_section_data (s)->local_dynrel;
+ head = (struct elf_s390_dyn_relocs **) vpp;
}
p = *head;
{
struct elf_s390_dyn_relocs *p;
- for (p = *((struct elf_s390_dyn_relocs **)
- &elf_section_data (s)->local_dynrel);
- p != NULL;
- p = p->next)
+ for (p = elf_section_data (s)->local_dynrel; p != NULL; p = p->next)
{
if (!bfd_is_abs_section (p->sec)
&& bfd_is_abs_section (p->sec->output_section))
else
{
asection *s;
+ void *vpp;
/* Track dynamic relocs needed for local syms too. */
s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
if (s == NULL)
return FALSE;
- head = ((struct elf_sh_dyn_relocs **)
- &elf_section_data (s)->local_dynrel);
+ vpp = &elf_section_data (s)->local_dynrel;
+ head = (struct elf_sh_dyn_relocs **) vpp;
}
p = *head;
easily. Oh well. */
asection *s;
+ void *vpp;
+
s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
sec, r_symndx);
if (s == NULL)
return FALSE;
- head = ((struct ppc_dyn_relocs **)
- &elf_section_data (s)->local_dynrel);
+ vpp = &elf_section_data (s)->local_dynrel;
+ head = (struct ppc_dyn_relocs **) vpp;
}
p = *head;
if (h != NULL)
pp = &((struct ppc_link_hash_entry *) h)->dyn_relocs;
else if (sym_sec != NULL)
- pp = (struct ppc_dyn_relocs **) &elf_section_data (sym_sec)->local_dynrel;
+ {
+ void *vpp = &elf_section_data (sym_sec)->local_dynrel;
+ pp = (struct ppc_dyn_relocs **) vpp;
+ }
else
- pp = (struct ppc_dyn_relocs **) &elf_section_data (sec)->local_dynrel;
+ {
+ void *vpp = &elf_section_data (sec)->local_dynrel;
+ pp = (struct ppc_dyn_relocs **) vpp;
+ }
while ((p = *pp) != NULL)
{
{
struct ppc_dyn_relocs *p;
- for (p = *((struct ppc_dyn_relocs **)
- &elf_section_data (s)->local_dynrel);
- p != NULL;
- p = p->next)
+ for (p = elf_section_data (s)->local_dynrel; p != NULL; p = p->next)
{
if (!bfd_is_abs_section (p->sec)
&& bfd_is_abs_section (p->sec->output_section))
easily. Oh well. */
asection *s;
+ void *vpp;
+
s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
sec, r_symndx);
if (s == NULL)
return FALSE;
- head = ((struct elf_s390_dyn_relocs **)
- &elf_section_data (s)->local_dynrel);
+ vpp = &elf_section_data (s)->local_dynrel;
+ head = (struct elf_s390_dyn_relocs **) vpp;
}
p = *head;
{
struct elf_s390_dyn_relocs *p;
- for (p = *((struct elf_s390_dyn_relocs **)
- &elf_section_data (s)->local_dynrel);
- p != NULL;
- p = p->next)
+ for (p = elf_section_data (s)->local_dynrel; p != NULL; p = p->next)
{
if (!bfd_is_abs_section (p->sec)
&& bfd_is_abs_section (p->sec->output_section))
break;
case DT_MIPS_TIME_STAMP:
- time ((time_t *) &dyn.d_un.d_val);
+ {
+ time_t t;
+ time (&t);
+ dyn.d_un.d_val = t;
+ }
break;
case DT_MIPS_ICHECKSUM:
easily. Oh well. */
asection *s;
+ void *vpp;
+
s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
sec, r_symndx);
if (s == NULL)
return FALSE;
- head = ((struct _bfd_sparc_elf_dyn_relocs **)
- &elf_section_data (s)->local_dynrel);
+ vpp = &elf_section_data (s)->local_dynrel;
+ head = (struct _bfd_sparc_elf_dyn_relocs **) vpp;
}
p = *head;
{
struct _bfd_sparc_elf_dyn_relocs *p;
- for (p = *((struct _bfd_sparc_elf_dyn_relocs **)
- &elf_section_data (s)->local_dynrel);
- p != NULL;
- p = p->next)
+ for (p = elf_section_data (s)->local_dynrel; p != NULL; p = p->next)
{
if (!bfd_is_abs_section (p->sec)
&& bfd_is_abs_section (p->sec->output_section))
for (s = abfd->sections; s != (asection *) NULL; s = s->next)
{
ieee_per_section_type *per = ieee_per_section (s);
+ arelent **relpp;
if ((s->flags & SEC_DEBUGGING) != 0)
continue;
per->data = bfd_alloc (ieee->h.abfd, s->size);
if (!per->data)
return FALSE;
- per->reloc_tail_ptr =
- (ieee_reloc_type **) & (s->relocation);
+ relpp = &s->relocation;
+ per->reloc_tail_ptr = (ieee_reloc_type **) relpp;
}
while (TRUE)
if (! per->initialized)
{
+ arelent **relpp;
+
per->data = bfd_zalloc (abfd, section->size);
if (!per->data)
return FALSE;
- per->reloc_tail_ptr
- = (oasys_reloc_type **) §ion->relocation;
+ relpp = §ion->relocation;
+ per->reloc_tail_ptr = (oasys_reloc_type **) relpp;
per->had_vma = FALSE;
per->initialized = TRUE;
section->reloc_count = 0;
+2005-10-06 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * ppc-dis.c (struct dis_private): Remove.
+ (powerpc_dialect): Avoid aliasing warnings.
+ (print_insn_big_powerpc, print_insn_little_powerpc): Likewise.
+
2005-09-30 Nick Clifton <nickc@redhat.com>
* po/ga.po: New Irish translation.
static int print_insn_powerpc (bfd_vma, struct disassemble_info *, int, int);
-struct dis_private {
- /* Stash the result of parsing disassembler_options here. */
- int dialect;
-};
-
/* Determine which set of machines to disassemble for. PPC403/601 or
BookE. For convenience, also disassemble instructions supported
by the AltiVec vector unit. */
dialect |= PPC_OPCODE_64;
}
- ((struct dis_private *) &info->private_data)->dialect = dialect;
+ info->private_data = (char *) 0 + dialect;
return dialect;
}
int
print_insn_big_powerpc (bfd_vma memaddr, struct disassemble_info *info)
{
- int dialect = ((struct dis_private *) &info->private_data)->dialect;
+ int dialect = (char *) info->private_data - (char *) 0;
return print_insn_powerpc (memaddr, info, 1, dialect);
}
int
print_insn_little_powerpc (bfd_vma memaddr, struct disassemble_info *info)
{
- int dialect = ((struct dis_private *) &info->private_data)->dialect;
+ int dialect = (char *) info->private_data - (char *) 0;
return print_insn_powerpc (memaddr, info, 0, dialect);
}