OSDN Git Service

hw/elf_ops.h: switch to ssize_t for elf loader return type
authorLuc Michel <lmichel@kalray.eu>
Thu, 14 Oct 2021 19:43:25 +0000 (21:43 +0200)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 20 Oct 2021 23:26:19 +0000 (16:26 -0700)
commit8975eb891fb6df56442763acf2bdb7c03b0933bf
tree4bdb8e5d793316f52264d457011c290460bb7807
parentb84722cf4455b44a98b5a527067001dee58ace10
hw/elf_ops.h: switch to ssize_t for elf loader return type

Until now, int was used as the return type for all the ELF
loader related functions. The returned value is the sum of all loaded
program headers "MemSize" fields.

Because of the overflow check in elf_ops.h, trying to load an ELF bigger
than INT_MAX will fail. Switch to ssize_t to remove this limitation.

Signed-off-by: Luc Michel <lmichel@kalray.eu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20211014194325.19917-1-lmichel@kalray.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
hw/core/loader.c
include/hw/elf_ops.h
include/hw/loader.h