* elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Don't error

on zero size dynbss symbol.
	* elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
	* elf32-cr16.c (_bfd_cr16_elf_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-lm32.c (lm32_elf_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-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise.
	* elf32-tilepro.c (tilepro_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 (elf_x86_64_adjust_dynamic_symbol): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
	* elfxx-tilegx.c (tilegx_elf_adjust_dynamic_symbol): Likewise.
This commit is contained in:
Alan Modra 2012-03-13 06:04:37 +00:00
parent fa3064dd8a
commit 1d7e9d183f
23 changed files with 65 additions and 193 deletions

View File

@ -1,3 +1,29 @@
2012-03-12 Alan Modra <amodra@gmail.com>
* elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Don't warn
on zero size dynbss symbol.
* elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
* elf32-cr16.c (_bfd_cr16_elf_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-lm32.c (lm32_elf_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-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise.
* elf32-tilepro.c (tilepro_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 (elf_x86_64_adjust_dynamic_symbol): Likewise.
* elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
* elfxx-tilegx.c (tilegx_elf_adjust_dynamic_symbol): Likewise.
2012-03-10 Edmar Wienskoski <edmar@freescale.com>
* archures.c: Add bfd_mach_ppc_e5500 and bfd_mach_ppc_e6500.

View File

@ -1,6 +1,6 @@
/* Matsushita 10300 specific support for 32-bit ELF
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -5023,13 +5023,6 @@ _bfd_mn10300_elf_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
@ -5047,7 +5040,7 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (struct bfd_link_info * info,
copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rela.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
asection * srel;

View File

@ -1,6 +1,6 @@
/* 32-bit ELF support for ARM
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009, 2010, 2011 Free Software Foundation, Inc.
2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -12846,13 +12846,6 @@ 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
@ -12869,7 +12862,7 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info,
copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rel(a).bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
asection *srel;

View File

@ -1,5 +1,5 @@
/* BFD back-end for National Semiconductor's CR16 ELF
Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright 2007, 2008, 2009, 2010, 2012 Free Software Foundation, Inc.
Written by M R Swami Reddy.
This file is part of BFD, the Binary File Descriptor library.
@ -2446,13 +2446,6 @@ _bfd_cr16_elf_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
@ -2470,7 +2463,7 @@ _bfd_cr16_elf_adjust_dynamic_symbol (struct bfd_link_info * info,
copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rela.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
asection * srel;

View File

@ -1,6 +1,6 @@
/* CRIS-specific support for 32-bit ELF.
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010, 2011 Free Software Foundation, Inc.
2010, 2011, 2012 Free Software Foundation, Inc.
Contributed by Axis Communications AB.
Written by Hans-Peter Nilsson, based on elf32-fr30.c
PIC and shlib bits based primarily on elf32-m68k.c and elf32-i386.c.
@ -3052,13 +3052,6 @@ elf_cris_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
@ -3076,7 +3069,7 @@ elf_cris_adjust_dynamic_symbol (struct bfd_link_info *info,
copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rela.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
asection *srel;

View File

@ -1,6 +1,6 @@
/* BFD back-end for HP PA-RISC ELF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Original code by
@ -1898,13 +1898,6 @@ 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
@ -1922,7 +1915,7 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
/* We must generate a COPY reloc to tell the dynamic linker to
copy the initial value out of the dynamic object and into the
runtime process image. */
if ((eh->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((eh->root.u.def.section->flags & SEC_ALLOC) != 0 && eh->size != 0)
{
htab->srelbss->size += sizeof (Elf32_External_Rela);
eh->needs_copy = 1;

View File

@ -1,6 +1,6 @@
/* i370-specific support for 32-bit ELF
Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2010, 2011 Free Software Foundation, Inc.
2005, 2006, 2007, 2008, 2010, 2011, 2012 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
Hacked by Linas Vepstas for i370 linas@linas.org
@ -498,13 +498,6 @@ 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
@ -529,7 +522,7 @@ i370_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rela.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
asection *srel;

View File

@ -1,6 +1,6 @@
/* Intel 80386/80486-specific support for 32-bit ELF
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -2177,13 +2177,6 @@ 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
@ -2197,7 +2190,7 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info,
/* We must generate a R_386_COPY reloc to tell the dynamic linker to
copy the initial value out of the dynamic object and into the
runtime process image. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
htab->srelbss->size += sizeof (Elf32_External_Rel);
h->needs_copy = 1;

View File

@ -1,5 +1,5 @@
/* Lattice Mico32-specific support for 32-bit ELF
Copyright 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Copyright 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Contributed by Jon Beniston <jon@beniston.com>
This file is part of BFD, the Binary File Descriptor library.
@ -1863,13 +1863,6 @@ lm32_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
@ -1891,7 +1884,7 @@ lm32_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
to copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rela.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
asection *srel;

View File

@ -1,6 +1,6 @@
/* M32R-specific support for 32-bit ELF.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -1922,13 +1922,6 @@ 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
@ -1950,7 +1943,7 @@ m32r_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
to copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rela.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
asection *srel;

View File

@ -1,6 +1,6 @@
/* Motorola 68k series support for 32-bit ELF
Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -3252,13 +3252,6 @@ elf_m68k_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
@ -3276,7 +3269,7 @@ elf_m68k_adjust_dynamic_symbol (info, h)
copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rela.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
asection *srel;

View File

@ -5045,13 +5045,6 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
return TRUE;
}
if (h->size == 0)
{
info->callbacks->einfo (_("%P: dynamic variable `%s' is zero size\n"),
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
@ -5075,7 +5068,7 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rela.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
asection *srel;

View File

@ -1,6 +1,6 @@
/* IBM S/390-specific support for 32-bit ELF
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2011 Free Software Foundation, Inc.
2011, 2012 Free Software Foundation, Inc.
Contributed by Carl B. Pedersen and Martin Schwidefsky.
This file is part of BFD, the Binary File Descriptor library.
@ -1647,13 +1647,6 @@ 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
@ -1669,7 +1662,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
/* We must generate a R_390_COPY reloc to tell the dynamic linker to
copy the initial value out of the dynamic object and into the
runtime process image. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
htab->srelbss->size += sizeof (Elf32_External_Rela);
h->needs_copy = 1;

View File

@ -2927,13 +2927,6 @@ 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
@ -2951,7 +2944,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rela.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
asection *srel;

View File

@ -1,5 +1,5 @@
/* 32-bit ELF support for TI C6X
Copyright 2010, 2011
Copyright 2010, 2011, 2012
Free Software Foundation, Inc.
Contributed by Joseph Myers <joseph@codesourcery.com>
Bernd Schmidt <bernds@codesourcery.com>
@ -2157,13 +2157,6 @@ elf32_tic6x_adjust_dynamic_symbol (struct bfd_link_info *info,
if (htab == NULL)
return FALSE;
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
@ -2177,7 +2170,7 @@ elf32_tic6x_adjust_dynamic_symbol (struct bfd_link_info *info,
/* We must generate a R_C6000_COPY reloc to tell the dynamic linker to
copy the initial value out of the dynamic object and into the
runtime process image. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
htab->srelbss->size += sizeof (Elf32_External_Rela);
h->needs_copy = 1;

View File

@ -1,5 +1,5 @@
/* TILEPro-specific support for 32-bit ELF.
Copyright 2011 Free Software Foundation, Inc.
Copyright 2011, 2012 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -2133,13 +2133,6 @@ tilepro_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
@ -2154,7 +2147,7 @@ tilepro_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
to copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rel.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
htab->srelbss->size += TILEPRO_ELF_RELA_BYTES;
h->needs_copy = 1;

View File

@ -1,6 +1,6 @@
/* VAX series support for 32-bit ELF
Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Contributed by Matt Thomas <matt@3am-software.com>.
@ -1036,13 +1036,6 @@ 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
@ -1060,7 +1053,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rela.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
asection *srel;

View File

@ -6562,13 +6562,6 @@ 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)
{
info->callbacks->einfo (_("%P: dynamic variable `%s' is zero size\n"),
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
@ -6583,7 +6576,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
to copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rela.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
htab->relbss->size += sizeof (Elf64_External_Rela);
h->needs_copy = 1;

View File

@ -1,6 +1,6 @@
/* IBM S/390-specific support for 64-bit ELF
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010, 2011 Free Software Foundation, Inc.
2010, 2011, 2012 Free Software Foundation, Inc.
Contributed Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of BFD, the Binary File Descriptor library.
@ -1630,13 +1630,6 @@ elf_s390_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
@ -1654,7 +1647,7 @@ elf_s390_adjust_dynamic_symbol (struct bfd_link_info *info,
/* We must generate a R_390_COPY reloc to tell the dynamic linker to
copy the initial value out of the dynamic object and into the
runtime process image. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
htab->srelbss->size += sizeof (Elf64_External_Rela);
h->needs_copy = 1;

View File

@ -1,6 +1,6 @@
/* SuperH SH64-specific support for 64-bit ELF
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010, 2011 Free Software Foundation, Inc.
2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -3376,13 +3376,6 @@ 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
@ -3400,7 +3393,7 @@ sh64_elf64_adjust_dynamic_symbol (struct bfd_link_info *info,
copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rela.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
asection *srel;

View File

@ -2166,13 +2166,6 @@ elf_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
@ -2190,7 +2183,7 @@ elf_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info,
/* We must generate a R_X86_64_COPY reloc to tell the dynamic linker
to copy the initial value out of the dynamic object and into the
runtime process image. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
const struct elf_backend_data *bed;
bed = get_elf_backend_data (info->output_bfd);

View File

@ -2114,13 +2114,6 @@ _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
@ -2135,7 +2128,7 @@ _bfd_sparc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
to copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rel.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
htab->srelbss->size += SPARC_ELF_RELA_BYTES (htab);
h->needs_copy = 1;

View File

@ -1,5 +1,5 @@
/* TILE-Gx-specific support for ELF.
Copyright 2011 Free Software Foundation, Inc.
Copyright 2011, 2012 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -2367,13 +2367,6 @@ tilegx_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
@ -2388,7 +2381,7 @@ tilegx_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
to copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rel.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
{
htab->srelbss->size += TILEGX_ELF_RELA_BYTES (htab);
h->needs_copy = 1;