[U-Boot] [PATCH 3/5] common: Add .u_boot_list into all linker files

Daniel Schwierzeck daniel.schwierzeck at gmail.com
Wed Oct 3 16:55:06 CEST 2012


Hi Marek,

2012/9/30 Marek Vasut <marex at denx.de>:
> Add section for the linker-generated lists into all possible linker
> files, so that everyone can easily use these lists. This is mostly
> a mechanical adjustment.
>
> Signed-off-by: Marek Vasut <marex at denx.de>
> Cc: Joe Hershberger <joe.hershberger at gmail.com>
> Cc: Mike Frysinger <vapier at gentoo.org>
> ---

<snip>

> diff --git a/examples/standalone/mips.lds b/examples/standalone/mips.lds
> index 5f766ed..65c654d 100644
> --- a/examples/standalone/mips.lds
> +++ b/examples/standalone/mips.lds
> @@ -39,6 +39,10 @@ SECTIONS
>         . = ALIGN(4);
>         .data  : { *(.data*) }
>
> +       .u_boot_list : {
> +               INCLUDE u-boot.lst;
> +       }
> +
>         . = .;
>         _gp = ALIGN(16) + 0x7ff0;
>
> diff --git a/examples/standalone/nds32.lds b/examples/standalone/nds32.lds
> index 50b4c4b..4e581ad 100644
> --- a/examples/standalone/nds32.lds
> +++ b/examples/standalone/nds32.lds
> @@ -36,6 +36,10 @@ SECTIONS
>         . = ALIGN(4);
>         .data : { *(.data) }
>
> +       .u_boot_list : {
> +               INCLUDE u-boot.lst;
> +       }
> +
>         . = ALIGN(4);
>
>         .got : {
> diff --git a/examples/standalone/sparc.lds b/examples/standalone/sparc.lds
> index 9733daa..908a9be 100644
> --- a/examples/standalone/sparc.lds
> +++ b/examples/standalone/sparc.lds
> @@ -46,6 +46,11 @@ SECTIONS
>         {
>                 *(.data)
>         }
> +
> +       .u_boot_list : {
> +               INCLUDE u-boot.lst;
> +       }
> +
>         . = ALIGN(4);
>         __data_end = .;
>
> diff --git a/nand_spl/board/freescale/mx31pdk/u-boot.lds b/nand_spl/board/freescale/mx31pdk/u-boot.lds
> index d2b08f6..363690f 100644
> --- a/nand_spl/board/freescale/mx31pdk/u-boot.lds
> +++ b/nand_spl/board/freescale/mx31pdk/u-boot.lds
> @@ -51,6 +51,11 @@ SECTIONS
>         __u_boot_cmd_end = .;
>
>         . = ALIGN(4);
> +       .u_boot_list : {
> +               INCLUDE u-boot.lst;
> +       }
> +
> +       . = ALIGN(4);
>
>         .rel.dyn : {
>                 __rel_dyn_start = .;
> diff --git a/nand_spl/board/karo/tx25/u-boot.lds b/nand_spl/board/karo/tx25/u-boot.lds
> index d2b08f6..8332710 100644
> --- a/nand_spl/board/karo/tx25/u-boot.lds
> +++ b/nand_spl/board/karo/tx25/u-boot.lds
> @@ -51,6 +51,11 @@ SECTIONS
>         __u_boot_cmd_end = .;
>
>         . = ALIGN(4);
> +       .u_boot_list : {
> +       INCLUDE u-boot.lst;
> +       }
> +
> +       . = ALIGN(4);
>
>         .rel.dyn : {
>                 __rel_dyn_start = .;
> diff --git a/nand_spl/board/samsung/smdk6400/u-boot.lds b/nand_spl/board/samsung/smdk6400/u-boot.lds
> index 567f635..7ceae32 100644
> --- a/nand_spl/board/samsung/smdk6400/u-boot.lds
> +++ b/nand_spl/board/samsung/smdk6400/u-boot.lds
> @@ -55,6 +55,11 @@ SECTIONS
>         __u_boot_cmd_end = .;
>
>         . = ALIGN(4);
> +       .u_boot_list : {
> +       INCLUDE u-boot.lst;
> +       }
> +
> +       . = ALIGN(4);
>
>         .rel.dyn : {
>         __rel_dyn_start = .;
> --
> 1.7.10.4
>

this can't work because u-boot.lst is genereated in top-level directory
but linking of standalone code happens in the according subdirectories.
Thus the linker can't find u-boot.lst.

Example for MIPS standalone:

/opt/eldk-5.2.1/mips/sysroots/i686-eldk-linux/usr/bin/mips32-linux/mips-linux-ld.bfd
 -G 0 -static -n -nostdlib -EB -g -Ttext 0x80200000 -T mips.lds \
			-o hello_world -e hello_world hello_world.o libstubs.o \
			-L/opt/eldk-5.2.1/mips/sysroots/mips32-linux/usr/lib/mips-linux/4.6.4 -lgcc
/opt/eldk-5.2.1/mips/sysroots/i686-eldk-linux/usr/bin/mips32-linux/mips-linux-ld.bfd:
cannot open linker script file u-boot.lst: No such file or directory

-- 
Best regards,
Daniel


More information about the U-Boot mailing list