From cc79201c5966ffe4205d40c4254fd46962a2d67c Mon Sep 17 00:00:00 2001 From: guoshichao Date: Sat, 3 Aug 2024 11:23:18 +0800 Subject: [PATCH] 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 --- libs/libc/modlib/modlib_bind.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/libs/libc/modlib/modlib_bind.c b/libs/libc/modlib/modlib_bind.c index 44a87c476db..51ea10cd2b8 100644 --- a/libs/libc/modlib/modlib_bind.c +++ b/libs/libc/modlib/modlib_bind.c @@ -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;