public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v8 31/31] arm: Remove duplicated start.S code
Date: Sat, 2 Mar 2013 07:45:06 +0100	[thread overview]
Message-ID: <20130302074506.6ad8bd11@lilith> (raw)
In-Reply-To: <2141850111.221184.1362178466909.JavaMail.root@advansee.com>

Hi Beno?t,

On Fri, 1 Mar 2013 23:54:26 +0100 (CET), Beno?t Th?baudeau
<benoit.thebaudeau@advansee.com> wrote:

Re: assembler error messages:

> > > And in case you ask, with relocate_code() as a function in its own
> > > file instead of a macro called from start.S, it does not work because
> > > of the _start-relative word values that require relocate_code() to be
> > > in _start's section.
> > 
> > How does it "not work" exactly?
> 
> The assembler issues an error (I don't remember the exact message) for all lines
> like ".word __rel_dyn_start - _start", complaining that this is not a kind of
> expression that it can prepare for the linker to resolve.
> 
> Though, it would still be possible to find a more complicated way of doing the
> same thing at runtime.

(later)

> > This whole thing/way of "factorizing" start.S using macros feels wrong
> > to me; this departs from what I have started with crt0.S, where code
> > is actually really factorized in a single file which is actually a
> > compilation unit, not a helper file.
> 
> Yes. Well, for this patch, I had first moved relocate_code() to crt0.S (could
> have been its own file), but I eventually switched to the macro solution because
> of the assembler errors.

I've had issue in the past similar to this when I implemented the ELF
relocation, the crt0.S factorization and more recently the R_ARM_ABS32
relocation record removal. These must be fixed with much attention, for
instance in order to not produce R_ARM_ABS32 relocations, the removal
of which I have just submitted a patch for. I think there is a way to
factorize relocate_code() (and other parts) out of start.S files, built
on what I did for crt0.S, and which should not cause these issues.

Re: patch 31/31 generally:

> This patch is just appended to the series because it depends on it, not because
> the series needs it.
> 
> This patch only aims at cleaning up code by removing copied/pasted code in order
> to simplify maintenance and to clarify things.
> 
> There have been many changes in this relocate_code(), and not always the same
> for all start.S, so from the outside, the purpose is unclear because one might
> wonder if those differences have been created on purpose or not.

(picked up from later in the reply)

> > Do you need patch 31/31 in your series?
> 
> As explained above, no. But I really think that something should be done to stop
> relocate_code() duplication, one way or another, by me or someone else. I just
> wanted to help here.

First, let me say that I appreciate the great help that you're giving us
with this (30-patch!) series.

And I agree about the premise that ARM startup sequence, including
but not limited to relocate_code(), is literally all over the place and
that there is a need to fix this; I wrote so in the cover letter of
my crt0.S patch series, which I consider a starting point and example
of how I consider this should be done.

Also, we must keep in mind that part of the code in ARM should, and
eventually will, be merged into a single U-Boot-wide version. ELF code
relocation is not ARM specific except for the two (to be reduced soon
to only one) ARM relocation record types. Thus, when we touch this
code, we must keep it close, or make it closer, to the code in other
U-Boot architectures; IIRC there are already patches out there to make
relocate_code() a single project-wide true C function.

And I think that this newly added patch 31/31 in your series does not
match either the way I want ARM startup simplification to go or the
general goal of unifying relocate_code().

Thus, if you don't mind, I'd prefer patch 31/31 to move out of the
series. And, since I want to avoid anyone the hassle of going through
this again, I guess I will have to submit a patch for relocate_code()
factorization -- quite probably above your series, since many fixes
you make in it may be useful or even needed.

> Best regards,
> Beno?t

Amicalement,
-- 
Albert.

  parent reply	other threads:[~2013-03-02  6:45 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-01 12:10 [U-Boot] [PATCH v8 01/31] mtd: nand: Introduce CONFIG_SYS_NAND_BUSWIDTH_16BIT Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 02/31] mtd: nand: mxc_nand: Fix is_16bit_nand() Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 03/31] nand: mxc: Prepare to add support for i.MX5 Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 04/31] nand: mxc: Add " Benoît Thébaudeau
