When adding a partial symbol for an enum value, we try to find the section
offset for the enum itself rather than the enum value. This fails if the
parent die is not set. Fix that.
if (pdi.raw_name == NULL)
complaint (_("malformed enumerator DIE ignored"));
else if (building_psymtab)
- add_partial_symbol (&pdi, cu);
+ {
+ if (lazy_expand_symtab_p)
+ pdi.die_parent = parent_die;
+ add_partial_symbol (&pdi, cu);
+ }
info_ptr = locate_pdi_sibling (reader, &pdi, info_ptr);
continue;