diff options
author | Alan Modra <amodra@bigpond.net.au> | 2005-08-18 01:28:26 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2005-08-18 01:28:26 +0000 |
commit | e951dc97bb6bdd71b4966cecead8e47fda3e5c32 (patch) | |
tree | 90b1c276ba06207a4754b2e11d61fe784e294b95 /bfd | |
parent | b0f3d6455f2d3766b7a9a9c4c7640fa3472092ac (diff) | |
download | gdb-e951dc97bb6bdd71b4966cecead8e47fda3e5c32.tar.gz |
* 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/ChangeLog | 21 | ||||
-rw-r--r-- | bfd/elf-m10300.c | 7 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 7 | ||||
-rw-r--r-- | bfd/elf32-cris.c | 7 | ||||
-rw-r--r-- | bfd/elf32-hppa.c | 7 | ||||
-rw-r--r-- | bfd/elf32-i370.c | 7 | ||||
-rw-r--r-- | bfd/elf32-i386.c | 7 | ||||
-rw-r--r-- | bfd/elf32-m32r.c | 7 | ||||
-rw-r--r-- | bfd/elf32-m68k.c | 7 | ||||
-rw-r--r-- | bfd/elf32-ppc.c | 7 | ||||
-rw-r--r-- | bfd/elf32-s390.c | 7 | ||||
-rw-r--r-- | bfd/elf32-sh.c | 7 | ||||
-rw-r--r-- | bfd/elf32-vax.c | 7 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 7 | ||||
-rw-r--r-- | bfd/elf64-s390.c | 7 | ||||
-rw-r--r-- | bfd/elf64-sh64.c | 7 | ||||
-rw-r--r-- | bfd/elf64-x86-64.c | 7 | ||||
-rw-r--r-- | bfd/elfxx-sparc.c | 7 |
18 files changed, 140 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index af031e0b8cb..27b62311064 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 b3f80449db2..3935c85edda 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 2dc153f51ac..9bc7eefe4bb 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 618210a1215..4580beabd90 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 e3c45ec9ef5..7f20bd6aa23 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 406248937b2..c9c44337805 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 48e76e916e8..a2f1b1c6603 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 082f496ccd0..d2f850891e3 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 db320c229cd..71f98bb6716 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 168e58cdaf3..bfb1ee83905 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 713ad66acde..9001a51cde8 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 b62881ce537..364ef237dd1 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 8faf99c5190..7a150ba7396 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 31ad3d0e305..3f219fa9d72 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 d5ce602257f..38ce556446a 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 9fb6c3e7e10..337b1809c8b 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 7b06ef4a71a..8511a1643c2 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 b8b87c91284..b83cd140d8f 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 |