Skip to content

Commit cc79201

Browse files
extinguishxiaoxiang781216
authored andcommitted
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 <[email protected]>
1 parent 04f5aae commit cc79201

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

libs/libc/modlib/modlib_bind.c

+3-15
Original file line numberDiff line numberDiff line change
@@ -731,25 +731,13 @@ static int modlib_relocatedyn(FAR struct module_s *modp,
731731
}
732732
}
733733

734-
/* Calculate the relocation address. */
735-
736-
if (rel->r_offset < 0)
737-
{
738-
berr("ERROR: Section %d reloc %d:"
739-
"Relocation address out of range, offset %u\n",
740-
relidx, i, (int)rel->r_offset);
741-
ret = -EINVAL;
742-
lib_free(sym);
743-
lib_free(rels);
744-
lib_free(dyn);
745-
return ret;
746-
}
747-
748734
/* Now perform the architecture-specific relocation */
749735

750736
if ((idx_sym = ELF_R_SYM(rel->r_info)) != 0)
751737
{
752-
if (sym[idx_sym].st_shndx == SHN_UNDEF) /* We have an external reference */
738+
/* We have an external reference */
739+
740+
if (sym[idx_sym].st_shndx == SHN_UNDEF)
753741
{
754742
FAR void *ep;
755743

0 commit comments

Comments
 (0)