From patchwork Fri Nov 15 20:58:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 843516 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp1057640wrc; Fri, 15 Nov 2024 13:00:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUEHrZ/dXOs3buBG/vDb7yPuyft19cJUL7dQDFEwmOKl31GAoyu61S9N4pq34wzuY3jgm6GCw==@linaro.org X-Google-Smtp-Source: AGHT+IGqakZ5S2Sa4TkUSNW9Ta2kmwnLd1fCjXLm9ahmqhrMGI6UY6oJJUUgL2KSClz7AWFDZpoK X-Received: by 2002:a05:6122:2027:b0:50a:ca33:b033 with SMTP id 71dfb90a1353d-5147854a8f2mr4544532e0c.4.1731704456003; Fri, 15 Nov 2024 13:00:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731704455; cv=none; d=google.com; s=arc-20240605; b=hGmTd5U8JVsyhxBK9vDCNJiV9x4go5sG/S9wD1EbcKD9N668KBC+sZd7O/MpzleWR9 47xQ3TOA+H4fVZQWRO1BrJ2e+oDddbCbutRYbneGj+lrU3wpAE9h0fXh1Mfjl89Cb5JA C+T0o59AHCpNIDtFyR3KJu0sSEjS77J0EaF9vmruwFcjJdtMK74qOenuQKcmLgxDCdim iZBAi4S6VTi2ENHXYdGpuE7sfriZDu+d0hBuvompRz9J+9aHmdR5rB/3rJ85Xlg0Uh/V Iry4l8qG0hM7pIasQdipC0uj/3Kne4ObZ5VsSytCGHSdUcUKX+RDsmqcrfuHfByeU+2R xtng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=N8YgKFtlpType92XaAQCJX7PrwLQwlz6/nj0VnkynWY=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=ciPncjDj83I4js6NB3nP9VvqZHr/kHNiKh+nkl7t1wvyWFEf8DQBLrM42YV+b/23GJ Vby+6Tod8q3QIDPEY5xSEcj2eCTK/hnY/WaqIKNM6KovAWaZbGXB5wgs3FOu+K0plbU8 ISU+dd35DqCxQmzbw0c7F5UprimRhcZqQlAt6pVxbgVlL/2I4s5wszQYbq8+Hwm4SIwF HF1G83f15iCP36RghRpkIzu17gebdHZuTlPIfXSAgq9gqCwxyA8yC/y5Ha5AmGefCxdF b3qcV2cMS2bG2nqDTD6Zzks1ZbgnTVqLB4iuXRniT50T//VwhHT3VEDaspTodVGERUoT TqJw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EIyrJj0z; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-51479c53174si817739e0c.194.2024.11.15.13.00.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 13:00:55 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EIyrJj0z; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3PD-0007Y7-Uo; Fri, 15 Nov 2024 15:59:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tC3PC-0007Xh-FO for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:02 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tC3PA-0004OC-VB for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:02 -0500 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2e5a0177531so1839409a91.2 for ; Fri, 15 Nov 2024 12:59:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704339; x=1732309139; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N8YgKFtlpType92XaAQCJX7PrwLQwlz6/nj0VnkynWY=; b=EIyrJj0znoxU0nEE8Go29udHwTLMSN0hyjM6ogal7CgNNPhny7QuM0/Ulk7jLO7fu9 DMdamVnLore3WZjF0s2FfFT6DXmPj6DOp8HKGAQCq6wgAU3baXC0vCRi8RGB1j1bZBCL hDXB4TIXGKw1auoLEhQtNCX4rahPvET3jWae51QEFcFzgeZKu3j7deD+LhDT6vM6pZDG 9P24LcKZenRgepKHR4OWQGx+CvK49Jlvy3vVhuYzyW9pJOlGkwPUQwaUFy4LfecI34oG 5bEv6RCYlLAkVAfFeFlYtsu8ZdGUau9G/1cvqyJTgpH8OlP20Dn/EVux8H0Cduaq7QlL mdRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704339; x=1732309139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N8YgKFtlpType92XaAQCJX7PrwLQwlz6/nj0VnkynWY=; b=uB9Z9oopisP1J7/t56KoA4rqe4A/BN4CPdHx0aXYyl/2ayRQ50l2i5id/2r3ujxmrJ 0yR6q6OL4NbphKor3GokTapgnaQAdVI1h/TPNoNTsuLMsIvaVsAocqGp/5rqIVawRCmm VDUfZRNY9cYVaBp5+IC55n8gl2Oh1YY+ReKIOStQBojcBn8rImS5N2pPWnYq7A6oCxcN PBZC8atfLMbd4ZTYCTEG3ycxX7pOeWlB6how1eZU0iCkLLe1qM7QuyBn19Ck+NLKNKWM Y/cFzFtU7cs8Ddac5oT5ioNSLgM8olM8gEK96FZulj9dRlkTW/flG1JofzFaEM0pCELA dK4w== X-Gm-Message-State: AOJu0YwozdF9psnHZfiivc3sEO0ZDmXiwu//UiBvY1EwYI0Gu2hB+2fn RzZ1Uq429pXa4KpVFOvdYwDv6A/ED6gjNiwLvaKdzu1BbFjiOpAEHUd11SaPS3YFfct6ongoZSl y X-Received: by 2002:a17:90b:2b85:b0:2ea:2a8d:dd39 with SMTP id 98e67ed59e1d1-2ea2a8ded97mr1714013a91.26.1731704339437; Fri, 15 Nov 2024 12:58:59 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024a49a8sm3362274a91.23.2024.11.15.12.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:58:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 08/14] linux-user: Drop image_info.alignment Date: Fri, 15 Nov 2024 12:58:43 -0800 Message-ID: <20241115205849.266094-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241115205849.266094-1-richard.henderson@linaro.org> References: <20241115205849.266094-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This field is write-only. Use only the function-local variable within load_elf_image. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/qemu.h | 1 - linux-user/elfload.c | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 895bdd722a..67bc81b149 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -44,7 +44,6 @@ struct image_info { abi_ulong file_string; uint32_t elf_flags; int personality; - abi_ulong alignment; bool exec_stack; /* Generic semihosting knows about these pointers. */ diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 90e79a01b4..ef9cffbe4a 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -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. */ loaddr = -1, hiaddr = 0; - info->alignment = 0; + align = 0; info->exec_stack = EXSTACK_DEFAULT; for (i = 0; i < ehdr->e_phnum; ++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; } ++info->nsegs; - info->alignment |= eppnt->p_align; + align |= eppnt->p_align; } else if (eppnt->p_type == PT_INTERP && pinterp_name) { 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; - align = pow2ceil(info->alignment); - info->alignment = align; + align = pow2ceil(align); if (pinterp_name != NULL) { if (ehdr->e_type == ET_EXEC) {