Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 229F3C4743C for ; Mon, 21 Jun 2021 20:14:32 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 497496100A for ; Mon, 21 Jun 2021 20:14:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 497496100A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7764E829CD; Mon, 21 Jun 2021 22:14:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 3C159829CF; Mon, 21 Jun 2021 22:14:27 +0200 (CEST) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (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 45E0B829CD for ; Mon, 21 Jun 2021 22:14:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tom.rini@gmail.com Received: by mail-qt1-f175.google.com with SMTP id r7so14400499qta.12 for ; Mon, 21 Jun 2021 13:14:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Xt99zppmU21gSKp0ieti4JEb4s0nBP6Om3wGQrQO410=; b=Dnf8T4YvjTpr7nlYlwGAkjkuHg0L7rYKCc/cofRnzWIgVrln6wPtZMrcLRZB0MQrFL oPMfo1O/m/93vBJF3HFoNwd6lrZ2KNmtAotc0/SMfekr/bXs5ZIAlkBVm/nFbVBDZXQh LX8zfWzjp1W2x/KzHd3ItDXQpdnFKQ24zf4CwuUtSH168DLxYIIiRXoUoAyG00Vt/bxd IwZhRfX6B4O+0Kn/0bwpQpZUIcmU3qo9J0hITEjwgoxsTuXVQnzGaptnzOOA6wf3VFeJ UG32WBPQgqfreYhsgbQRsI6jXEzm+yu4gqIbb5MzHfm2v9sVHLeYasHyJ1PCVj4Z21IB 4cTg== X-Gm-Message-State: AOAM530a2/YgnLfJDnyS/sVy7nmxl8wiYt79+Nr7RMX53rQPms94VElO i4OcnM2FFf28EnrKLS7E/mOV8u61Nhvp X-Google-Smtp-Source: ABdhPJyqQAl1JsfXs/GbBTGPGu/vUYo/1YxjiE7cToWzcMrkUi4Jm1x1LPaL94QgRnWdv7e65QLIIw== X-Received: by 2002:ac8:76ca:: with SMTP id q10mr329204qtr.150.1624306462648; Mon, 21 Jun 2021 13:14:22 -0700 (PDT) Received: from oliver.lan (2603-6081-7b01-cbda-104b-7105-31ee-dbd2.res6.spectrum.com. [2603:6081:7b01:cbda:104b:7105:31ee:dbd2]) by smtp.gmail.com with ESMTPSA id l25sm93566qtv.75.2021.06.21.13.14.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 13:14:21 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Cc: Jan Kiszka Subject: [PATCH] scripts/get_default_envs.sh: Update for thin archive support Date: Mon, 21 Jun 2021 16:14:18 -0400 Message-Id: <20210621201418.132570-1-trini@konsulko.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.34 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.2 at phobos.denx.de X-Virus-Status: Clean This script was broken by the change to default archives for linking. This is due to objcopy specifically disallowing copying of thin archives. To fix this and re-support external users of this script, switch to using the same logic the u-boot-initial-env make target uses to dump the section from the object file. Reported-by: Jan Kiszka Fixes: 958f2e57eff7 ("build: use thin archives instead of incremental linking") Signed-off-by: Tom Rini --- scripts/get_default_envs.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/get_default_envs.sh b/scripts/get_default_envs.sh index d1f2ce4d5c51..3c6fdc45e11f 100755 --- a/scripts/get_default_envs.sh +++ b/scripts/get_default_envs.sh @@ -10,7 +10,7 @@ set -ue : "${OBJCOPY:=${CROSS_COMPILE:-}objcopy}" -ENV_OBJ_FILE="built-in.o" +ENV_OBJ_FILE="common.o" ENV_OBJ_FILE_COPY="copy_${ENV_OBJ_FILE}" echoerr() { echo "$@" 1>&2; } @@ -32,7 +32,8 @@ cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY} # NOTE: objcopy saves its output to file passed in # (copy_${ENV_OBJ_FILE} in this case) -${OBJCOPY} -O binary -j ".rodata.default_environment" ${ENV_OBJ_FILE_COPY} +${OBJCOPY} --dump-section .rodata.default_environment=${ENV_OBJ_FILE_COPY} \ + ${env_obj_file_path} # Replace default '\0' with '\n' and sort entries tr '\0' '\n' < ${ENV_OBJ_FILE_COPY} | sort --field-separator== -k1,1 --stable -- 2.25.1