PTR p;
{
struct bfd_link_info *info = (struct bfd_link_info *) p;
- bfd *dynobj = elf_hash_table (info)->dynobj;
-
- BFD_ASSERT (dynobj != NULL);
if (h->root.root.type == bfd_link_hash_warning)
h = (struct elf_cris_link_hash_entry *) h->root.root.u.i.link;
else
{
/* No GOT entry for this symbol. We need to create one. */
- asection *sgot = bfd_get_section_by_name (dynobj, ".got");
- asection *srelgot
- = bfd_get_section_by_name (dynobj, ".rela.got");
+ bfd *dynobj = elf_hash_table (info)->dynobj;
+ asection *sgot;
+ asection *srelgot;
+
+ BFD_ASSERT (dynobj != NULL);
+ sgot = bfd_get_section_by_name (dynobj, ".got");
+ srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
/* Put an accurate refcount there. */
h->root.got.refcount = h->gotplt_refcount;
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