From patchwork Fri Aug 4 01:45:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 710213 Delivered-To: patch@linaro.org Received: by 2002:a05:6359:606:b0:129:c516:61db with SMTP id eh6csp233082rwb; Thu, 3 Aug 2023 18:47:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPizE63YzEpaPjXyIUY1sCSsvMEL6xsbfFqhtwICCQcUnDFa6kgjyDcdMoFggRqYuAmCQn X-Received: by 2002:a0c:edca:0:b0:63d:31a7:6809 with SMTP id i10-20020a0cedca000000b0063d31a76809mr278104qvr.13.1691113645781; Thu, 03 Aug 2023 18:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691113645; cv=none; d=google.com; s=arc-20160816; b=WFfzHHPc7GzuBLsyeT2jWPQIJ4QapuftucPl31ES09b4UFkM2L+gnRba4lSr6oTNEG U3ADgQ9aTKPLiP2ijCpodeGle1ogFVyqGw5A03t4bnxAj0y9YF3+kI+SlE5uM7xD+c57 qWyqxvghF59QX9KGgq3VfxsskQd+XAde7c3xZEdsqGDIDy6nBp0KJC8vszhOksQtV5nz AxJ5ITJO2/hLjSRnAOiv2MUCQLi40QeWWmAB9V9k0hMAxLUnQwPbUNOAoLr4fmDCRWEg TfUqXLUtt2bxgpRDimmoyvXes12xECnRw+TD8g1FOtkUcdgLEz3OQoJXLsW79UdkQ3RH FgSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=yKCV0XRiqzz/Bbo5CE3ioXvHDRvgwqgKDuyImywiLU0=; fh=oY0Hqs0mb1Sbw8XbQT7Frqsb6/GXc1LASz4nvWEMVJQ=; b=eYfRltqfTNS1Y6u6ZnmHwgKkfYp7qJtAngnSE8ypDVGY57spIqicIteidNxYpL2j59 dXPVKHO0LrG3h0/gaUS9ktHZZKxNKHy+qAGW3BB3DbVJhaInjS5x99Me5+iFqqxRfF4w zEskLhkXHTlZem1UlhptoxL4sATBMoBTgZvPIpwzMpx4Pgjz64wP0BbDmqxGjSbz9JlY E7FTBDkFxc8GkSl68GkZVeMB6cpPHPZQ8b/WsDY2NgOhitjGXx+Uo3NVzr+4M4gJ13E1 sNwZqZahhRcMureaWOD74/O5rSG+BTLR1V2HbGlkX7KdWb5aDRY0BS6Jv7Fe+3wUJzkC nCZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RXCM1bWv; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v8-20020a0ce1c8000000b0063d32e11802si572124qvl.9.2023.08.03.18.47.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Aug 2023 18:47:25 -0700 (PDT) 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=RXCM1bWv; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRjsv-0002hM-Q3; Thu, 03 Aug 2023 21:45:45 -0400 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 1qRjsk-0002d5-NX for qemu-devel@nongnu.org; Thu, 03 Aug 2023 21:45:38 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qRjsh-0005BH-2S for qemu-devel@nongnu.org; Thu, 03 Aug 2023 21:45:33 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-686ed1d2594so1418087b3a.2 for ; Thu, 03 Aug 2023 18:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691113530; x=1691718330; 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=yKCV0XRiqzz/Bbo5CE3ioXvHDRvgwqgKDuyImywiLU0=; b=RXCM1bWvgGAyowHopprbFDQXe/0eKIuxZEvZezXoijdcr3VVhoe7HpLXHcUHFVXkhG rsLp+pnyT1udQdFsd+qSIUblau2v/rIUvtm8Zr6eHlLY1Lrj2A72fseqSpoSEJ2PLZgS AQaUjcJmSIbFw3UCZStutXCFmpVCh7z7kFPhV8TBqWgOTMoURROvQghFsvNAzl7OdOcx UOx9UDmNTI/JSTFXpFXAu33aZnxDYstXkhEitAFTkx5rP5Q8xpMFwvGTO4ajN/9xd2Oh Yz1YGkgDlEhq7rVANe60nkZ8avq0SZmMdq/rGasbVx/TW0cNjSRzIYUBv5qTvi01YCQH TFqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691113530; x=1691718330; 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=yKCV0XRiqzz/Bbo5CE3ioXvHDRvgwqgKDuyImywiLU0=; b=k0CVNb4MsHCaPnooKfyem404hc6vVjX4P5b4JXp/K1YC1YW4HmBzjqcZ7fi9np4zQm c4cnhDDcotSzvtbIu2uGIXogbAvKfb1FJKkaNZYt6HB4tcPK+nDepUClKvqSzn2LGifS 6nwgXFjgVZXd9TPHeYKEXBtMHP7Qc3rGq6JUjICZ/o34MZ+NMD8SVi1EnCc6dW37RSJE 5To1PlgZ8oVXw8aU/a0BIli8W1vVMxavCT4Vd8UntN6pituPGZd0MAfMB65yZIBnj/zK I7h5Oep31YcOoOccBkGgkIY2oMF4H7mHPsWJ9WpFkOOWGYuVPG2qhdx/3DHXgILoVG+G TC7w== X-Gm-Message-State: AOJu0YxKZdNkoQg6AwXRHnBBtuwtauulZf6reF6PbOsHTMHGubfqNB1A GdQlmR529Dlw1eBEZqOK8jhT067CYFD2DSpgxQY= X-Received: by 2002:a05:6a00:b90:b0:681:50fd:2b98 with SMTP id g16-20020a056a000b9000b0068150fd2b98mr516508pfj.31.1691113529917; Thu, 03 Aug 2023 18:45:29 -0700 (PDT) Received: from stoup.. ([2602:47:d490:6901:9d52:4fe8:10ce:5c3]) by smtp.gmail.com with ESMTPSA id c5-20020aa78c05000000b0066f37665a63sm456138pfd.73.2023.08.03.18.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 18:45:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: joel@jms.id.au, akihiko.odaki@daynix.com, laurent@vivier.eu, deller@gmx.de Subject: [PATCH v8 14/17] linux-user: Properly set image_info.brk in flatload Date: Thu, 3 Aug 2023 18:45:14 -0700 Message-Id: <20230804014517.6361-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230804014517.6361-1-richard.henderson@linaro.org> References: <20230804014517.6361-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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, T_SCC_BODY_TEXT_LINE=-0.01 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 The heap starts at "brk" not "start_brk". With this fixed, image_info.start_brk is unused and may be removed. Signed-off-by: Richard Henderson Reviewed-by: Akihiko Odaki Reviewed-by: Helge Deller --- linux-user/qemu.h | 1 - linux-user/flatload.c | 2 +- linux-user/main.c | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 4b0c9da0dc..4f8b55e2fb 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -29,7 +29,6 @@ struct image_info { abi_ulong end_code; abi_ulong start_data; abi_ulong end_data; - abi_ulong start_brk; abi_ulong brk; abi_ulong start_mmap; abi_ulong start_stack; diff --git a/linux-user/flatload.c b/linux-user/flatload.c index 5efec2630e..8f5e9f489b 100644 --- a/linux-user/flatload.c +++ b/linux-user/flatload.c @@ -811,7 +811,7 @@ int load_flt_binary(struct linux_binprm *bprm, struct image_info *info) info->end_code = libinfo[0].start_code + libinfo[0].text_len; info->start_data = libinfo[0].start_data; info->end_data = libinfo[0].end_data; - info->start_brk = libinfo[0].start_brk; + info->brk = libinfo[0].start_brk; info->start_stack = sp; info->stack_limit = libinfo[0].start_brk; info->entry = start_addr; diff --git a/linux-user/main.c b/linux-user/main.c index e089123cfa..51ee8649e2 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -953,8 +953,6 @@ int main(int argc, char **argv, char **envp) fprintf(f, "page layout changed following binary load\n"); page_dump(f); - fprintf(f, "start_brk 0x" TARGET_ABI_FMT_lx "\n", - info->start_brk); fprintf(f, "end_code 0x" TARGET_ABI_FMT_lx "\n", info->end_code); fprintf(f, "start_code 0x" TARGET_ABI_FMT_lx "\n",