summaryrefslogtreecommitdiffstats
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-08-18 01:28:26 +0000
committerAlan Modra <amodra@gmail.com>2005-08-18 01:28:26 +0000
commit909272ee76c4915692763a3dde6b4b1dc21fc166 (patch)
treeb3d5d745bbc0cc2085cb20c4d952ba95ae0380e9 /bfd
parent11bcca22f4e218e248dceb797fd92947004bcf9c (diff)
downloadppe42-binutils-909272ee76c4915692763a3dde6b4b1dc21fc166.tar.gz
ppe42-binutils-909272ee76c4915692763a3dde6b4b1dc21fc166.zip
* 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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog21
-rw-r--r--bfd/elf-m10300.c7
-rw-r--r--bfd/elf32-arm.c7
-rw-r--r--bfd/elf32-cris.c7
-rw-r--r--bfd/elf32-hppa.c7
-rw-r--r--bfd/elf32-i370.c7
-rw-r--r--bfd/elf32-i386.c7
-rw-r--r--bfd/elf32-m32r.c7
-rw-r--r--bfd/elf32-m68k.c7
-rw-r--r--bfd/elf32-ppc.c7
-rw-r--r--bfd/elf32-s390.c7
-rw-r--r--bfd/elf32-sh.c7
-rw-r--r--bfd/elf32-vax.c7
-rw-r--r--bfd/elf64-ppc.c7
-rw-r--r--bfd/elf64-s390.c7
-rw-r--r--bfd/elf64-sh64.c7
-rw-r--r--bfd/elf64-x86-64.c7
-rw-r--r--bfd/elfxx-sparc.c7
18 files changed, 140 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index af031e0b8c..27b6231106 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index b3f80449db..3935c85edd 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -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
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 2dc153f51a..9bc7eefe4b 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -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
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 618210a121..4580beabd9 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -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
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index e3c45ec9ef..7f20bd6aa2 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -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
diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c
index 406248937b..c9c4433780 100644
--- a/bfd/elf32-i370.c
+++ b/bfd/elf32-i370.c
@@ -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
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 48e76e916e..a2f1b1c660 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -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
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index 082f496ccd..d2f850891e 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -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
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index db320c229c..71f98bb671 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -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
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 168e58cdaf..bfb1ee8390 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -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
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 713ad66acd..9001a51cde 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -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
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index b62881ce53..364ef237dd 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -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
diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c
index 8faf99c519..7a150ba739 100644
--- a/bfd/elf32-vax.c
+++ b/bfd/elf32-vax.c
@@ -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
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 31ad3d0e30..3f219fa9d7 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -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
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index d5ce602257..38ce556446 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -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
diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c
index 9fb6c3e7e1..337b1809c8 100644
--- a/bfd/elf64-sh64.c
+++ b/bfd/elf64-sh64.c
@@ -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
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 7b06ef4a71..8511a1643c 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -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
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index b8b87c9128..b83cd140d8 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -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
OpenPOWER on IntegriCloud