diff --git a/libs/libc/modlib/modlib_bind.c b/libs/libc/modlib/modlib_bind.c index 17f7e5f28a6..925902ffbfc 100644 --- a/libs/libc/modlib/modlib_bind.c +++ b/libs/libc/modlib/modlib_bind.c @@ -486,7 +486,7 @@ static int modlib_relocateadd(FAR struct module_s *modp, /* Calculate the relocation address. */ if (rela->r_offset || - rela->r_offset > dstsec->sh_size - sizeof(uint32_t)) + rela->r_offset + sizeof(uint32_t) > dstsec->sh_size) { berr("ERROR: Section %d reloc %d: " "Relocation address out of range, "