greenhills: fix the pointless compare warning

CC:  modlib/modlib_depend.c "modlib/modlib_bind.c", line 741: warning #186-D: pointless comparison of
          unsigned integer with zero
            if (rel->r_offset < 0)
                              ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
guoshichao 2024-08-03 11:23:18 +08:00 committed by Xiang Xiao
parent 04f5aaebfa
commit cc79201c59
1 changed files with 3 additions and 15 deletions

View File

@ -731,25 +731,13 @@ static int modlib_relocatedyn(FAR struct module_s *modp,
}
}
/* Calculate the relocation address. */
if (rel->r_offset < 0)
{
berr("ERROR: Section %d reloc %d:"
"Relocation address out of range, offset %u\n",
relidx, i, (int)rel->r_offset);
ret = -EINVAL;
lib_free(sym);
lib_free(rels);
lib_free(dyn);
return ret;
}
/* Now perform the architecture-specific relocation */
if ((idx_sym = ELF_R_SYM(rel->r_info)) != 0)
{
if (sym[idx_sym].st_shndx == SHN_UNDEF) /* We have an external reference */
/* We have an external reference */
if (sym[idx_sym].st_shndx == SHN_UNDEF)
{
FAR void *ep;