diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-05-17 20:54:21 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-05-18 08:24:46 +0200 |
commit | 8f447dca02b62f22eee7cd28d1758386c120d3d4 (patch) | |
tree | 5626ae77d404d2e97ee67bbed9a7a90292be81b6 /arch/arm | |
parent | 3f151f89b2c1d3e76e376e9cb758a2c42eaddfc6 (diff) | |
download | barebox-8f447dca02b62f22eee7cd28d1758386c120d3d4.tar.gz barebox-8f447dca02b62f22eee7cd28d1758386c120d3d4.tar.xz |
ARM: module: Remove always false check
rel->r_offset < 0 is always false because r_offset is unsigned. Remove
check.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20210517185424.32145-13-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/lib32/module.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, |