Similar to r366897, this uses the .incbin directive to pull in a
firmware file's contents into a .fwo file. The same scheme for
computing symbol names from the filename is used as before to maximize
compatiblity and not require rebuilding existing .fwo files for
NO_CLEAN builds. Using ld -o binary requires extra hacks in linkers
to either specify ABI options (e.g. soft- vs hard-float) or to ignore
ABI incompatiblities when linking certain objects (e.g. object files
with only data). Using the compiler driver avoids the need for these
hacks as the compiler driver is able to set all the appropriate ABI
options.
Details
- Reviewers
imp markj - Commits
- rS368739: Use a template assembly file for firmware object files.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
I had looked to see if I could use a common assembly file between this and embedfs.S I recently added, but there were enough subtle differences I kept them separate.
sys/kern/firmw.S | ||
---|---|---|
44 ↗ | (On Diff #80608) | Oh, hmm. They are equivalent, but I should instead use '%' so that this builds ok on ARM. Let me verify that it is broken on ARM and that using '%' fixes it. |
sys/conf/kmod.mk | ||
---|---|---|
190 ↗ | (On Diff #80846) | I added firmw.S as a dependency here. There's not a simple way to do it for sys/conf/files. I think I'd have to manually update all the entires in sys/conf/files to get it to work. :( I should perhaps do that, but it's a bit tedious. |
sys/kern/firmw.S | ||
39 ↗ | (On Diff #80846) | I had missed this .globl originally. |
(earlier I thought the breaking change was https://reviews.freebsd.org/D27579 )
Apparently this change will crash a machine after inserting wireless USB (if_rsu, RTL8191S, vendor/device ID 0x0bda:0x8172) hardware.
r368738 / de66c99a works fine, so does if_rtwn_usb (RTL8188EU, vendor/device ID 0x0bda:0x8179) based hardware booting a kernel built from r368739.
I can provide a backtrace; do you want me to open a PR? https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252163