mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH 5/7] X86: lds: remove unnecessary alignments
Date: Mon, 14 Oct 2019 12:08:16 +0200	[thread overview]
Message-ID: <20191014100815.6kofs6c57fzof3f6@pengutronix.de> (raw)
In-Reply-To: <20191002185337.GB32491@ravnborg.org>

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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2019-10-14 10:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02 14:44 [PATCH 0/7] Cleanup linker scripts Sascha Hauer
2019-10-02 14:44 ` [PATCH 1/7] barebox.lds: Remove unnecessary braces Sascha Hauer
2019-10-02 14:44 ` [PATCH 2/7] ppc: remove unused variables from linker scripts Sascha Hauer
2019-10-02 14:44 ` [PATCH 3/7] lds: Move start/end address variables into defines Sascha Hauer
2019-10-02 18:46   ` Sam Ravnborg
2019-10-02 14:44 ` [PATCH 4/7] lds: create and use BAREBOX_PCI_FIXUP macro Sascha Hauer
2019-10-02 14:44 ` [PATCH 5/7] X86: lds: remove unnecessary alignments Sascha Hauer
2019-10-02 18:53   ` Sam Ravnborg
2019-10-14 10:05     ` [PATCH] command: Use array of pointers to commands Sascha Hauer
2019-10-14 10:08     ` Sascha Hauer [this message]
2019-10-02 14:44 ` [PATCH 6/7] lds: remove more unnecessary alignments Sascha Hauer
2019-10-02 18:55   ` Sam Ravnborg
2019-10-02 14:44 ` [PATCH 7/7] lds: Add and use RO_DATA_SECTION macro Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191014100815.6kofs6c57fzof3f6@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox