aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-sh64.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf64-sh64.c')
-rw-r--r--bfd/elf64-sh64.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c
index ab22187..901bfa5 100644
--- a/bfd/elf64-sh64.c
+++ b/bfd/elf64-sh64.c
@@ -1746,6 +1746,7 @@ sh_elf64_relocate_section (output_bfd, info, input_bfd, input_section,
}
skip = false;
+ relocate = false;
outrel.r_offset
= _bfd_elf_section_offset (output_bfd, info,
@@ -1753,19 +1754,17 @@ sh_elf64_relocate_section (output_bfd, info, input_bfd, input_section,
if (outrel.r_offset == (bfd_vma) -1)
skip = true;
+ else if (outrel.r_offset == (bfd_vma) -1)
+ skip = true, relocate = true;
outrel.r_offset += (input_section->output_section->vma
+ input_section->output_offset);
if (skip)
- {
- memset (&outrel, 0, sizeof outrel);
- relocate = false;
- }
+ memset (&outrel, 0, sizeof outrel);
else if (r_type == R_SH_64_PCREL)
{
BFD_ASSERT (h != NULL && h->dynindx != -1);
- relocate = false;
outrel.r_info = ELF64_R_INFO (h->dynindx, R_SH_64_PCREL);
outrel.r_addend = rel->r_addend;
}
@@ -1785,7 +1784,6 @@ sh_elf64_relocate_section (output_bfd, info, input_bfd, input_section,
else
{
BFD_ASSERT (h->dynindx != -1);
- relocate = false;
outrel.r_info = ELF64_R_INFO (h->dynindx, R_SH_64);
outrel.r_addend = relocation + rel->r_addend;
}