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

Albert ARIBAUD
2012-10-02T20:05:40Z

Hi Joakim,

On Tue, 2 Oct 2012 21:13:39 +0200, Joakim Tjernlund
<joakim.tjernlund@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.