[U-Boot] [PATCH 1/1] at91: use pre-built object to avoid weak function problem

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Sun Feb 1 18:48:16 CET 2009


add weak lowlel_init

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 config.mk                          |    3 +++
 cpu/arm926ejs/at91/Makefile        |    2 +-
 cpu/arm926ejs/at91/lowlevel_init.S |    2 ++
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/config.mk b/config.mk
index b1254e9..94b8c7c 100644
--- a/config.mk
+++ b/config.mk
@@ -76,6 +76,9 @@ STRIP	= $(CROSS_COMPILE)strip
 OBJCOPY = $(CROSS_COMPILE)objcopy
 OBJDUMP = $(CROSS_COMPILE)objdump
 RANLIB	= $(CROSS_COMPILE)RANLIB
+cmd_link_o_target = $(if $(strip $(2)),\
+			$(LD) $(PLATFORM_LDFLAGS) -r -o $(1) $(2) ,\
+			rm -f $@; $(AR) rcs $(1))
 
 #########################################################################
 
diff --git a/cpu/arm926ejs/at91/Makefile b/cpu/arm926ejs/at91/Makefile
index 2d2a888..662657c 100644
--- a/cpu/arm926ejs/at91/Makefile
+++ b/cpu/arm926ejs/at91/Makefile
@@ -36,7 +36,7 @@ OBJS    := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
 all:	$(obj).depend $(LIB)
 
 $(LIB):	$(OBJS)
-	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(call cmd_link_o_target, $@, $(OBJS))
 
 #########################################################################
 
diff --git a/cpu/arm926ejs/at91/lowlevel_init.S b/cpu/arm926ejs/at91/lowlevel_init.S
index ec6ad5d..54b3f3d 100644
--- a/cpu/arm926ejs/at91/lowlevel_init.S
+++ b/cpu/arm926ejs/at91/lowlevel_init.S
@@ -30,6 +30,8 @@
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
 
 .globl lowlevel_init
+.weak lowlevel_init
+.set lowlevel_init,function
 lowlevel_init:
 
 	/*
-- 
1.5.6.5



More information about the U-Boot mailing list