MIPS: use an unified u-boot.lds script
v2 cover MIPS: use an unified u-boot.lds script
This patch-set adds an unfied u-boot.lds file for the MIPS architecture, and removes the linker scripts of the individual boards.
The series depends on the following patch:
MIPS: remove OUTPUT_FORMAT from linker scripts
http://patchwork.ozlabs.org/patch/216892/
Gabor Juhos (7):
MIPS: add unified u-boot.lds file
MIPS: qemu-mips: use the unified u-boot.lds script
MIPS: pb1x00: remove custom u-boot.lds script
MIPS: vct: remove custom u-boot.lds script
MIPS: incaip: remove custom u-boot.lds script
MIPS: dbau1x00: remove custom u-boot.lds script
MIPS: qi_lb60: remove custom u-boot.lds script
arch/mips/cpu/u-boot.lds | 84 +++++++++++++++++++++++++++++++++++++++++ board/dbau1x00/u-boot.lds | 65 ------------------------------- board/incaip/u-boot.lds | 65 ------------------------------- board/micronas/vct/u-boot.lds | 68 --------------------------------- board/pb1x00/u-boot.lds | 65 ------------------------------- board/qemu-mips/u-boot.lds | 70 ---------------------------------- board/qi/qi_lb60/u-boot.lds | 61 ------------------------------ 7 files changed, 84 insertions(+), 394 deletions(-) create mode 100644 arch/mips/cpu/u-boot.lds delete mode 100644 board/dbau1x00/u-boot.lds delete mode 100644 board/incaip/u-boot.lds delete mode 100644 board/micronas/vct/u-boot.lds delete mode 100644 board/pb1x00/u-boot.lds delete mode 100644 board/qemu-mips/u-boot.lds delete mode 100644 board/qi/qi_lb60/u-boot.lds
Signature · 1 line
1.7.10
PATCH v2 1/7 MIPS: add unified u-boot.lds file
The patch adds an unified linker script file which can be used for all currently supported MIPS targets.
---
Changes since v1:
- use consistent coding style for all sections
- remove the OUTPUT_FORMAT command from the
unified script
--- arch/mips/cpu/u-boot.lds | 84 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 arch/mips/cpu/u-boot.lds
arch/mips/cpu/u-boot.lds new file +84 -0
@@ -0,0 +1,84 @@ +/* + * (C) Copyright 2003 + * Wolfgang Denk Engineering, <[email protected]> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#if defined(CONFIG_64BIT) +#define PTR_COUNT_SHIFT 3 +#else +#define PTR_COUNT_SHIFT 2 +#endif + +OUTPUT_ARCH(mips) +ENTRY(_start) +SECTIONS +{ + . = 0x00000000; + + . = ALIGN(4); + .text : { + *(.text*) + } + + . = ALIGN(4); + .rodata : { + *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) + } + + . = ALIGN(4); + .data : { + *(.data*) + } + + . = .; + _gp = ALIGN(16) + 0x7ff0; + + .got : { + __got_start = .; + *(.got) + __got_end = .; + } + + . = ALIGN(4); + .sdata : { + *(.sdata*) + } + + . = ALIGN(4); + .u_boot_list : { + #include <u-boot.lst> + } + + uboot_end_data = .; + + num_got_entries = (__got_end - __got_start) >> PTR_COUNT_SHIFT; + + . = ALIGN(4); + .sbss : { + *(.sbss*) + } + + .bss : { + *(.bss*) + . = ALIGN(4); + } + uboot_end = .; +}
Signature · 1 line
1.7.10
PATCH v2 1/7 MIPS: add unified u-boot.lds file
Quoted 8 lines · Gabor Juhos
The patch adds an unified linker script file which can be used for all currently supported MIPS targets.
Signed-off-by Gabor Juhos <[email protected]>Cc Daniel Schwierzeck <[email protected]>Cc Stefan Roese <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Xiangfu Liu <[email protected]>
Again, can't test but looks good. Thanks.
Thanks,
Stefan
PATCH v2 1/7 MIPS: add unified u-boot.lds file
2013.01.30. 15:34 keltez?ssel, Stefan Roese ?rta:
Quoted 10 lines · Gabor Juhos
Quoted 8 lines
The patch adds an unified linker script file which can be used for all currently supported MIPS targets.
Signed-off-by Gabor Juhos <[email protected]>Cc Daniel Schwierzeck <[email protected]>Cc Stefan Roese <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Xiangfu Liu <[email protected]>
Quoted 3 lines
Again, can't test but looks good. Thanks.
Acked-by Stefan Roese <[email protected]>
Thanks!
-Gabor
PATCH v2 2/7 MIPS: qemu-mips: use the unified u-boot.lds script
In reply to Gabor JuhosRemove the board specific linker script. It is not needed anymore, the unified MIPS linker script can be used instead.
All qemu_mips targets are producing identical binary images after the change than before.
---
Changes since v1: ---
--- board/qemu-mips/u-boot.lds | 70 -------------------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 board/qemu-mips/u-boot.lds
board/qemu-mips/u-boot.lds deleted +0 -70
@@ -1,70 +0,0 @@ -/* - * (C) Copyright 2003 - * Wolfgang Denk Engineering, <[email protected]> - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -OUTPUT_ARCH(mips) -ENTRY(_start) -SECTIONS -{ - . = 0x00000000; - - . = ALIGN(4); - .text : - { - *(.text*) - } - - . = ALIGN(4); - .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } - - . = ALIGN(4); - .data : { *(.data*) } - - . = .; - _gp = ALIGN(16) +0x7ff0; - - .got : { - __got_start = .; - *(.got) - __got_end = .; - } - - . = ALIGN(4); - .sdata : { *(.sdata*) } - - . = ALIGN(4); - .u_boot_list : { - #include <u-boot.lst> - } - - uboot_end_data = .; -#if defined(CONFIG_64BIT) - num_got_entries = (__got_end - __got_start) >> 3; -#else - num_got_entries = (__got_end - __got_start) >> 2; -#endif - - . = ALIGN(4); - .sbss : { *(.sbss*) } - .bss : { *(.bss*) . = ALIGN(4); } - uboot_end = .; -}
Signature · 1 line
1.7.10
PATCH v2 3/7 MIPS: pb1x00: remove custom u-boot.lds script
In reply to Gabor JuhosRemove the board specific linker script. It is not needed anymore, the unified MIPS linker script can be used instead.
All pb1x00 targets are producing identical binary
images after the change than before.
---
Changes since v1: ---
--- board/pb1x00/u-boot.lds | 65 ----------------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 board/pb1x00/u-boot.lds
board/pb1x00/u-boot.lds deleted +0 -65
@@ -1,65 +0,0 @@ -/* - * (C) Copyright 2003 - * Wolfgang Denk Engineering, <[email protected]> - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -OUTPUT_ARCH(mips) -ENTRY(_start) -SECTIONS -{ - . = 0x00000000; - - . = ALIGN(4); - .text : - { - *(.text*) - } - - . = ALIGN(4); - .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } - - . = ALIGN(4); - .data : { *(.data*) } - - . = .; - _gp = ALIGN(16) + 0x7ff0; - - .got : { - __got_start = .; - *(.got) - __got_end = .; - } - - .sdata : { *(.sdata*) } - - . = ALIGN(4); - .u_boot_list : { - #include <u-boot.lst> - } - - uboot_end_data = .; - num_got_entries = (__got_end - __got_start) >> 2; - - . = ALIGN(4); - .sbss (NOLOAD) : { *(.sbss*) } - .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } - uboot_end = .; -}
Signature · 1 line
1.7.10
PATCH v2 4/7 MIPS: vct: remove custom u-boot.lds script
In reply to Gabor JuhosRemove the board specific linker script. It is not needed anymore, the unified MIPS linker script can be used instead.
All vct targets are producing identical binary
images after the change than before.
---
Changes since v1: ---
--- board/micronas/vct/u-boot.lds | 68 ----------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 board/micronas/vct/u-boot.lds
board/micronas/vct/u-boot.lds deleted +0 -68
@@ -1,68 +0,0 @@ -/* - * (C) Copyright 2003 - * Wolfgang Denk Engineering, <[email protected]> - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -OUTPUT_ARCH(mips) -ENTRY(_start) -SECTIONS -{ - . = 0x00000000; - - . = ALIGN(4); - .text : - { - *(.text*) - } - - . = ALIGN(4); - .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } - - . = ALIGN(4); - .data : { *(.data*) } - - . = .; - _gp = ALIGN(16) + 0x7ff0; - - .got : { - __got_start = .; - *(.got) - __got_end = .; - } - - . = ALIGN(4); - .sdata : { *(.sdata*) } - - . = ALIGN(4); - .u_boot_list : { - #include <u-boot.lst> - } - - . = ALIGN(4); - uboot_end_data = .; - num_got_entries = (__got_end - __got_start) >> 2; - - . = ALIGN(4); - .sbss (NOLOAD) : { *(.sbss*) } - . = ALIGN(4); - .bss (NOLOAD) : { *(.bss*) } - uboot_end = .; -}
Signature · 1 line
1.7.10
PATCH v2 5/7 MIPS: incaip: remove custom u-boot.lds script
In reply to Gabor JuhosRemove the board specific linker script. It is not needed anymore, the unified MIPS linker script can be used instead.
All incaip targets are producing identical binary
images after the change than before.
---
Changes since v1: ---
--- board/incaip/u-boot.lds | 65 ----------------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 board/incaip/u-boot.lds
board/incaip/u-boot.lds deleted +0 -65
@@ -1,65 +0,0 @@ -/* - * (C) Copyright 2003 - * Wolfgang Denk Engineering, <[email protected]> - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -OUTPUT_ARCH(mips) -ENTRY(_start) -SECTIONS -{ - . = 0x00000000; - - . = ALIGN(4); - .text : - { - *(.text*) - } - - . = ALIGN(4); - .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } - - . = ALIGN(4); - .data : { *(.data*) } - - . = .; - _gp = ALIGN(16) + 0x7ff0; - - .got : { - __got_start = .; - *(.got) - __got_end = .; - } - - .sdata : { *(.sdata*) } - - . = ALIGN(4); - .u_boot_list : { - #include <u-boot.lst> - } - - uboot_end_data = .; - num_got_entries = (__got_end - __got_start) >> 2; - - . = ALIGN(4); - .sbss (NOLOAD) : { *(.sbss*) } - .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } - uboot_end = .; -}
Signature · 1 line
1.7.10
PATCH v2 6/7 MIPS: dbau1x00: remove custom u-boot.lds script
In reply to Gabor JuhosRemove the board specific linker script. It is not needed anymore, the unified MIPS linker script can be used instead.
All dbau1x00 targets are producing identical binary images after the change than before.
---
Changes since v1: ---
--- board/dbau1x00/u-boot.lds | 65 --------------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 board/dbau1x00/u-boot.lds
board/dbau1x00/u-boot.lds deleted +0 -65
@@ -1,65 +0,0 @@ -/* - * (C) Copyright 2003 - * Wolfgang Denk Engineering, <[email protected]> - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -OUTPUT_ARCH(mips) -ENTRY(_start) -SECTIONS -{ - . = 0x00000000; - - . = ALIGN(4); - .text : - { - *(.text*) - } - - . = ALIGN(4); - .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } - - . = ALIGN(4); - .data : { *(.data*) } - - . = .; - _gp = ALIGN(16) + 0x7ff0; - - .got : { - __got_start = .; - *(.got) - __got_end = .; - } - - .sdata : { *(.sdata*) } - - . = ALIGN(4); - .u_boot_list : { - #include <u-boot.lst> - } - - uboot_end_data = .; - num_got_entries = (__got_end - __got_start) >> 2; - - . = ALIGN(4); - .sbss (NOLOAD) : { *(.sbss*) } - .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } - uboot_end = .; -}
Signature · 1 line
1.7.10
PATCH v2 7/7 MIPS: qi_lb60: remove custom u-boot.lds script
In reply to Gabor JuhosRemove the board specific linker script. It is not needed anymore, the unified MIPS linker script can be used instead.
The qi_lb60 target produces a slightly different
image after the change than before. The value of
'num_got_entries' symbol is different:
@@ -49,7 +49,7 @@
801000b4: 80122d00 lb s2,11520(zero)
801000b8: 80123500 lb s2,13568(zero)
801000bc: 80123ef8 lb s2,16120(zero)
-801000c0: 00000139 0x139
+801000c0: 00000136 tne zero,zero,0x4
801000c4 <in_ram>:
801000c4: 8d0bfffc lw t3,-4(t0)This is caused by the different placement of the
'__got_start' and '__got_end' symbols between the
board specific scrip and the unified script.
board specific script:
__got_start = .;
.got : { *(.got) }
__got_end = .; unified script:
.got : {
__got_start = .;
*(.got)
__got_end = .;
}Despite this difference, the resulting images are
functionally identical.
---
Changes since v1: ---
--- board/qi/qi_lb60/u-boot.lds | 61 ------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 board/qi/qi_lb60/u-boot.lds
board/qi/qi_lb60/u-boot.lds deleted +0 -61
@@ -1,61 +0,0 @@ -/* - * (C) Copyright 2006 - * Ingenic Semiconductor, <[email protected]> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -OUTPUT_ARCH(mips) -ENTRY(_start) -SECTIONS -{ - . = 0x00000000; - - . = ALIGN(4); - .text : - { - *(.text*) - } - - . = ALIGN(4); - .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } - - . = ALIGN(4); - .data : { *(.data*) } - - . = .; - _gp = ALIGN(16) + 0x7ff0; - - __got_start = .; - .got : { *(.got) } - __got_end = .; - - .sdata : { *(.sdata*) } - - - . = ALIGN(4); - .u_boot_list : { - #include <u-boot.lst> - } - - uboot_end_data = .; - num_got_entries = (__got_end - __got_start) >> 2; - - . = ALIGN(4); - .sbss : { *(.sbss*) } - .bss : { *(.bss*) . = ALIGN(4); } - uboot_end = .; -}
Signature · 1 line
1.7.10