Skip to content

Commit

Permalink
greenhills: fix the pointless compare warning
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
guoshichao authored and xiaoxiang781216 committed Aug 24, 2024
1 parent 04f5aae commit cc79201
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions libs/libc/modlib/modlib_bind.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit cc79201

Please sign in to comment.