[U-Boot] [PATCH v3 12/21] sandbox: Force command sections to be 4-byte aligned

Simon Glass sjg at chromium.org
Tue Oct 4 02:05:43 CEST 2011


Hi Mike,

On Mon, Oct 3, 2011 at 12:34 PM, Mike Frysinger <vapier at gentoo.org> wrote:
> On Monday, September 26, 2011 20:10:46 Simon Glass wrote:
>> By default sections are 16-byte aligned on some architectures, but the
>> command name structure (struct cmd_tbl_s) does not have padding to
>> 16 bytes. This change reduces the alignment to 4-bytes so that the command
>> table can be accessed correctly on any architecture.
>
> where is this coming from ?  why does it need to be 4 byte ?  could you
> elaborate on the issue you ran into ?
> -mike
>

Yes, we have a structure cmd_tbl_s in include/command.h which is a
certain size. We use the linker to collect elements of an array of
these structures and then at run-time we want this array to be
accessible.

If the linker puts padding between elements then we cannot access the
array properly.

I need to take another look at this though, as I didn't spend much
time on it at the time.

Regards,
Simon


More information about the U-Boot mailing list