if (h != NULL
&& h->root.type == bfd_link_hash_undefweak)
ok_tprel = TRUE;
- else
+ else if (sym_sec != NULL
+ && sym_sec->output_section != NULL)
{
value += sym_sec->output_offset;
value += sym_sec->output_section->vma;
goto error_ret;
if (sym_sec == NULL
+ || sym_sec->output_section == NULL
|| discarded_section (sym_sec))
continue;
if (hash == NULL)
{
sym_value = sym->st_value;
- ok_dest = TRUE;
+ if (sym_sec != NULL
+ && sym_sec->output_section != NULL)
+ ok_dest = TRUE;
}
else if (hash->elf.root.type == bfd_link_hash_defined
|| hash->elf.root.type == bfd_link_hash_defweak)