modlib/modlib_bind:fix unsigned_compare with zero

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao 2022-04-01 16:20:03 +08:00 committed by Xiang Xiao
parent 2d499ac86d
commit 15142a8b10

View File

@ -297,7 +297,7 @@ static int modlib_relocate(FAR struct module_s *modp,
/* Calculate the relocation address. */
if (rel->r_offset < 0 ||
if (rel->r_offset ||
rel->r_offset > dstsec->sh_size - sizeof(uint32_t))
{
berr("ERROR: Section %d reloc %d: "
@ -485,7 +485,7 @@ static int modlib_relocateadd(FAR struct module_s *modp,
/* Calculate the relocation address. */
if (rela->r_offset < 0 ||
if (rela->r_offset ||
rela->r_offset > dstsec->sh_size - sizeof(uint32_t))
{
berr("ERROR: Section %d reloc %d: "