aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 4bbbb08..cdd36d1 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -1466,21 +1466,21 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
}
skip = false;
+ relocate = false;
outrel.r_offset =
_bfd_elf_section_offset (output_bfd, info, input_section,
rela->r_offset);
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);
/* h->dynindx may be -1 if this symbol was marked to
become local. */
else if (h != NULL
@@ -1489,7 +1489,6 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
& ELF_LINK_HASH_DEF_REGULAR) == 0))
{
BFD_ASSERT (h->dynindx != -1);
- relocate = false;
outrel.r_info = ELF64_R_INFO (h->dynindx, r_type);
outrel.r_addend = relocation + rela->r_addend;
}
@@ -1530,7 +1529,6 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
BFD_ASSERT (sindx > 0);
}
- relocate = false;
outrel.r_info = ELF64_R_INFO (sindx, r_type);
outrel.r_addend = relocation + rela->r_addend;
}