OSDN Git Service

* elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Warn on
authoramodra <amodra>
Thu, 18 Aug 2005 01:28:18 +0000 (01:28 +0000)
committeramodra <amodra>
Thu, 18 Aug 2005 01:28:18 +0000 (01:28 +0000)
zero size dynamic variables.
* elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
* elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise.
* elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
* elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise.
* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise.
* elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise.
* elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
* elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
* elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise.
* elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise.
* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
* elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
* elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise.
* elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise.
* elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.

18 files changed:
bfd/ChangeLog
bfd/elf-m10300.c
bfd/elf32-arm.c
bfd/elf32-cris.c
bfd/elf32-hppa.c
bfd/elf32-i370.c
bfd/elf32-i386.c
bfd/elf32-m32r.c
bfd/elf32-m68k.c
bfd/elf32-ppc.c
bfd/elf32-s390.c
bfd/elf32-sh.c
bfd/elf32-vax.c
bfd/elf64-ppc.c
bfd/elf64-s390.c
bfd/elf64-sh64.c
bfd/elf64-x86-64.c
bfd/elfxx-sparc.c

index af031e0..27b6231 100644 (file)
@@ -1,3 +1,24 @@
+2005-08-18  Alan Modra  <amodra@bigpond.net.au>
+
+       * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Warn on
+       zero size dynamic variables.
+       * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
+       * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise.
+       * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
+       * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise.
+       * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise.
+       * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise.
+       * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
+       * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
+       * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
+       * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise.
+       * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise.
+       * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
+       * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
+       * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise.
+       * elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise.
+       * elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
+
 2005-08-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR binutils/1179
index b3f8044..3935c85 100644 (file)
@@ -4099,6 +4099,13 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (info, h)
   if (!h->non_got_ref)
     return TRUE;
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index 2dc153f..9bc7eef 100644 (file)
@@ -5388,6 +5388,13 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info,
   if (info->shared || globals->root.is_relocatable_executable)
     return TRUE;
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index 618210a..4580bea 100644 (file)
@@ -2380,6 +2380,13 @@ elf_cris_adjust_dynamic_symbol (info, h)
   if (!h->non_got_ref)
     return TRUE;
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index e3c45ec..7f20bd6 100644 (file)
@@ -1807,6 +1807,13 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
        }
     }
 
+  if (eh->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            eh->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index 4062489..c9c4433 100644 (file)
@@ -486,6 +486,13 @@ i370_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
   if (info->shared)
     return TRUE;
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index 48e76e9..a2f1b1c 100644 (file)
@@ -1462,6 +1462,13 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info,
        }
     }
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index 082f496..d2f8508 100644 (file)
@@ -1911,6 +1911,13 @@ m32r_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
       return TRUE;
     }
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index db320c2..71f98bb 100644 (file)
@@ -1081,6 +1081,13 @@ elf_m68k_adjust_dynamic_symbol (info, h)
   if (info->shared)
     return TRUE;
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index 168e58c..bfb1ee8 100644 (file)
@@ -4147,6 +4147,13 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
        }
     }
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index 713ad66..9001a51 100644 (file)
@@ -1683,6 +1683,13 @@ elf_s390_adjust_dynamic_symbol (info, h)
        }
     }
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index b62881c..364ef23 100644 (file)
@@ -3915,6 +3915,13 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
       return TRUE;
     }
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index 8faf99c..7a150ba 100644 (file)
@@ -1054,6 +1054,13 @@ elf_vax_adjust_dynamic_symbol (info, h)
   if (info->shared)
     return TRUE;
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index 31ad3d0..3f219fa 100644 (file)
@@ -5712,6 +5712,13 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
   /* This is a reference to a symbol defined by a dynamic object which
      is not a function.  */
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index d5ce602..38ce556 100644 (file)
@@ -1655,6 +1655,13 @@ elf_s390_adjust_dynamic_symbol (info, h)
        }
     }
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index 9fb6c3e..337b180 100644 (file)
@@ -3434,6 +3434,13 @@ sh64_elf64_adjust_dynamic_symbol (struct bfd_link_info *info,
   if (!h->non_got_ref)
     return TRUE;
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index 7b06ef4..8511a16 100644 (file)
@@ -1247,6 +1247,13 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info,
        }
     }
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.         There will be
      an entry for this symbol in the .dynsym section.  The dynamic
index b8b87c9..b83cd14 100644 (file)
@@ -1716,6 +1716,13 @@ _bfd_sparc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
       return TRUE;
     }
 
+  if (h->size == 0)
+    {
+      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
+                            h->root.root.string);
+      return TRUE;
+    }
+
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic