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