Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A5E6AC6FA8E for ; Sun, 5 Mar 2023 17:49:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4E21785D79; Sun, 5 Mar 2023 18:49:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qDWIsA1Y"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3F41485B9A; Sun, 5 Mar 2023 18:49:36 +0100 (CET) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C69D48567B for ; Sun, 5 Mar 2023 18:49:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ovpanait@gmail.com Received: by mail-ed1-x52a.google.com with SMTP id x3so29569334edb.10 for ; Sun, 05 Mar 2023 09:49:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678038573; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=plmjt3uko1BrJId5a0p0JfUgJOT6PL3FpKude8CpI68=; b=qDWIsA1YhqapbgoE/Y//jUAnJZu9Ho508+SF97jaOWpOp5+PlOBFooIvEB55gtsBSx s7n4QQDyC/6+Kd4c8Z4lSrFEURW7oRxCnRBuNFsAY4P67LLScSopA1Lqu2x9E9XntoP/ f3zJPLjs8iOlSitQsZKlAXTJZmMs1q7ffK8dFG26l8SUZYXAfN9BcmiGIY0jdEHAWpns gXBJSyn4Oah2ZC9FhBBwrpLYs7Q68TqXrnd7NDGrs0LIv1hoISQ+pkhXctoHNDKiGGNC 3SCLiB7Out07zj4elrJhpST+8TF7k+jBNIHwdVE+J3TRohtAMwXmgbyQrTdYPr5uvNX0 jadg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678038573; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=plmjt3uko1BrJId5a0p0JfUgJOT6PL3FpKude8CpI68=; b=dJ3KsXcWFK6CVuu0rp+bkEJn4MypVmTlsXs6vajL618121fS4PYIwf10ft5wH7CGf7 rP/06hP7x7dfvSzERPQd4L9tnzkYOdbqp60zIFmtaj/0E6miWXD95v9jr+bKaSfGU5JJ +co0gfhYd06F+SJakkOR/lAkwLoawK1O4tcGIhSP2eDfJLNtSfS/o+OkNqun+lBXFdo3 DXArDDgT+1wvrE4cvrKUDgJhY+DixfDOp/ecdAWakb6HsrPgVwR4vW7Q4eUv9pWhFqce MUCtb5aprn43hkAYGdsBHHjlSLNSFsRJkc2SXs4b4KzgokfgesPTzs9B7WGyNFS6d+NA ZbXQ== X-Gm-Message-State: AO0yUKVcacR3Od/hWYarurisUhzDYFzV5i44tJHww/gTrT4pqXDY6rLo gga711x3LxRuYlzy9Slkks1NHI6IQac= X-Google-Smtp-Source: AK7set+FqHH8VrrOVQfqTMK8OMSQiXexXzbLw1haQSCY0MYZ4ldtwbJ/m+/tEC0qV/PoGvObbQaMRw== X-Received: by 2002:a17:907:6d20:b0:878:5bce:291a with SMTP id sa32-20020a1709076d2000b008785bce291amr11522779ejc.36.1678038573265; Sun, 05 Mar 2023 09:49:33 -0800 (PST) Received: from localhost.localdomain ([2a02:2f0e:c915:3800:3ec7:a5bc:2321:4538]) by smtp.gmail.com with ESMTPSA id l26-20020a170906231a00b008b69aa62efcsm3464985eja.62.2023.03.05.09.49.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Mar 2023 09:49:33 -0800 (PST) From: Ovidiu Panait To: u-boot@lists.denx.de Cc: Ovidiu Panait , Michal Simek , Samuel Holland Subject: [PATCH 1/5] tools: relocate-rela: adjust le64_to_cpu -> le32_to_cpu in decode_elf32() Date: Sun, 5 Mar 2023 19:49:15 +0200 Message-Id: <20230305174919.293393-1-ovpanait@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean The sh_addr/sh_offset/sh_size fields in Elf32_Shdr are 32-bits wide, so use le32_to_cpu() instead of the 64-bit variant. Fixes: 5e0e1a86d327 ("tools: relocate-rela: Fix ELF decoding on big-endian hosts") Signed-off-by: Ovidiu Panait --- tools/relocate-rela.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/relocate-rela.c b/tools/relocate-rela.c index 2d2a2ed277..689e2d4655 100644 --- a/tools/relocate-rela.c +++ b/tools/relocate-rela.c @@ -316,9 +316,9 @@ static int decode_elf32(FILE *felf, char **argv) debug("%s\n", sh_name); - sh_addr = le64_to_cpu(sh_table[i].sh_addr); - sh_offset = le64_to_cpu(sh_table[i].sh_offset); - sh_size = le64_to_cpu(sh_table[i].sh_size); + sh_addr = le32_to_cpu(sh_table[i].sh_addr); + sh_offset = le32_to_cpu(sh_table[i].sh_offset); + sh_size = le32_to_cpu(sh_table[i].sh_size); if (!strcmp(".rela.dyn", sh_name)) { debug("Found section\t\".rela_dyn\"\n"); -- 2.25.1