Page MenuHomeFreeBSD

arm: Improve the creation of kernel.bin
ClosedPublic

Authored by mmel on Fri, Nov 8, 4:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 6:06 AM
Unknown Object (File)
Mon, Nov 11, 1:31 AM
Unknown Object (File)
Mon, Nov 11, 12:58 AM
Unknown Object (File)
Sun, Nov 10, 1:39 AM
Unknown Object (File)
Sat, Nov 9, 11:13 PM
Unknown Object (File)
Sat, Nov 9, 10:55 PM
Unknown Object (File)
Sat, Nov 9, 12:51 PM
Unknown Object (File)
Sat, Nov 9, 10:54 AM
Subscribers

Details

Summary

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.
While I'm on, 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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mmel requested review of this revision.Fri, Nov 8, 4:48 PM

Please generate diffs with full context e.g. git diff -U99999 or git show -U99999 or use git arc. Change looks reasonable to me other than missing newline (noted by Phabricator). Probably should mention in the commit message that this is applying the approach from arm64.

I think this looks good.

sys/conf/Makefile.arm
104

likely need a newline here.

This revision is now accepted and ready to land.Fri, Nov 8, 8:22 PM
This revision was automatically updated to reflect the committed changes.