Browse Source

tools: prelink-riscv: Unmap the ELF image when done

The codes forget to call munmap() to unmap the ELF image that was
mapped by previous mmap().

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Rick Chen <rick@andestech.com>
Bin Meng 1 year ago
parent
commit
781a0308f4
1 changed files with 2 additions and 0 deletions
  1. 2 0
      tools/prelink-riscv.c

+ 2 - 0
tools/prelink-riscv.c

@@ -118,5 +118,7 @@ int main(int argc, const char *const *argv)
 			prelink_le32(data);
 	}
 
+	munmap(data, st.st_size);
+
 	return 0;
 }