Re: [U-Boot] [PATCH v2] 85xx: Move to a common linker script
Dear Kumar Gala, In message <1249997451-21265-1-git-send-email-ga...@kernel.crashing.org> you wrote: > There are really no differences between all the 85xx linker scripts so > we can just move to a single common one. Board code is still able to > override the common one if need be. > > Signed-off-by: Kumar Gala > --- This commit breaks building TQM85xx boards. Before this commit: -> git-describe v2009.08-rc3-56-g87c7661 -> ./MAKEALL TQM8555 ... TQM8555 (MPC8555) Configuring for TQM85xx board... textdata bss dec hex filename 220096 16140 34552 270788 421c4 ./u-boot After this commit: -> git-describe v2009.08-rc3-57-gec79d33 -> ./MAKEALL TQM8555 ... TQM8555 (MPC8555) Configuring for TQM85xx board... ppc_6xx-ld: u-boot: section .text lma 0xfffc overlaps previous sections ppc_6xx-ld: u-boot: section .rodata lma 0xfffebe3c overlaps previous sections ppc_6xx-ld: u-boot: section .reloc lma 0x5a00 overlaps previous sections ppc_6xx-ld: u-boot: section .data lma 0x6fe8 overlaps previous sections ppc_6xx-ld: u-boot: section .data.rel.ro.local lma 0x7cbc overlaps previous sections ppc_6xx-ld: u-boot: section .data.rel lma 0x7d1c overlaps previous sections ppc_6xx-ld: u-boot: section .data.rel.local lma 0x86b8 overlaps previous sections ppc_6xx-ld: u-boot: section .u_boot_cmd lma 0x93e8 overlaps previous sections textdata bss dec hex filename 220096 16140 34552 270788 421c4 ./u-boot Please help. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de In the beginning, I was made. I didn't ask to be made. No one consul- ted with me or considered my feelings in this matter. But if it brought some passing fancy to some lowly humans as they haphazardly pranced their way through life's mournful jungle, then so be it. - Marvin the Paranoid Android ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] 85xx: Move to a common linker script
On Aug 11, 2009, at 2:58 PM, Wolfgang Denk wrote: > Dear Kumar Gala, > > In message <1249997451-21265-1-git-send-email-ga...@kernel.crashing.org > > you wrote: >> There are really no differences between all the 85xx linker scripts >> so >> we can just move to a single common one. Board code is still able to >> override the common one if need be. > > Are you sure there are no differences? There are differences but the differences exist because the non Freescale specific boards haven't kept up with the changes. If the following changes got made to the other linker scripts we'd be in sync: commit c11528083ef6e55e76df742228c26e39d151813d Author: Kumar Gala Date: Thu Aug 7 09:28:20 2008 -0500 mpc85xx: workaround old binutils bug The recent change to move the .bss outside of the image gives older binutils (ld from eldk4.1/binutils-2.16) some headache: ppc_85xx-ld: u-boot: Not enough room for program headers (allocated 3, need 4) ppc_85xx-ld: final link failed: Bad value We workaround it by being explicit about the program headers and not assigning the .bss to a program header. Signed-off-by: Kumar Gala commit f0ff885ca64655bee6540eb8a25eed90b1152686 Author: Kumar Gala Date: Wed Jul 30 14:13:30 2008 -0500 mpc85xx: Update linker scripts for Freescale boards * Move to using absolute addressing always. Makes the scripts a bit more portable and common * Moved .bss after the end of the image. These allows us to have more room in the resulting binary image for code and data. * Removed .text object files that aren't really needed * Make sure _end is 4-byte aligned as the .bss init code expects this. (Its possible that the end of .bss isn't 4-byte aligned) Signed-off-by: Kumar Gala > --- board/atum8548/u-boot.lds 2009-07-28 20:27:27.549470982 +0200 > +++ board/freescale/mpc8536ds/u-boot.lds 2009-07-28 > 20:27:27.678455216 +0200 > @@ -1,5 +1,5 @@ > /* > - * Copyright 2007 Freescale Semiconductor, Inc. > + * Copyright 2008 Freescale Semiconductor, Inc. > * > * See file CREDITS for list of people who contributed to this > * project. > @@ -23,18 +23,14 @@ > OUTPUT_ARCH(powerpc) > /* Do we need any of these for elf? >__DYNAMIC = 0;*/ > -SECTIONS > -{ > - .resetvec 0xFFFC : > +PHDRS > { > -*(.resetvec) > - } = 0x > + text PT_LOAD; > + bss PT_LOAD; > +} > > - .bootpg 0xF000 : > +SECTIONS > { > -cpu/mpc85xx/start.o (.bootpg) > - } = 0x > - > /* Read-only sections, merged into text segment: */ > . = + SIZEOF_HEADERS; > .interp : { *(.interp) } > @@ -61,26 +57,17 @@ > .plt : { *(.plt) } > .text : > { > -cpu/mpc85xx/start.o (.text) > -cpu/mpc85xx/traps.o (.text) > -cpu/mpc85xx/interrupts.o (.text) > -cpu/mpc85xx/cpu_init.o (.text) > -cpu/mpc85xx/cpu.o (.text) > -cpu/mpc85xx/speed.o (.text) > -lib_generic/crc32.o (.text) > -lib_ppc/extable.o (.text) > -lib_generic/zlib.o (.text) > *(.text) > *(.fixup) > *(.got1) > - } > + } :text > _etext = .; > PROVIDE (etext = .); > .rodata: >{ > *(.eh_frame) > *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) > - } > + } :text > .fini : { *(.fini)} =0 > .ctors : { *(.ctors) } > .dtors : { *(.dtors) } > @@ -129,6 +116,18 @@ > . = ALIGN(256); > __init_end = .; > > + .bootpg ADDR(.text) + 0x7f000 : > + { > +cpu/mpc85xx/start.o (.bootpg) > + } :text = 0x > + > + .resetvec ADDR(.text) + 0x7fffc : > + { > +*(.resetvec) > + } :text = 0x > + > + . = ADDR(.text) + 0x8; > + > __bss_start = .; > .bss (NOLOAD) : > { > @@ -136,8 +135,9 @@ >*(.dynbss) >*(.bss) >*(COMMON) > + } :bss > + >. = ALIGN(4); > - } > _end = . ; > PROVIDE (end = .); > } > > > ??? > > Also, you're compressing a lot of different Copyrights into a single > "Copyright 2007-2009 Freescale Semiconductor, Inc.". Not sure how to handle this. I used the mpc8572 or mpc8536ds u- boot.lds as the common one and maintained its copyright. The other files are just removed. If you have a better suggestion let me know. - k ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] 85xx: Move to a common linker script
Dear Kumar Gala, In message <1249997451-21265-1-git-send-email-ga...@kernel.crashing.org> you wrote: > There are really no differences between all the 85xx linker scripts so > we can just move to a single common one. Board code is still able to > override the common one if need be. Are you sure there are no differences? --- board/atum8548/u-boot.lds 2009-07-28 20:27:27.549470982 +0200 +++ board/freescale/mpc8536ds/u-boot.lds2009-07-28 20:27:27.678455216 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2007 Freescale Semiconductor, Inc. + * Copyright 2008 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -23,18 +23,14 @@ OUTPUT_ARCH(powerpc) /* Do we need any of these for elf? __DYNAMIC = 0;*/ -SECTIONS -{ - .resetvec 0xFFFC : +PHDRS { -*(.resetvec) - } = 0x + text PT_LOAD; + bss PT_LOAD; +} - .bootpg 0xF000 : +SECTIONS { -cpu/mpc85xx/start.o(.bootpg) - } = 0x - /* Read-only sections, merged into text segment: */ . = + SIZEOF_HEADERS; .interp : { *(.interp) } @@ -61,26 +57,17 @@ .plt : { *(.plt) } .text : { -cpu/mpc85xx/start.o(.text) -cpu/mpc85xx/traps.o (.text) -cpu/mpc85xx/interrupts.o (.text) -cpu/mpc85xx/cpu_init.o (.text) -cpu/mpc85xx/cpu.o (.text) -cpu/mpc85xx/speed.o (.text) -lib_generic/crc32.o (.text) -lib_ppc/extable.o (.text) -lib_generic/zlib.o (.text) *(.text) *(.fixup) *(.got1) - } + } :text _etext = .; PROVIDE (etext = .); .rodata: { *(.eh_frame) *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) - } + } :text .fini : { *(.fini)} =0 .ctors : { *(.ctors) } .dtors : { *(.dtors) } @@ -129,6 +116,18 @@ . = ALIGN(256); __init_end = .; + .bootpg ADDR(.text) + 0x7f000 : + { +cpu/mpc85xx/start.o(.bootpg) + } :text = 0x + + .resetvec ADDR(.text) + 0x7fffc : + { +*(.resetvec) + } :text = 0x + + . = ADDR(.text) + 0x8; + __bss_start = .; .bss (NOLOAD) : { @@ -136,8 +135,9 @@ *(.dynbss) *(.bss) *(COMMON) + } :bss + . = ALIGN(4); - } _end = . ; PROVIDE (end = .); } ??? Also, you're compressing a lot of different Copyrights into a single "Copyright 2007-2009 Freescale Semiconductor, Inc.". Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Our business is run on trust. We trust you will pay in advance. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot