barebox: CFI cfi_qry structure unaligned access causing data abo

abc
Hi All,
I am using barebox 2011.06.0. I compiled this code with gcc 4.8.3 linaro
toolchain and eglibc 2.19 (openwrt BB branch based sdk). While barebox
boot, In nor flash driver registration it is trying to access the cfi_qry
structure p_id member, this is causing data abort. 

I am pasting the cfi_qry structure definition below:

/* CFI standard query structure */
struct cfi_qry {
        u8      qry[3];
        u16     p_id;
        u16     p_adr;
        u16     a_id;
        u16     a_adr;
        u8      vcc_min;
        u8      vcc_max;
        u8      vpp_min;
        u8      vpp_max;
        u8      word_write_timeout_typ;
        u8      buf_write_timeout_typ;
        u8      block_erase_timeout_typ;
        u8      chip_erase_timeout_typ;
        u8      word_write_timeout_max;
        u8      buf_write_timeout_max;
        u8      block_erase_timeout_max;
        u8      chip_erase_timeout_max;
        u8      dev_size;
        u16     interface_desc;
        u16     max_buf_write_size;
        u8      num_erase_regions;
        u32     erase_region_info[NUM_ERASE_REGIONS];
} __attribute__((packed));

The same code and compilation method is same, if I compile gcc 4.5 linaro
with glibc 2.14.1 (Openwrt AA based sdk) toolchain it is not giving any
issue. The latest barebox code is also similar respective this driver
(cfi_flash.c)
Anybody has any idea or faced this issue?

abc
The problem is solved if I pass the -mo-unalign-access flag.

Juergen
For what kind of architecture do you try to build barebox?
From the compiler's manpages "-mno-unaligned-access" is the default for all
pre-ARMv6 CPU architectures. Maybe with your changed compiler release also
their default CPU architectures changes?