2013-03-01 15:33   ` Fabio Estevam
2013-03-01 15:30     ` Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 05/31] imx: mx5: lowlevel_init: Simplify code Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 06/31] imx: mx53ard: Add support for NAND Flash Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 07/31] nand: mxc: Fix debug trace in mxc_nand_read_oob_syndrome() Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 08/31] nand: mxc: Use appropriate page number in syndrome functions Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 09/31] arm: start.S: Fix _TEXT_BASE for SPL Benoît Thébaudeau
2013-03-01 21:17   ` Tom Rini
2013-03-01 12:10 ` [U-Boot] [PATCH v8 10/31] arm: relocate_code() is no longer noreturn Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 11/31] arm1136: Remove redundant relocate_code() return Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 12/31] arm: relocate_code(): Remove useless relocation offset computation Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 13/31] arm: relocate_code(): Use __image_copy_end for end of relocation Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 14/31] arm: crt0.S: Remove bogus .globl Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 15/31] autoconfig.mk: Make it possible to define configs from other configs Benoît Thébaudeau
2013-03-01 21:20   ` Tom Rini
2013-03-01 21:30     ` Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 16/31] Makefile: Change CONFIG_SPL_PAD_TO to image offset Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 17/31] imx: Fix automatic make targets for imx images Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 18/31] nand: mxc: Switch NAND SPL to generic SPL Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 19/31] arm926ejs: Remove deprecated and now unused NAND SPL Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 20/31] arm: Remove unused relocate_code() parameters Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 21/31] Makefile: Move SHELL setup to config.mk Benoît Thébaudeau
2013-03-01 21:26   ` Tom Rini
2013-03-01 12:10 ` [U-Boot] [PATCH v8 22/31] .gitignore: Add /SPL Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 23/31] imx: Add u-boot-with-spl.imx make target Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 24/31] imx: Add u-boot-with-nand-spl.imx " Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 25/31] arm: Remove support for smdk6400 Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 26/31] Revert "mkconfig: start deprecating Makefile config targets" Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 27/31] arm: Remove support for unused s3c64xx Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 28/31] arm: Remove deprecated and now unused NAND SPL Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 29/31] arm1176: Remove unused MMU setup from start.S Benoît Thébaudeau
2013-03-01 15:25   ` Albert ARIBAUD
2013-03-01 15:23     ` Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 30/31] arm: Make all linker scripts compatible with per-symbol sections Benoît Thébaudeau
2013-03-01 12:10 ` [U-Boot] [PATCH v8 31/31] arm: Remove duplicated start.S code Benoît Thébaudeau
2013-03-01 15:46   ` Albert ARIBAUD
2013-03-01 15:50     ` Benoît Thébaudeau
2013-03-01 16:33       ` Benoît Thébaudeau
2013-03-01 21:56       ` Albert ARIBAUD
2013-03-01 22:02         ` Albert ARIBAUD
2013-03-01 22:54         ` Benoît Thébaudeau
2013-03-02  0:22           ` Simon Glass
2013-03-02  1:10             ` Benoît Thébaudeau
2013-03-02  6:45           ` Albert ARIBAUD [this message]
2013-03-02 13:42             ` Benoît Thébaudeau
2013-03-03  8:14               ` Albert ARIBAUD
2013-03-01 15:33 ` [U-Boot] [PATCH v8 01/31] mtd: nand: Introduce CONFIG_SYS_NAND_BUSWIDTH_16BIT Benoît Thébaudeau
2013-03-01 15:39   ` Fabio Estevam

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=20130302074506.6ad8bd11@lilith \
    --to=albert.u.boot@aribaud.net \
    --cc=u-boot@lists.denx.de \
    /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