diff --git a/src/arch/aarch64/arch_elf.c b/src/arch/aarch64/arch_elf.c index 9ce586d447c473cb72d5a2fc8534eb3f78b89d9a..10399eef2d4f964ba9bd90de4e6a56342d79b636 100644 --- a/src/arch/aarch64/arch_elf.c +++ b/src/arch/aarch64/arch_elf.c @@ -202,7 +202,7 @@ int kpatch_arch_apply_relocate_add(struct object_file *o, GElf_Shdr *relsec) unsigned long val; void *loc, *loc2; - if (r->r_offset < 0 || r->r_offset >= tshdr->sh_size) { + if (r->r_offset >= tshdr->sh_size) { kperr("Relocation offset for section '%s'" " is at 0x%lx beyond the section size 0x%lx\n", scnname, r->r_offset, tshdr->sh_size); diff --git a/src/arch/x86/arch_elf.c b/src/arch/x86/arch_elf.c index 265fd37d9bec00379d7dc103154e849da7f2f3f0..f79a99641c30d8ec8fbff9d58a07fe73efe11147 100644 --- a/src/arch/x86/arch_elf.c +++ b/src/arch/x86/arch_elf.c @@ -56,7 +56,7 @@ int kpatch_arch_apply_relocate_add(struct object_file *o, GElf_Shdr *relsec) unsigned long val; void *loc, *loc2; - if (r->r_offset < 0 || r->r_offset >= tshdr->sh_size) { + if (r->r_offset >= tshdr->sh_size) { kperr("Relocation offset for section '%s'" " is at 0x%lx beyond the section size 0x%lx\n", scnname, r->r_offset, tshdr->sh_size);