bfd/
authorDaniel Jacobowitz <drow@false.org>
Thu, 6 Oct 2005 19:21:14 +0000 (19:21 +0000)
committerDaniel Jacobowitz <drow@false.org>
Thu, 6 Oct 2005 19:21:14 +0000 (19:21 +0000)
* 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.
opcodes/
* ppc-dis.c (struct dis_private): Remove.
(powerpc_dialect): Avoid aliasing warnings.
(print_insn_big_powerpc, print_insn_little_powerpc): Likewise.

17 files changed:
bfd/ChangeLog
bfd/ecofflink.c
bfd/elf32-arm.c
bfd/elf32-hppa.c
bfd/elf32-m32r.c
bfd/elf32-m68k.c
bfd/elf32-ppc.c
bfd/elf32-s390.c
bfd/elf32-sh.c
bfd/elf64-ppc.c
bfd/elf64-s390.c
bfd/elfxx-mips.c
bfd/elfxx-sparc.c
bfd/ieee.c
bfd/oasys.c
opcodes/ChangeLog
opcodes/ppc-dis.c

index b46f869116b864acdbd3d3ed46edea7efd36edf0..a0a02c93ad01f6138b0cf4aa5bd55acf04656c94 100644 (file)
@@ -1,3 +1,26 @@
+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.
index c4663b72aa96f832921614dffc39fa8859209138..d7bb817f6760f11e0f4149b05aa5675d4fcc6e0b 100644 (file)
@@ -1338,10 +1338,14 @@ bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym)
                - (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;
index 6bace7a9c71c1ac24ee6685df20580637615949a..b9024e9f1a119ac7ee34b712de3b616e2c77b9b8 100644 (file)
@@ -5118,13 +5118,15 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
                       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;
@@ -5785,10 +5787,7 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
        {
          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))
index 7f20bd6aa235ac6d55dafc919bec106b8d95803e..942b376cf9f9d0e67925fa8dc4776542ff07a61d 100644 (file)
@@ -1446,13 +1446,15 @@ elf32_hppa_check_relocs (bfd *abfd,
                     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;
index cb6716f3a4d81ac1e39046eb38d0a4ec43703c16..c26bebf73c4ad2ddd0a7b36de576f5c69c8ba9cd 100644 (file)
@@ -3993,6 +3993,7 @@ m32r_elf_check_relocs (bfd *abfd,
               else
                 {
                   asection *s;
+                  void *vpp;
 
                   /* Track dynamic relocs needed for local syms too.  */
                   s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
@@ -4000,8 +4001,8 @@ m32r_elf_check_relocs (bfd *abfd,
                   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;
index 146a86d312038476eb64f5585492286133312898..589dccfb35da31591f6810567a9534ad2044ae26 100644 (file)
@@ -745,14 +745,16 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
                  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)
index bfb1ee83905a4d52d98974222a1ac68e3b8e2400..2134af2c761e037bd03339e9e531c2561636580b 100644 (file)
@@ -3469,13 +3469,15 @@ ppc_elf_check_relocs (bfd *abfd,
                     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;
index a2433636ffc13a1740a30fd84de9a91c47477d67..55090c6a0c0d4310337f6e94568867a04015268a 100644 (file)
@@ -1319,14 +1319,15 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
                     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;
@@ -2038,10 +2039,7 @@ elf_s390_size_dynamic_sections (output_bfd, info)
        {
          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))
index b2b7c6be918a135518b152a434fd4bc66481bc3a..abbee05c51c75939262db7a5f43fb84aaf0cb2f0 100644 (file)
@@ -6565,6 +6565,7 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
              else
                {
                  asection *s;
+                 void *vpp;
 
                  /* Track dynamic relocs needed for local syms too.  */
                  s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
@@ -6572,8 +6573,8 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *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;
index f10af8b6ede8e3f34b83653900c0a13b27bc07f5..9bc2fcfbcf98eebbb6d2f3de1b7a038030f55358 100644 (file)
@@ -4767,13 +4767,15 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
                     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;
@@ -6119,9 +6121,15 @@ dec_dynrel_count (bfd_vma r_info,
   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)
     {
@@ -7638,10 +7646,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
        {
          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))
index 1c5a5f73e9e1c7e37d078ac2ffd544530710dc09..7808c3fd1a3732a888aa7c15a9ad63b49a832005 100644 (file)
@@ -1285,13 +1285,15 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
                     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;
@@ -2009,10 +2011,7 @@ elf_s390_size_dynamic_sections (output_bfd, info)
        {
          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))
index 28ada821c3fae09c9db6f77071802c411486046e..27d2dc3854bb3d7bc15dc0df1bdf9db77f2f4a5e 100644 (file)
@@ -7638,7 +7638,11 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
              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:
index 264f2627af9598128668229900aa6b1df351cdba..eff34eadf04dcb7b3757f8595aabd5beabbf89f6 100644 (file)
@@ -1381,13 +1381,15 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
                     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;
@@ -2071,10 +2073,7 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd,
        {
          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))
index 3dca9b3e93557d6b76a3302914e3e967ad77ceb3..53e16e1c8e793a3ff8c6a53cc2c0b0e4347b908c 100644 (file)
@@ -1666,14 +1666,15 @@ ieee_slurp_section_data (bfd *abfd)
   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)
index 2647f82f00c3a30efb489a41029c14384181d264..74d2c310a037ffb8d9d8932655cf35eaae94ca1b 100644 (file)
@@ -384,11 +384,13 @@ oasys_slurp_section_data (bfd *const abfd)
 
            if (! per->initialized)
              {
+               arelent **relpp;
+
                per->data = bfd_zalloc (abfd, section->size);
                if (!per->data)
                  return FALSE;
-               per->reloc_tail_ptr
-                 = (oasys_reloc_type **) &section->relocation;
+               relpp = &section->relocation;
+               per->reloc_tail_ptr = (oasys_reloc_type **) relpp;
                per->had_vma = FALSE;
                per->initialized = TRUE;
                section->reloc_count = 0;
index 7f20b71917f35c24698f390cee7d3201fd3f35f9..1f8f8b55a4b78ae7a703c1942a3c119f3ad3eb1d 100644 (file)
@@ -1,3 +1,9 @@
+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.
index 19efc142188c9cd4e36e88941671923554dc4d83..35875d1ac33f9f0ac8cf205e00c185871b4badf9 100644 (file)
@@ -32,11 +32,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, US
 
 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.  */
@@ -90,7 +85,7 @@ powerpc_dialect (struct disassemble_info *info)
        dialect |= PPC_OPCODE_64;
     }
 
-  ((struct dis_private *) &info->private_data)->dialect = dialect;
+  info->private_data = (char *) 0 + dialect;
   return dialect;
 }
 
@@ -99,7 +94,7 @@ powerpc_dialect (struct disassemble_info *info)
 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);
 }
 
@@ -108,7 +103,7 @@ print_insn_big_powerpc (bfd_vma memaddr, struct disassemble_info *info)
 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);
 }