Add a check for a non-null owner before dereferencing it. Fixes ld core-dumps

related to lkms.
This commit is contained in:
christos 2004-06-22 16:35:49 +00:00
parent b83f6fa528
commit d6bf74cb9e
1 changed files with 2 additions and 1 deletions

View File

@ -2078,7 +2078,8 @@ elf_link_add_object_symbols (abfd, info)
bfd *common_bfd;
symbol_align = ffs (h->root.u.def.value) - 1;
if ((h->root.u.def.section->owner->flags & DYNAMIC) == 0)
if (h->root.u.def.section->owner &&
(h->root.u.def.section->owner->flags & DYNAMIC) == 0)
{
normal_align = h->root.u.def.section->alignment_power;
if (normal_align > symbol_align)