From patchwork Sun Aug 6 03:37:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 710877 Delivered-To: patch@linaro.org Received: by 2002:a05:6359:d30:b0:129:c516:61db with SMTP id gp48csp826278rwb; Sat, 5 Aug 2023 20:39:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXXmUR+8Xo1Dm6ATHYCadOt5PFzb2WoplbMuIc26qf+4cG/7WmEP51m4TN0nhmfz7DvWyH X-Received: by 2002:a05:622a:181d:b0:405:56bb:343b with SMTP id t29-20020a05622a181d00b0040556bb343bmr7624824qtc.41.1691293181336; Sat, 05 Aug 2023 20:39:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691293181; cv=none; d=google.com; s=arc-20160816; b=swAcU35J0FVzFai8J6hw8ZLoX+a5KrNkEgtv+sO/pEFKCGHrxWo3Mq3VGNj5JzeYte qtNEadUOQkrKpHxBnjlVTO8/Nk5G57hIY1E5NpJ9pxpGCsHrRSwvYKmqSJ1r4ISu8nSz rlatOhE3nIIUAIHbjj65fo3GGoY52jV+1vqmP6Kjmvya3zmxncwaQM70wfDixBy23S32 eQB6v2CbxCxFKoQK6nSnYDdMiXYOfpNwX4x9w5zVEpJ5QbuT3yF5lV2XFLCGlP4kGPOi Cs427rQuvrPdp1IuGdF6xC/7iQsv50Kii7E88zZltuylUDHxPFkfF9xXqvxdFfKlAPfp fn5A== 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=4+a1ntD1nPZIq5/3BuYdNWBqjL6H8GnZs4Nnik5eIQQ=; fh=e1NRMjxVMtV0F5wYJj2s+gr60lsrqkDmE/ulJ4pjdtQ=; b=y1ODa/3mUVvOdIps3UeUqbfU3aS4ncUs5u83W7PriCyVoG2y0o5DfE34RCf8LqClQB KbMgjyjJ3rlycS1uMYA6jHBTlDFALgcimaToMr3/ZTEzdwZxvmp7m3vNHUIpcXx9uSbh bgQIHSr8wErJpL5aJgVUBEHHYWClXP+I/HJ3eFqlLKBjvyGU8ewh/Y48iOyA7Jj6wiaF x0jJ1q5kVkVuDJ2IjxtB12KpNzFtVMd3H8P0fwd6p0oFqy6yYYDMCOYefcPVHso4DEFd ZPsUDyyqTXK8Q9+T9tj6eRYlS7GLUN3F0MHmlE24UEpGC/WwiUrwHgoA4HBLhv96pICF dMLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VtfJ3gn6; 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 l8-20020a05622a174800b0040da281e4d8si3397033qtk.517.2023.08.05.20.39.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 05 Aug 2023 20:39:41 -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=VtfJ3gn6; 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 1qSUaG-0003j5-Er; Sat, 05 Aug 2023 23:37:36 -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 1qSUaE-0003hu-SH for qemu-devel@nongnu.org; Sat, 05 Aug 2023 23:37:34 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qSUaD-0007aR-Aj for qemu-devel@nongnu.org; Sat, 05 Aug 2023 23:37:34 -0400 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so2445778a12.1 for ; Sat, 05 Aug 2023 20:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691293052; x=1691897852; 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=4+a1ntD1nPZIq5/3BuYdNWBqjL6H8GnZs4Nnik5eIQQ=; b=VtfJ3gn6ABglBbG23wqawv3eaDnP34LqhXTaK431QvWp4niDYCuo/Ee8fQSRhChIUy p8+PhimpmvkbpQOUsvGCbDOAR+yMpEOShzJArBm5THNoto1AKpKOkGDpse187DfTZ7e4 epSI1plzAFXXp1TIDAPUvCjK84hDD8Zd0Jh9gx7tRH9vzY23SeM2DdJ3Dybiwmb/YhHW aBvR+FSOXtGxg9h5JkjxnVoa//PhYClcZsTm2Hh632OsObwwoYRv3AnwKXYFmc0u9ArT hA7rkhAS0eZZU/F460t9oCSmJ/xaZ49fyk2v6jSse/ko1kRYJeV51lpmq7PVP0jPq/Vo A/Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691293052; x=1691897852; 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=4+a1ntD1nPZIq5/3BuYdNWBqjL6H8GnZs4Nnik5eIQQ=; b=Jqh/VNsMq8HmVHlkvGOD2CgYdMjy6pEKFSDkVNi6Ab4fG2aw6UKGAgQdYVFwFJrgOc 87BnCVL9/sf5TKRziGXs1Ck2mh1oGVxBlX61CMxISAvv763iRNlEx0pxdp928gLVq/oO pdOOUMO1Lo/14t6+MUhJ6v1mk4w0sXTb4JlEa9xYKHBSTJhJS3T6Bo7juBTJKOp8Efn1 hY0MEtNNcYnlKB4XqASo6U689di/y6XumWkTm+CGhF8fsIS9NCL6toMZBVQQjjPet48l J/RQ5Isaz/LxmqCsowLgHxSxnq20JyOpE0Sm9PNaXWhprfFqjhx0ImXJ7exTb9ri5+9T ZEfw== X-Gm-Message-State: AOJu0YzE9M/W4M7pRhiyM8NL0aVHS9Pxc9fukohxRXRSRhFra50GJ8cm 92nV2PjL7QCrQKAT/SiiQkP0IwuKcGCuBGzCKM4= X-Received: by 2002:a17:90a:8043:b0:269:46d7:f1db with SMTP id e3-20020a17090a804300b0026946d7f1dbmr1912631pjw.32.1691293052017; Sat, 05 Aug 2023 20:37:32 -0700 (PDT) Received: from stoup.. ([2602:47:d490:6901:9454:a46f:1c22:a7c6]) by smtp.gmail.com with ESMTPSA id a5-20020a17090a740500b00262e604724dsm6306451pjg.50.2023.08.05.20.37.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Aug 2023 20:37:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Helge Deller , Akihiko Odaki Subject: [PULL 19/24] linux-user: Properly set image_info.brk in flatload Date: Sat, 5 Aug 2023 20:37:10 -0700 Message-Id: <20230806033715.244648-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230806033715.244648-1-richard.henderson@linaro.org> References: <20230806033715.244648-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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 The heap starts at "brk" not "start_brk". With this fixed, image_info.start_brk is unused and may be removed. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by: Richard Henderson --- 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 cb5e80612b..96be354897 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -963,8 +963,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",