From 29333232d5e1d404b42309166a2d8d0035ad9841 Mon Sep 17 00:00:00 2001 From: maralvira Date: Sun, 7 Nov 2010 14:57:53 +0000 Subject: [PATCH] add section .start and undef _start so that _start is placed by the linker correctly --- cpu/mc1322x/Makefile.mc1322x | 2 +- cpu/mc1322x/src/start.S | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cpu/mc1322x/Makefile.mc1322x b/cpu/mc1322x/Makefile.mc1322x index 67336ea53..b43539020 100644 --- a/cpu/mc1322x/Makefile.mc1322x +++ b/cpu/mc1322x/Makefile.mc1322x @@ -58,7 +58,7 @@ CFLAGSNO = -I. -I$(CONTIKI)/core -I$(CONTIKI_CPU) -I$(CONTIKI_CPU)/loader \ -Werror $(ARCH_FLAGS) -g CFLAGS += $(CFLAGSNO) -Os -DRUN_AS_SYSTEM -DROM_RUN -fno-strict-aliasing -fno-common -ffixed-r8 -msoft-float -DTEXT_BASE=$(TEXT_BASE) -fno-builtin-printf -fno-builtin-sprintf -LDFLAGS += -T $(LINKERSCRIPT) -nostartfiles -static -Wl,-Map=contiki-$(TARGET).map,-export-dynamic +LDFLAGS += -T $(LINKERSCRIPT) -nostartfiles -static -u_start -Wl,-Map=contiki-$(TARGET).map,-export-dynamic AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS) -gstabs CDEPFLAGS = $(CFLAGS) -D __MAKING_DEPS__ diff --git a/cpu/mc1322x/src/start.S b/cpu/mc1322x/src/start.S index cd7053372..a2e44fecc 100644 --- a/cpu/mc1322x/src/start.S +++ b/cpu/mc1322x/src/start.S @@ -30,7 +30,7 @@ * * This file is part of the Contiki OS. * - * $Id: start.S,v 1.2 2010/11/07 14:49:42 maralvira Exp $ + * $Id: start.S,v 1.3 2010/11/07 14:57:53 maralvira Exp $ */ @@ -91,10 +91,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. .code 32 .align 2 - .set _rom_data_init, 0x108d0 - .global _start + .set _rom_data_init, 0x108d0 + .global _start .func _start - + .section .start + _start: b _begin // reset - _start ldr pc,_undf // undefined