]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
512x: Cleanup for partial linking and --gc-sections
authorWolfgang Denk <wd@denx.de>
Mon, 22 Nov 2010 22:36:42 +0000 (23:36 +0100)
committerWolfgang Denk <wd@denx.de>
Sat, 27 Nov 2010 22:35:11 +0000 (23:35 +0100)
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Timur Tabi <timur@freescale.com>
Acked-by: Stefan Roese <sr@denx.de>
Makefile
arch/powerpc/cpu/mpc512x/Makefile
arch/powerpc/cpu/mpc512x/u-boot.lds
board/freescale/common/Makefile

index b4aae898abd4234574a3c281c26b773bb9ba2945..28028dca8982750d87fa62e2c0878677cafa3585 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -185,6 +185,9 @@ LIBS += lib/lzma/liblzma.o
 LIBS += lib/lzo/liblzo.o
 LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
        "board/$(VENDOR)/common/lib$(VENDOR).o"; fi)
 LIBS += lib/lzo/liblzo.o
 LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
        "board/$(VENDOR)/common/lib$(VENDOR).o"; fi)
+ifdef CONFIG_FSL_DIU_FB
+LIBS += board/freescale/common/libfreescale.o
+endif
 LIBS += $(CPUDIR)/lib$(CPU).o
 ifdef SOC
 LIBS += $(CPUDIR)/$(SOC)/lib$(SOC).o
 LIBS += $(CPUDIR)/lib$(CPU).o
 ifdef SOC
 LIBS += $(CPUDIR)/$(SOC)/lib$(SOC).o
@@ -260,7 +263,7 @@ ifeq ($(SOC),s5pc2xx)
 LIBS += $(CPUDIR)/s5p-common/libs5p-common.o
 endif
 
 LIBS += $(CPUDIR)/s5p-common/libs5p-common.o
 endif
 
-LIBS := $(addprefix $(obj),$(LIBS))
+LIBS := $(addprefix $(obj),$(sort $(LIBS)))
 .PHONY : $(LIBS) $(TIMESTAMP_FILE) $(VERSION_FILE)
 
 LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).o
 .PHONY : $(LIBS) $(TIMESTAMP_FILE) $(VERSION_FILE)
 
 LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).o
index cb1263ab7ca97957dc07ef6d520c07ee83032d6d..4a4bc0d471aaa87f5ee729c61d19463271ca21ad 100644 (file)
@@ -37,7 +37,6 @@ COBJS-y += iopin.o
 COBJS-y += serial.o
 COBJS-y += speed.o
 COBJS-$(CONFIG_FSL_DIU_FB) += diu.o
 COBJS-y += serial.o
 COBJS-y += speed.o
 COBJS-$(CONFIG_FSL_DIU_FB) += diu.o
-COBJS-$(CONFIG_FSL_DIU_FB) += ../../../../board/freescale/common/fsl_diu_fb.o
 COBJS-$(CONFIG_CMD_IDE) += ide.o
 COBJS-$(CONFIG_IIM) += iim.o
 COBJS-$(CONFIG_PCI) += pci.o
 COBJS-$(CONFIG_CMD_IDE) += ide.o
 COBJS-$(CONFIG_IIM) += iim.o
 COBJS-$(CONFIG_PCI) += pci.o
index c71679960c1260c30762c5624999ac499868f3cb..361e71489977929eb2bf64832c3e4cc2e4ff1cdb 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * (C) Copyright 2007 DENX Software Engineering.
+ * (C) Copyright 2007-2010 DENX Software Engineering.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
 OUTPUT_ARCH(powerpc)
 SECTIONS
 {
 OUTPUT_ARCH(powerpc)
 SECTIONS
 {
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
   .text      :
   {
   .text      :
   {
-    arch/powerpc/cpu/mpc512x/start.o   (.text)
-    *(.text)
-    *(.got1)
+    arch/powerpc/cpu/mpc512x/start.o   (.text*)
+    *(.text*)
     . = ALIGN(16);
     . = ALIGN(16);
-    *(.eh_frame)
     *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
   }
     *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
   }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
 
   /* Read-write section, merged into data segment: */
   . = (. + 0x0FFF) & 0xFFFFF000;
 
   /* Read-write section, merged into data segment: */
   . = (. + 0x0FFF) & 0xFFFFF000;
@@ -66,10 +37,11 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
   PROVIDE (erotext = .);
   .reloc   :
   {
-    *(.got)
+    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     _GOT2_TABLE_ = .;
-    *(.got2)
+    KEEP(*(.got2))
     _FIXUP_TABLE_ = .;
     _FIXUP_TABLE_ = .;
+    KEEP(*(.fixup))
     *(.fixup)
   }
   __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
     *(.fixup)
   }
   __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
@@ -77,12 +49,8 @@ SECTIONS
 
   .data    :
   {
 
   .data    :
   {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
+    *(.data*)
+    *(.sdata*)
   }
   _edata  =  .;
   PROVIDE (edata = .);
   }
   _edata  =  .;
   PROVIDE (edata = .);
@@ -108,9 +76,8 @@ SECTIONS
   __bss_start = .;
   .bss (NOLOAD)       :
   {
   __bss_start = .;
   .bss (NOLOAD)       :
   {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
+   *(.bss*)
+   *(.sbss*)
    *(COMMON)
    . = ALIGN(4);
   }
    *(COMMON)
    . = ALIGN(4);
   }
index 703a3477a790ccc48d9349b296e8db806fe6654d..905dd7a0ae46f8bc174a2c001ddffccb438045b0 100644 (file)
 include $(TOPDIR)/config.mk
 
 ifneq ($(OBJTREE),$(SRCTREE))
 include $(TOPDIR)/config.mk
 
 ifneq ($(OBJTREE),$(SRCTREE))
-$(shell mkdir -p $(obj)board/$(VENDOR)/common)
+$(shell mkdir -p $(obj)board/freescale/common)
 endif
 
 endif
 
-LIB    = $(obj)lib$(VENDOR).o
+LIB    = $(obj)libfreescale.o
 
 COBJS-$(CONFIG_FSL_CADMUS)     += cadmus.o
 COBJS-$(CONFIG_FSL_VIA)                += cds_via.o
 
 COBJS-$(CONFIG_FSL_CADMUS)     += cadmus.o
 COBJS-$(CONFIG_FSL_VIA)                += cds_via.o