[U-Boot] [PATCH 0/7] Address partial linking issues

Wolfgang Denk wd at denx.de
Sun Nov 21 22:03:33 CET 2010


The switch from archive libraries to partial linking has introduced a
number of problems, that are non-trivial to solve.  For example, it is
no longer possible to include individual object files in the linker
script as we did before for example in the case of boards with
embedded environment to fill up the gap caused by the need to align
the environment on flash erase block boundaries.

The best (but unfortunately not easiest) approach to address this
problem is probably to enable -ffunction-sections (and
-ffunction-sections) so we can again (and even in much finer
granularity) place certain code where we want it.  When doing this
step, it seems only consequent to also add --gc-sections which has the
added benefit of reducing the memory footprint of the U-Boot image
(both in flash and in RAM).

Unfortunately, this requires changes to a lot of linker scripts.

The following patch series prepares the groung a bit, then enables
--gc-sections, -ffunction-sections and -ffunction-sections for the
Power Archtiecture, and then starts to make all PowerPC boards build
again, beginning with 4xx.  As it turns out, this process uncovers a
number of (so far undetected) bugs that have creapt in, which I try to
fix as well.


To Stefan Roese:  Stefan, I need your help fixing the kilauea_nand and
haleakala_nand board configurations; currently these fail with a
"undefined reference to `initdram'" error.  It appears that in the
past these included the code from cpu/ppc4xx/denali_spd_ddr2.c, but I
doubt that was correct?


Comments and.or help converting the remaining processors welcome.


Note: these patches are also available in the "gc-sections" branch of
the u-boot-testing repository.

Overview:
=========

[PATCH 1/7] common/Makefile: don't include env_embedded.o into libcommon

 common/Makefile |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

[PATCH 2/7] cpu/ppc4xx/Makefile: build only needed object files

 arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c           |    4 ---
 arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c |    3 --
 arch/powerpc/cpu/ppc4xx/Makefile                 |   25 ++++++++-------------
 3 files changed, 10 insertions(+), 22 deletions(-)

[PATCH 3/7] arch/powerpc/config.mk: make CONFIG_SYS_LDSCRIPT settings work

 arch/powerpc/config.mk            |    7 +++++++
 arch/powerpc/cpu/ppc4xx/config.mk |    6 +++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

[PATCH 4/7] PPChameleonEVB and CATcenter need a custom linker script

 board/dave/PPChameleonEVB/u-boot.lds |  128 ++++++++++++++++++++++++++++++++++
 include/configs/CATcenter.h          |    1 +
 include/configs/PPChameleonEVB.h     |    1 +
 3 files changed, 130 insertions(+), 0 deletions(-)
 create mode 100644 board/dave/PPChameleonEVB/u-boot.lds

[PATCH 5/7] ERIC: drop unsupported board configuration

 CREDITS                |    4 -
 MAINTAINERS            |    2 -
 board/eric/Makefile    |   51 ---
 board/eric/eric.c      |  203 ---------
 board/eric/eric.h      |   44 --
 board/eric/flash.c     | 1131 ------------------------------------------------
 board/eric/init.S      |  359 ---------------
 boards.cfg             |    1 -
 doc/README.scrapyard   |    3 +-
 include/configs/ERIC.h |  369 ----------------
 10 files changed, 2 insertions(+), 2165 deletions(-)
 delete mode 100644 board/eric/Makefile
 delete mode 100644 board/eric/eric.c
 delete mode 100644 board/eric/eric.h
 delete mode 100644 board/eric/flash.c
 delete mode 100644 board/eric/init.S
 delete mode 100644 include/configs/ERIC.h

[PATCH 6/7] POWERPC: enable --gc-sections and -ffunction-sections -fdata-sections

 arch/powerpc/config.mk |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

[PATCH 7/7] 4xx: Cleanup for partial linking and --gc-sections

 arch/powerpc/cpu/ppc4xx/Makefile       |    2 +-
 arch/powerpc/cpu/ppc4xx/u-boot.lds     |   53 +++++--------------------
 board/amcc/bamboo/Makefile             |    6 ++-
 board/amcc/bamboo/u-boot-nand.lds      |   50 +++++------------------
 board/amcc/bluestone/Makefile          |    6 ++-
 board/amcc/canyonlands/Makefile        |    6 ++-
 board/amcc/canyonlands/u-boot-nand.lds |   48 ++++------------------
 board/amcc/sequoia/Makefile            |    6 ++-
 board/amcc/sequoia/u-boot-nand.lds     |   48 ++++------------------
 board/amcc/sequoia/u-boot-ram.lds      |   50 +++++------------------
 board/amirix/ap1000/Makefile           |    4 +-
 board/amirix/ap1000/u-boot.lds         |   67 +++++--------------------------
 board/cray/L1/L1.c                     |    6 ---
 board/esd/dasa_sim/u-boot.lds          |   57 ++++++---------------------
 board/esd/du440/Makefile               |    6 ++-
 board/esd/pmc440/Makefile              |    6 ++-
 board/gdsys/intip/Makefile             |    6 ++-
 board/korat/Makefile                   |    6 ++-
 board/lwmon5/Makefile                  |    6 ++-
 board/ml2/u-boot.lds                   |   69 ++++---------------------------
 board/netstal/hcu5/Makefile            |    4 +-
 board/sbc405/sbc405.c                  |    7 ---
 board/t3corp/Makefile                  |    6 ++-
 include/configs/AP1000.h               |    8 ++++
 include/configs/CANBT.h                |    2 +-
 include/configs/CPCI2DP.h              |    2 +-
 include/configs/DP405.h                |    1 +
 include/configs/ML2.h                  |    9 ++++
 include/configs/sc3.h                  |    2 +-
 29 files changed, 147 insertions(+), 402 deletions(-)


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: wd at denx.de
I used to be indecisive, now I'm not sure.


More information about the U-Boot mailing list