From nobody Tue Nov 26 05:48:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1710184881; cv=none; d=zohomail.com; s=zohoarc; b=S0JR5rM5DfvXOrRqRqgfyypdXe9mhdGXdvcQUdvQlBkv8BzbYjYzSWPaaGo2hQSLwWZtKH48qYOfU/VMpD8xR+MuWaM/oh2D9cEHTaKuIH3aLFD5woqxp7sGSdoJXcUiCOLd4EXFmsyW0FaddthNX/YXmimMASDB3m8Ha7GKySs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710184881; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=1PPP7DyUJzXO4PyrnSnzaFZyN1tK2CNOu4AL56ymsAo=; b=Ju/GX13n2N6rCkKZw5V8/c3MZziRLYkk0UL97NO6zL3S+Rb4Zl3rZUCwi50caV8pg4pYzoeCQh0ZsdjpMpJWjXQEa9+uvhJ5wDTwI8ptHOHuErLUVgwjvdpAM7D2XrRqhbxsXPwprJwmqFw5nJcKdI0hgkq2ofaiXad9vX7wYTI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1710184881616215.1292646115386; Mon, 11 Mar 2024 12:21:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjl9o-0006rf-9x; Mon, 11 Mar 2024 15:17:56 -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 1rjl50-0003OV-6x for qemu-devel@nongnu.org; Mon, 11 Mar 2024 15:13:02 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rjl4u-0000ND-QH for qemu-devel@nongnu.org; Mon, 11 Mar 2024 15:12:54 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-41312232c7aso24406005e9.0 for ; Mon, 11 Mar 2024 12:12:50 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id t10-20020a05600c450a00b004131388d948sm14425266wmo.0.2024.03.11.12.12.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 12:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710184369; x=1710789169; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=1PPP7DyUJzXO4PyrnSnzaFZyN1tK2CNOu4AL56ymsAo=; b=HDTqPu9ovDVjIGpoeSYbnvY6g98dg07KWVRKs/iaLxEB7yCOYHfzjyCmAhDFW33J/b FXC7ZnofxnsBtQ+PbbQHDvfZS+OY1abhZwIzPlgamYI6P6o+cqJsg38FHZbuOXFWqnGM 3tZZFORt/0f50zyssS2VxT5dzJQUixSk1STuKGIYdTLBrXOvniQ1VX/hqLUQaYbBZzGj 1OqSVsugZEeGPjvmNaEdVArVmMQNU/0AKZFjWFdWZ0AkXdELOakxy25UCSAjXpi0/491 zg8oTgASWTSXFU8pKlLfSqkuE1FSNQeN9DbidRmiAY+1OPlgesD1+jG/T/vWvJzobeyc zIaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710184369; x=1710789169; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1PPP7DyUJzXO4PyrnSnzaFZyN1tK2CNOu4AL56ymsAo=; b=bNIM+VkJ52+Base+AvKuZjWV9RMO56r418xanu3/Q11AtUjDozeoWFipGa+Cd/maIk cEEap2sHOcKSAwWKPSHgHyectTstQcHQNOPk84nMGRHP12whbiZkf+IIw+RH0nXh45RY Tl+kKwgL5U47maxcVCI9X67rkMAbCdoU103JWd2KMhcouonJBjz2wDBfjxoy9iY8F3Xn ZSV0Nxg2hnRYQCtNLNZfxnEm0hSQ7ut2O3fsVaVzIBClEgJ1jJWVSzmjJIGlJ4KXjv6e ZPdEWO4SyHjFNdEpTG+h/ExGuui1b8htdH6jhA6rsu3f/Kw4wnqICf9bnmNtjqZIeQpK /m1g== X-Gm-Message-State: AOJu0YzYBr5yEEfYy0SkYFwrIpbwK48SJc0U5KkGoGmn0XrzDaxwzqRZ XSITPna5dWN+6pgzriUgSQ9QMiifU03F2IznFVD46zN0Lclgn+Y14ba8S+YFeQfNlQEmMOn1P9t 4 X-Google-Smtp-Source: AGHT+IEqZKuaN+EBpFn6p2fgLKgxTkSY69YLZoueHFq0L85GqqNQmluik66f3Gc8FplzR+whl4mBwg== X-Received: by 2002:a05:600c:4f50:b0:412:ee33:db93 with SMTP id m16-20020a05600c4f5000b00412ee33db93mr7013109wmq.3.1710184369331; Mon, 11 Mar 2024 12:12:49 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/20] contrib/elf2dmp: Use lduw_le_p() to read PDB Date: Mon, 11 Mar 2024 19:12:35 +0000 Message-Id: <20240311191241.4177990-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240311191241.4177990-1-peter.maydell@linaro.org> References: <20240311191241.4177990-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1710184882219100001 From: Akihiko Odaki The relevant value may be unaligned and is little-endian. Signed-off-by: Akihiko Odaki Tested-by: Viktor Prutyanov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20240307-elf2dmp-v4-13-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell --- contrib/elf2dmp/pdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/elf2dmp/pdb.c b/contrib/elf2dmp/pdb.c index 1c505142518..492aca4434c 100644 --- a/contrib/elf2dmp/pdb.c +++ b/contrib/elf2dmp/pdb.c @@ -19,6 +19,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/bswap.h" =20 #include "pdb.h" #include "err.h" @@ -186,7 +187,7 @@ static bool pdb_init_symbols(struct pdb_reader *r) =20 r->symbols =3D symbols; =20 - r->segments =3D *(uint16_t *)((const char *)symbols + sizeof(PDB_SYMBO= LS) + + r->segments =3D lduw_le_p((const char *)symbols + sizeof(PDB_SYMBOLS) + symbols->module_size + symbols->offset_size + symbols->hash_size + symbols->srcmodule_size + symbols->pdbimport_size + symbols->unknown2_size + --=20 2.34.1