Attention is currently required from: Angel Pons, Arthur Heymans, Julius Werner, Maximilian Brune, Philipp Hug, Ron Minnich.
Nico Huber has posted comments on this change by Maximilian Brune. ( https://review.coreboot.org/c/coreboot/+/81910?usp=email )
Change subject: commonlib/bsd/lz4_wrapper.c: Fix misaligned access ......................................................................
Patch Set 5:
(1 comment)
Commit Message:
https://review.coreboot.org/c/coreboot/+/81910/comment/d4ea5dcd_70529912?usp... : PS1, Line 18: The coreboot LZ4 decompression code does some misaligned access during : decompression
NB. I'd expect that inlining LZ4_readLE16() has a bigger effect.
No the actual lz4c.c.inc is included below and the compiler is sufficiently smart to do that already.
Oh, right. à propos: ``` $ for cc in i386-elf x86_64-elf arm-eabi aarch64-elf riscv64-elf; do
echo $cc echo 'unsigned short test(void *a) { return *(unsigned short *)a; }' | $cc-gcc -o test1.o -c -xc -Os - echo 'unsigned short test(void *a) { return *(unsigned char *)a | *(unsigned char *)(a + 1) << 8; }' | $cc-gcc -o test2.o -c -xc -Os - cmp test[12].o done
i386-elf x86_64-elf arm-eabi test1.o test2.o sind verschieden: Byte 33, Zeile 1 aarch64-elf riscv64-elf test1.o test2.o sind verschieden: Byte 41, Zeile 1 ``` `arm-eabi` passes too for any of `-march=armv7-[arm]`.
Outing: I'm one of those weirdos who'd like to keep it as close as possible to defined C and let the compiler do its job. IOW, use read_le16() and friends.