Re: [PATCH 5/7] X86: lds: remove unnecessary alignments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sam,

On Wed, Oct 02, 2019 at 08:53:37PM +0200, Sam Ravnborg wrote:
> Hi Sascha.
> 
> On Wed, Oct 02, 2019 at 04:44:28PM +0200, Sascha Hauer wrote:
> > We do not seem to need all these alignments in the rodata sections
> > except the one for the command array. Remove them and put the alignment
> > for the command array into the BAREBOX_CMDS define.
> 
> The changelog does not match the code.
> The alignment is only for x86_64.
> 
> > --- a/include/asm-generic/barebox.lds.h
> > +++ b/include/asm-generic/barebox.lds.h
> > @@ -46,7 +46,13 @@
> >  	KEEP(*(.exitcall.6))			\
> >  	__barebox_exitcalls_end = .;
> >  
> > +/* For some obscure reason X86_64 needs these 64bit aligned */
> 
> The obscure reason looks like this (from include/command.h):
> #ifdef __x86_64__
> /* This is required because the linker will put symbols on a 64 bit alignment */
> __attribute__((aligned(64)))
> #endif
> 
> I did not try it. But I would assume removing the alignment from the .h
> file and the .lds file would sort it out.

Unfortunately it doesn't. I still don't fully understand this, but the
linker uses a different alignment for the array as the compiler does.

I chose to go a different way and have created an array of pointers to
the commands rather than putting the commands directly into an array.
This seems to solve it without playing aligmnent tricks.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux