Skip to content

Commit

Permalink
Fix m68k_elf32_atariprg_relocate_section
Browse files Browse the repository at this point in the history
We must use _bfd_elf_section_offset to compute the real section offset.

This is needed especially for .eh_frame sections, which might have
parts of its contents merged.
  • Loading branch information
th-otto committed Sep 26, 2023
1 parent f5e00d9 commit 90d470c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bfd/elf32-atariprg.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,13 @@ m68k_elf32_atariprg_relocate_section (bfd *output_bfd,
case R_68K_32:
{
/* Absolute 32-bit address. */
bfd_vma relocation = input_section->output_section->vma + input_section->output_offset + rel->r_offset;
if (! add_tpa_relocation_entry (output_bfd, input_bfd, relocation))
return false;
bfd_vma offset = _bfd_elf_section_offset(output_bfd, info, input_section, rel->r_offset);
if (offset != (bfd_vma) -1 && offset != (bfd_vma) -2)
{
bfd_vma relocation = input_section->output_section->vma + input_section->output_offset + offset;
if (! add_tpa_relocation_entry (output_bfd, input_bfd, relocation))
return false;
}
}
break;

Expand Down

0 comments on commit 90d470c

Please sign in to comment.