Skip to content

Commit

Permalink
Return false in fill_tparel when we encounter inconsistent relocations
Browse files Browse the repository at this point in the history
Calling BFD_ASSERT is not good enough here, we must return false
to abort the link
  • Loading branch information
th-otto committed Sep 17, 2023
1 parent 845f407 commit f5e00d9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bfd/elf32-atariprg.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,15 @@ fill_tparel (bfd *abfd)
for (i = 1; i < myinfo->relocs_used; i++)
{
bfd_signed_vma diff = myinfo->relocs[i] - myinfo->relocs[i - 1];
BFD_ASSERT (diff > 0); /* No backward relocation. */
/* No backward relocation. */
if (diff <= 0)
{
_bfd_error_handler ("%pB: duplicate relocation: " ADR_F " <= " ADR_F,
abfd,
(adr_t)myinfo->relocs[i], (adr_t)myinfo->relocs[i - 1]);
bfd_set_error (bfd_error_bad_value);
return false;
}
BFD_ASSERT (! (diff & 1)); /* No relocation to odd address. */
bytes += (diff + 253) / 254;
}
Expand Down

0 comments on commit f5e00d9

Please sign in to comment.