linux-user: Drop image_info.alignment

This field is write-only.  Use only the function-local
variable within load_elf_image.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2024-11-12 11:33:38 -08:00
parent c81d1fafa6
commit dff406754e
2 changed files with 3 additions and 5 deletions

View File

@ -3220,7 +3220,7 @@ static void load_elf_image(const char *image_name, const ImageSource *src,
* amount of memory to handle that. Locate the interpreter, if any. * amount of memory to handle that. Locate the interpreter, if any.
*/ */
loaddr = -1, hiaddr = 0; loaddr = -1, hiaddr = 0;
info->alignment = 0; align = 0;
info->exec_stack = EXSTACK_DEFAULT; info->exec_stack = EXSTACK_DEFAULT;
for (i = 0; i < ehdr->e_phnum; ++i) { for (i = 0; i < ehdr->e_phnum; ++i) {
struct elf_phdr *eppnt = phdr + i; struct elf_phdr *eppnt = phdr + i;
@ -3234,7 +3234,7 @@ static void load_elf_image(const char *image_name, const ImageSource *src,
hiaddr = a; hiaddr = a;
} }
++info->nsegs; ++info->nsegs;
info->alignment |= eppnt->p_align; align |= eppnt->p_align;
} else if (eppnt->p_type == PT_INTERP && pinterp_name) { } else if (eppnt->p_type == PT_INTERP && pinterp_name) {
g_autofree char *interp_name = NULL; g_autofree char *interp_name = NULL;
@ -3264,8 +3264,7 @@ static void load_elf_image(const char *image_name, const ImageSource *src,
load_addr = loaddr; load_addr = loaddr;
align = pow2ceil(info->alignment); align = pow2ceil(align);
info->alignment = align;
if (pinterp_name != NULL) { if (pinterp_name != NULL) {
if (ehdr->e_type == ET_EXEC) { if (ehdr->e_type == ET_EXEC) {

View File

@ -44,7 +44,6 @@ struct image_info {
abi_ulong file_string; abi_ulong file_string;
uint32_t elf_flags; uint32_t elf_flags;
int personality; int personality;
abi_ulong alignment;
bool exec_stack; bool exec_stack;
/* Generic semihosting knows about these pointers. */ /* Generic semihosting knows about these pointers. */