[U-Boot] [RFC] ARM: prevent misaligned array inits

Albert ARIBAUD albert.u.boot at aribaud.net
Tue Oct 2 22:05:40 CEST 2012


Hi Joakim,

On Tue, 2 Oct 2012 21:13:39 +0200, Joakim Tjernlund
<joakim.tjernlund at transmode.se> wrote:

> 
> 
> >   *********************************************************************/
> >  void display_board_info(u32 btype)
> >  {
> > -   char cpu_2420[] = "2420";   /* cpu type */
> > -   char cpu_2422[] = "2422";
> > -   char cpu_2423[] = "2423";
> > -   char db_men[] = "Menelaus"; /* board type */
> > -   char db_ip[] = "IP";
> > -   char mem_sdr[] = "mSDR";    /* memory type */
> > -   char mem_ddr[] = "mDDR";
> > -   char t_tst[] = "TST";       /* security level */
> > -   char t_emu[] = "EMU";
> > -   char t_hs[] = "HS";
> > -   char t_gp[] = "GP";
> > -   char unk[] = "?";
> > +   char *cpu_2420 = "2420";   /* cpu type */
> > +   char *cpu_2422 = "2422";
> > +   char *cpu_2423 = "2423";
> > +   char *db_men = "Menelaus"; /* board type */
> > +   char *db_ip = "IP";
> > +   char *mem_sdr = "mSDR";    /* memory type */
> > +   char *mem_ddr = "mDDR";
> > +   char *t_tst = "TST";       /* security level */
> > +   char *t_emu = "EMU";
> > +   char *t_hs = "HS";
> > +   char *t_gp = "GP";
> > +   char *unk = "?";
> 
> hmm, on ppc I think this will cause relocation entries which will build size.
> 
>  Jocke

Can you try it and post results with and without it? Sizes and if
possible disassembly of the function for both cases.

Would it better if the strings were used directly in the function body?
I could replace the char* locals with #defines, for instance.

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list