[PATCH 12/15] ARM: module: Remove always false check

Sascha Hauer s.hauer at pengutronix.de
Mon May 17 11:54:21 PDT 2021


rel->r_offset < 0 is always false because r_offset is unsigned. Remove
check.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/lib32/module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/lib32/module.c b/arch/arm/lib32/module.c
index 5073675180..7214e3c73c 100644
--- a/arch/arm/lib32/module.c
+++ b/arch/arm/lib32/module.c
@@ -38,7 +38,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
 
 		sym = ((Elf32_Sym *)symsec->sh_addr) + offset;
 
-		if (rel->r_offset < 0 || rel->r_offset > dstsec->sh_size - sizeof(u32)) {
+		if (rel->r_offset > dstsec->sh_size - sizeof(u32)) {
 			printf("%s: out of bounds relocation, "
 				"section %u reloc %u offset %d size %d\n",
 				module->name, relindex, i, rel->r_offset,
-- 
2.29.2




More information about the barebox mailing list