diff mbox

[U-Boot,1/3] arch/sh: don't bring common/env_embedded.o into the link

Message ID 20170728214638.23931-2-thomas.petazzoni@free-electrons.com
State Accepted
Delegated to: Nobuhiro Iwamatsu
Headers show

Commit Message

Thomas Petazzoni July 28, 2017, 9:46 p.m. UTC
The linker script for SuperH brings the .ppcenv and .ppcenvr section
of common/env_embedded.o into the .text section. However, the .ppcenv
section is only ever filled in by env_embedded.o when
CONFIG_SYS_USE_PPCENV is defined, but no platforms in mainline U-Boot
use this.

In addition, common/env_embedded.o is not always built (when you use
CONFIG_ENV_IS_NOWHERE for example), which causes the following build
failure:

Fixes:

  LD      u-boot
/home/thomas/sh4aeb-linux-musl/bin/sh4aeb-linux-ld.bfd: cannot find common/env_embedded.o

We fix this by no longer adding the .ppcenv and .ppcenvr sections from
common/env_embedded.o into the .text section.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/sh/cpu/u-boot.lds | 4 ----
 1 file changed, 4 deletions(-)

Comments

Nobuhiro Iwamatsu Aug. 2, 2017, 11:20 p.m. UTC | #1
Hi,

2017-07-29 6:46 GMT+09:00 Thomas Petazzoni
<thomas.petazzoni@free-electrons.com>:
> The linker script for SuperH brings the .ppcenv and .ppcenvr section
> of common/env_embedded.o into the .text section. However, the .ppcenv
> section is only ever filled in by env_embedded.o when
> CONFIG_SYS_USE_PPCENV is defined, but no platforms in mainline U-Boot
> use this.
>
> In addition, common/env_embedded.o is not always built (when you use
> CONFIG_ENV_IS_NOWHERE for example), which causes the following build
> failure:
>
> Fixes:
>
>   LD      u-boot
> /home/thomas/sh4aeb-linux-musl/bin/sh4aeb-linux-ld.bfd: cannot find common/env_embedded.o
>
> We fix this by no longer adding the .ppcenv and .ppcenvr sections from
> common/env_embedded.o into the .text section.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

> ---
>  arch/sh/cpu/u-boot.lds | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/arch/sh/cpu/u-boot.lds b/arch/sh/cpu/u-boot.lds
> index f185b4d..2f2bdb5 100644
> --- a/arch/sh/cpu/u-boot.lds
> +++ b/arch/sh/cpu/u-boot.lds
> @@ -38,10 +38,6 @@ SECTIONS
>                 KEEP(CONFIG_BOARDDIR/lowlevel_init.o    (.text .spiboot1.text))
>                 KEEP(*(.spiboot2.text))
>                 . = ALIGN(8192);
> -               common/env_embedded.o   (.ppcenv)
> -               . = ALIGN(8192);
> -               common/env_embedded.o   (.ppcenvr)
> -               . = ALIGN(8192);
>                 *(.text)
>                 . = ALIGN(4);
>         } >ram =0xFF
> --
> 2.9.4
>
Thomas Petazzoni Aug. 15, 2017, 8:54 p.m. UTC | #2
Hello,

On Thu, 3 Aug 2017 08:20:20 +0900, Nobuhiro Iwamatsu wrote:
> Hi,
> 
> 2017-07-29 6:46 GMT+09:00 Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com>:
> > The linker script for SuperH brings the .ppcenv and .ppcenvr section
> > of common/env_embedded.o into the .text section. However, the .ppcenv
> > section is only ever filled in by env_embedded.o when
> > CONFIG_SYS_USE_PPCENV is defined, but no platforms in mainline U-Boot
> > use this.
> >
> > In addition, common/env_embedded.o is not always built (when you use
> > CONFIG_ENV_IS_NOWHERE for example), which causes the following build
> > failure:
> >
> > Fixes:
> >
> >   LD      u-boot
> > /home/thomas/sh4aeb-linux-musl/bin/sh4aeb-linux-ld.bfd: cannot find common/env_embedded.o
> >
> > We fix this by no longer adding the .ppcenv and .ppcenvr sections from
> > common/env_embedded.o into the .text section.
> >
> > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>  
> 
> Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

Thanks for your review! Are you going to apply the patch, as you did
for "arch/sh: allow building in big-endian mode" ?

Thanks!

Thomas
diff mbox

Patch

diff --git a/arch/sh/cpu/u-boot.lds b/arch/sh/cpu/u-boot.lds
index f185b4d..2f2bdb5 100644
--- a/arch/sh/cpu/u-boot.lds
+++ b/arch/sh/cpu/u-boot.lds
@@ -38,10 +38,6 @@  SECTIONS
 		KEEP(CONFIG_BOARDDIR/lowlevel_init.o	(.text .spiboot1.text))
 		KEEP(*(.spiboot2.text))
 		. = ALIGN(8192);
-		common/env_embedded.o	(.ppcenv)
-		. = ALIGN(8192);
-		common/env_embedded.o	(.ppcenvr)
-		. = ALIGN(8192);
 		*(.text)
 		. = ALIGN(4);
 	} >ram =0xFF