From nobody Fri Dec 24 19:26:06 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BFDF8190A5C0; Fri, 24 Dec 2021 19:26:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JLH9B3H2Hz3MW9; Fri, 24 Dec 2021 19:26:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50D0919BB; Fri, 24 Dec 2021 19:26:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BOJQ6dZ085760; Fri, 24 Dec 2021 19:26:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BOJQ6xr085759; Fri, 24 Dec 2021 19:26:06 GMT (envelope-from git) Date: Fri, 24 Dec 2021 19:26:06 GMT Message-Id: <202112241926.1BOJQ6xr085759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 1846bbd1b34e - main - arm64: Don't rely on host readelf for u-boot booti image generation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1846bbd1b34e0269e0edd829dcff4729b37a149b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640373966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N3sW1kozt2liZ3TJCq0+wq+q+fXDdaa8TINU4AwcVTE=; b=QTarTwCVbceBWfZogEGCfGtNMXPwqzTw0/ADGQpZI2d+PU0rgbiHjQjfMVVSz64wjHDEjq uST2MP0l/z/SxDQiro31DO+1S63nnIqgmw9SV/m6J2eoPM6SlsDVz6bs7SjRk+ARTbxli9 ZrAV6cZJzVj3cLkV9p1QjpbA80DmbNOkhAgI+/KUx++V/PAFU6RAm8hUXxnFMyLy2ndzzD xbLh6+99o++wxzv7tDYXaKVkwjozLSsLv4ysJqfB4IE709JykzxjlneQeVl9ygR+e+QKoX mxo86UGEkg9DjclohlKgCVybdrvLyD7/fJjZcyecfrJ8ihsq47A9tjGkyq/5vQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640373966; a=rsa-sha256; cv=none; b=BmpHdf6D648sV3uwp2ZHNmAj8wy5Fsy54Z+CLD/dT+7J6WidepFkwEIZ3aI7U/d8CvGiu6 2m1jBqZklmUPdoY6pMFM2LjznIREIBxYelYfmO65ebkQ+gC1n63TBWl7HNI3/3Pk2lnktq x1ZDqKq6TRYXB/t5Nt1l1ldanAxPFoka7X5DSr0nMMcWfDUOhoGIyq0YQuZ03NVSniUBN7 I4Sx4itl/EUlMgoDIzf7XmnOL1V5cZyrK4FePIxjPNFU/zjK4iv8PmzrPwNBIgQPvDKjS4 4hgkLcvdEa8iZT4PFz5LkhWr2bwmvj3EMzwrH3wNdOSo7ZooelSmcH9Z/YhgSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=1846bbd1b34e0269e0edd829dcff4729b37a149b commit 1846bbd1b34e0269e0edd829dcff4729b37a149b Author: Jessica Clarke AuthorDate: 2021-12-24 19:25:20 +0000 Commit: Jessica Clarke CommitDate: 2021-12-24 19:25:20 +0000 arm64: Don't rely on host readelf for u-boot booti image generation readelf is not a bootstrap tool and so cannot be relied upon to exist. On macOS there is no system readelf, and even on Linux or FreeBSD where it does exist, BUILD_WITH_STRICT_TMPPATH builds won't be able to use it. Instead of making it a bootstrap tool, just use nm as that suffices and already is a bootstrap tool. Fixes: 28482babd08a ("arm64: Use new arm_kernel_boothdr script for generating booti images.") Reviewed by: emaste, mmel MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32734 --- sys/conf/Makefile.arm64 | 2 +- sys/tools/arm_kernel_boothdr.awk | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/conf/Makefile.arm64 b/sys/conf/Makefile.arm64 index e75062115121..e8a534dadf5c 100644 --- a/sys/conf/Makefile.arm64 +++ b/sys/conf/Makefile.arm64 @@ -94,7 +94,7 @@ CLEAN+= ${KERNEL_KO}.bin ${KERNEL_KO}.bin: ${FULLKERNEL} @${OBJCOPY} --wildcard --strip-symbol='$$[adtx]*' \ --output-target=binary ${.ALLSRC} ${.TARGET}.temp - @{ readelf -s ${.ALLSRC} | \ + @{ ${NM} ${.ALLSRC} | \ ${AWK} -f $S/tools/arm_kernel_boothdr.awk -v hdrtype=v8booti && \ cat ${.TARGET}.temp; \ } > ${.TARGET} diff --git a/sys/tools/arm_kernel_boothdr.awk b/sys/tools/arm_kernel_boothdr.awk index f22c6167c7b0..cda56e2225cd 100644 --- a/sys/tools/arm_kernel_boothdr.awk +++ b/sys/tools/arm_kernel_boothdr.awk @@ -144,22 +144,22 @@ function write_v8booti() { /kernbase/ { # If the symbol name is exactly "kernbase" save its address. - if ($8 == "kernbase") { - gKernbase = hexstr_to_num($2) + if ($3 == "kernbase") { + gKernbase = hexstr_to_num($1) } } /_start/ { # If the symbol name is exactly "_start" save its address. - if ($8 == "_start") { - gStart = hexstr_to_num($2) + if ($3 == "_start") { + gStart = hexstr_to_num($1) } } /_end/ { # If the symbol name is exactly "_end" remember its value. - if ($8 == "_end") { - gEnd = hexstr_to_num($2) + if ($3 == "_end") { + gEnd = hexstr_to_num($1) } }