Don't allow a symbol + offset in a merge section to translated to a

.section + offset reference if offset is negative.
This commit is contained in:
matt 2010-01-01 06:12:55 +00:00
parent a4ce70f1ad
commit e34524fa00
1 changed files with 4 additions and 3 deletions

View File

@ -822,10 +822,11 @@ adjust_reloc_syms (bfd *abfd ATTRIBUTE_UNUSED,
}
/* Never adjust a reloc against local symbol in a merge section with
a non-zero addend if the addend would place the relocation otside
the section's limits. */
a non-negative addend or if the addend would place the relocation
outside the section's limits. */
if ((symsec->flags & SEC_MERGE) != 0
&& (S_GET_VALUE(sym) + fixp->fx_offset >= bfd_get_section_size(symsec)
&& (S_GET_VALUE(sym) + fixp->fx_offset < S_GET_VALUE(sym)
|| S_GET_VALUE(sym) + fixp->fx_offset >= bfd_get_section_size(symsec)
|| fixp->fx_subsy != NULL))
continue;