Update libs/libc/modlib/modlib_bind.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
anjiahao 2022-04-01 20:30:03 +08:00 committed by Xiang Xiao
parent c7badac601
commit 5b214888aa

View File

@ -486,7 +486,7 @@ static int modlib_relocateadd(FAR struct module_s *modp,
/* Calculate the relocation address. */
if (rela->r_offset ||
rela->r_offset > dstsec->sh_size - sizeof(uint32_t))
rela->r_offset + sizeof(uint32_t) > dstsec->sh_size)
{
berr("ERROR: Section %d reloc %d: "
"Relocation address out of range, "