Attention is currently required from: Arthur Heymans, Julius Werner.
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/81964?usp=email )
Change subject: util/cbfstool: Add --64 option for 64-bit payload stitching ......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
Why not parse the ELF for architecture?
Also it's confusing/meaningless for !x86 payloads.
can you please elaborate a bit your review comments ?
for sure, I should have guarded those against x86 arch alone. But are you suggesting not to use any cmdline (like --64) and use ELF arch to know if the payload is 64-bit binary and then insert specific magic data into the header ?
I think you only need a cmdline if you cannot figure it out differently. OTOH the ELF does not conclusively say something about the entry point. For other type of payloads like flat binaries it's not possible to know this either I suppose.
32-bit depthcharge
``` readelf -h /build/rex/firmware/rex/depthcharge/depthcharge.elf ELF Header: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 Class: ELF32 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: Intel 80386
```
64-bit depthcharge
``` readelf -h /build/rex/firmware/rex/depthcharge/depthcharge.elf ELF Header: Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: Advanced Micro Devices X86-64 Version: 0x1 ```
I believe in that case, I don't need any cmdline.