HomeFreeBSD

arm: Improve the creation of kernel.bin

Description

arm: Improve the creation of kernel.bin

Instead of relinking the kernel without elf headers, replace them with
a binary blob of the same length starting with a jump to the kernel's start
address. This ensures that all symbols stay at the same offsets as in
the original kernel, so kernel.debug remains valid also for kernel.bin.

Also ensure that the awk script used runs with the neutral locale defined.
Awk 'write' is a locale compilant, and script is used to write binary data
to a file, so it needs to ensure that bytes > 127 are written unchanged.

While I'm on, set the neutral locale also for arm64, where the same script is
used to generate the kernel booti image.

Reviewed by: emaste, imp
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D47488

(cherry picked from commit ba045ba49dedb068ba2f0e13fbb1c1a91fde8333)
(cherry picked from commit bec5167645b5d157a1c980099162362f115ccbfe)

Details

Provenance
mmelAuthored on Nov 3 2024, 12:15 PM
cpercivaCommitted on May 5 2025, 7:01 AM
Reviewer
emaste
Differential Revision
D47488: arm: Improve the creation of kernel.bin
Parents
rG2773c07181a7: mountd: Fix updating the network/host(s) for an exports line
Branches
Unknown
Tags
Unknown