[coreboot] Patch merged into coreboot/master: 97f7138 cbfstool: make endian detection code more robust

gerrit at coreboot.org gerrit at coreboot.org
Wed Jul 18 00:15:17 CEST 2012


the following patch was just integrated into master:
commit 97f71387c02b23fd66b90fe43a4096d36d6dad47
Author: Mathias Krause <minipli at googlemail.com>
Date:   Tue Jul 17 20:52:17 2012 +0200

    cbfstool: make endian detection code more robust
    
    Accessing the memory of a char array through a uint32_t pointer breaks
    strict-aliasing rules as it dereferences memory with lower alignment
    requirements than the type of the pointer requires. It's no problem on
    x86 as the architecture is able to handle unaligned memory access but
    other architectures are not.
    
    Fix this by doing the test the other way around -- accessing the first
    byte of a uint32_t variable though a uint8_t pointer.
    
    Change-Id: Id340b406597014232741c98a4fd0b7c159f164c2
    Signed-off-by: Mathias Krause <minipli at googlemail.com>

Build-Tested: build bot (Jenkins) at Tue Jul 17 21:37:22 2012, giving +1
Reviewed-By: Stefan Reinauer <stefan.reinauer at coreboot.org> at Tue Jul 17 21:33:23 2012, giving +2
See http://review.coreboot.org/1234 for details.

-gerrit




More information about the coreboot mailing list