aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/ChangeLog26
-rw-r--r--bfd/elf-m10300.c11
-rw-r--r--bfd/elf32-arm.c11
-rw-r--r--bfd/elf32-cr16.c11
-rw-r--r--bfd/elf32-cris.c11
-rw-r--r--bfd/elf32-hppa.c11
-rw-r--r--bfd/elf32-i370.c11
-rw-r--r--bfd/elf32-i386.c11
-rw-r--r--bfd/elf32-lm32.c11
-rw-r--r--bfd/elf32-m32r.c11
-rw-r--r--bfd/elf32-m68k.c11
-rw-r--r--bfd/elf32-ppc.c9
-rw-r--r--bfd/elf32-s390.c11
-rw-r--r--bfd/elf32-sh.c9
-rw-r--r--bfd/elf32-tic6x.c11
-rw-r--r--bfd/elf32-tilepro.c11
-rw-r--r--bfd/elf32-vax.c11
-rw-r--r--bfd/elf64-ppc.c9
-rw-r--r--bfd/elf64-s390.c11
-rw-r--r--bfd/elf64-sh64.c11
-rw-r--r--bfd/elf64-x86-64.c9
-rw-r--r--bfd/elfxx-sparc.c9
-rw-r--r--bfd/elfxx-tilegx.c11
23 files changed, 65 insertions, 193 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index a65e854..eacf84e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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.
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index d5e183d..428de4c 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -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;
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 62a0b8d..9231552 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -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;
diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c
index 0118131..1f2fb49 100644
--- a/bfd/elf32-cr16.c
+++ b/bfd/elf32-cr16.c
@@ -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;
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 563e2c0..c0da359 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -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;
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index dcf6df0..10ec4f5 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -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;
diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c
index 8082927..5f713c7 100644
--- a/bfd/elf32-i370.c
+++ b/bfd/elf32-i370.c
@@ -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;
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 01c0669..3014a0a 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -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;
diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c
index 07add20..667b01c 100644
--- a/bfd/elf32-lm32.c
+++ b/bfd/elf32-lm32.c
@@ -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;
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index 37d995d..044e328 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -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;
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index bd660e9..26cec39 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -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;
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index bbf54a4..3125c09 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -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;
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 85a20bd..fcced0f 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -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;
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 8d8b28c..9bc2dd5 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -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;
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
index 19287fe..6d6b59b 100644
--- a/bfd/elf32-tic6x.c
+++ b/bfd/elf32-tic6x.c
@@ -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;
diff --git a/bfd/elf32-tilepro.c b/bfd/elf32-tilepro.c
index 48a99aa..a907342 100644
--- a/bfd/elf32-tilepro.c
+++ b/bfd/elf32-tilepro.c
@@ -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;
diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c
index 643381c..2908df4 100644
--- a/bfd/elf32-vax.c
+++ b/bfd/elf32-vax.c
@@ -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;
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index fc779e6..f4f5d0b 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -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;
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 06f96a4..15e1f7e 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -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;
diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c
index 9202477..d19bb07 100644
--- a/bfd/elf64-sh64.c
+++ b/bfd/elf64-sh64.c
@@ -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;
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 47f1295..88c47f9 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -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);
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index 355382e..9155311c 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -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;
diff --git a/bfd/elfxx-tilegx.c b/bfd/elfxx-tilegx.c
index c7fd604..359b869 100644
--- a/bfd/elfxx-tilegx.c
+++ b/bfd/elfxx-tilegx.c
@@ -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;