From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 4 Feb 2009 22:17:22 +0100 Subject: [U-Boot] [PATCH V2] at91: allow the lowlevel_init to be overwrite by the board In-Reply-To: <1233510496-26329-1-git-send-email-plagnioj@jcrosoft.com> References: <1233510496-26329-1-git-send-email-plagnioj@jcrosoft.com> Message-ID: <1233782242-3760-1-git-send-email-plagnioj@jcrosoft.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de due to asm weak function link overwrite problem use pre-built object instead of library. You will need to build the lib$(BOARD).a the same way Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- The asm weak overwrite link problem have been found also present on other arm And supposed on other arch the the AR do not use the $(ARFLAGS) because in this case we will have no file as param to generate the library Best Regards, J. 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