Verify that the symbols are of the right kind when applying fixup

to segment data. This prevens gas from SEGV when seeing code of
the type

    L0:
          addl    $(Loop-L0-3),%eax
    Loop:

This solves PR 6486 from Anders Hjalmarsson.
This commit is contained in:
kristerw 1999-01-02 19:25:40 +00:00
parent f274a1c1c5
commit 38a6811363

View File

@ -2733,6 +2733,7 @@ md_apply_fix3 (fixP, valp, seg)
} }
else if ((fixP->fx_r_type == BFD_RELOC_32) else if ((fixP->fx_r_type == BFD_RELOC_32)
&& aout_pic_flag && aout_pic_flag
&& (fixP->fx_addsy != NULL)
&& ((fixP->fx_addsy->bsym->flags & BSF_GLOBAL) != 0)) && ((fixP->fx_addsy->bsym->flags & BSF_GLOBAL) != 0))
{ {
if (!bfd_is_com_section(bfd_get_section(fixP->fx_addsy->bsym))) if (!bfd_is_com_section(bfd_get_section(fixP->fx_addsy->bsym)))