[U-Boot] [PATCH] part_efi: fix protective_mbr struct allocation

Palacios, Hector Hector.Palacios at digi.com
Wed Feb 12 17:48:36 CET 2014


Hi Albert,

On 02/12/2014 05:31 PM, Albert ARIBAUD wrote:
> Hi Hector,
>
> On Wed, 12 Feb 2014 17:24:26 +0100, "Palacios, Hector"
> <Hector.Palacios at digi.com> wrote:
>
>> Unfortunately this is causing unaligned access in my i.MX6.
>> I'm specifically passing the -mno-unaligned-access when building this file so I guess
>> it has to do with the macro and the packed structure.
>
> I don't think this is due to packed structures, because
> -mno-unaligned-access tells the compiler that unaligned fields in
> packed structures should be accesses by breaking the unaligned access
> into smaller aligned ones, so this would not cause an alignment abort.
>
> What can cause an alignment abort despite -mno-unaligned-access is
> dereferencing a badly aligned pointer, and this is probably what
> happens here.

Oh, the macro ALLOC_CACHE_ALIGN_BUFFER is returning a correctly aligned value for the 
pointer: 0x4FD33BA0
The problem is we don't have to free() the pointer anymore at the end of the function.

I'll repost the patch
-- 
Héctor Palacios


More information about the U-Boot mailing list