The branch main has been updated by jrtc27:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=1846bbd1b34e0269e0edd829dcff4729b37a149b

commit 1846bbd1b34e0269e0edd829dcff4729b37a149b
Author:     Jessica Clarke <[email protected]>
AuthorDate: 2021-12-24 19:25:20 +0000
Commit:     Jessica Clarke <[email protected]>
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)
        }
 }
 

Reply via email to