[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] hw/elf_ops.h: switch to ssize_t for elf loader return type
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH] hw/elf_ops.h: switch to ssize_t for elf loader return type |
Date: |
Wed, 6 Oct 2021 23:09:40 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 |
On 10/6/21 21:28, Luc Michel wrote:
> 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>
> ---
> include/hw/elf_ops.h | 25 +++++++++---------
> include/hw/loader.h | 60 ++++++++++++++++++++++----------------------
> hw/core/loader.c | 60 +++++++++++++++++++++++---------------------
> 3 files changed, 74 insertions(+), 71 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>