[En-Nut-Discussion] Unable to link application

Lloyd Bailey lbailey at pharmanord.com
Mon May 29 16:45:30 CEST 2006


Hi All,

I have been trying to port my application from Ethernut2 to Ethernut3 
but I am unable to link the
application with the Nut O/S

$ make
arm-elf-gcc start_rom.o door.o -mcpu=arm7tdmi -Wl, 
../../../nutbld/lib/nutinit.o
 -Wl,-nostartfiles -Tat91_rom.ld 
-Wl,-Map=door.map,--cref,--no-warn-mismatch -L.
./../../nutbld/lib/ -lnutpro -lnutos -lnutarch -lnutdev -lnutnet -lnutfs 
-lnutcr
t -lnutc   -o door.elf
start_rom.o: In function `_start':start_rom.S:(.init0+0x44): multiple 
definition
 of `_start'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.0/../../../../arm-elf/lib/crt0.o:c:/winarms
/newlib-1.14.0/libgloss/arm/crt0.S:67: first defined here
start_rom.o: In function `End':start_rom.S:(.init5+0x10): undefined 
reference to
 `main'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.0/crtbegin.o:(.fini+0x0): 
relocation trunca
ted to fit: R_ARM_PC24 against `.text'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.0/crtbegin.o:(.init+0x0): 
relocation trunca
ted to fit: R_ARM_PC24 against `.text'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.0/../../../../arm-elf/lib/crt0.o: 
In functi
on `start':c:/winarms/newlib-1.14.0/libgloss/arm/crt0.S:(.text+0xe0): 
undefined
reference to `main'
:c:/winarms/newlib-1.14.0/libgloss/arm/crt0.S:(.text+0xf8): undefined 
reference
to `__bss_start__'
:c:/winarms/newlib-1.14.0/libgloss/arm/crt0.S:(.text+0xfc): undefined 
reference
to `__bss_end__'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.0/../../../../arm-elf/lib\libc.a(exit.o): 
I
n function `exit':exit.c:(.text+0x28): undefined reference to `_exit'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.0/../../../../arm-elf/lib\libc.a(init.o): 
I
n function `__libc_fini_array':init.c:(.text+0x3c): relocation truncated 
to fit:
 R_ARM_PC24 against symbol `_fini' defined in .fini section in 
c:/winarm/bin/../
lib/gcc/arm-elf/4.1.0/crti.o
c:/winarm/bin/../lib/gcc/arm-elf/4.1.0/../../../../arm-elf/lib\libc.a(init.o): 
I
n function `__libc_init_array':init.c:(.text+0x80): relocation truncated 
to fit:
 R_ARM_PC24 against symbol `_init' defined in .init section in 
c:/winarm/bin/../
lib/gcc/arm-elf/4.1.0/crti.o
c:/winarm/bin/../lib/gcc/arm-elf/4.1.0/crtend.o:(.init+0x0): relocation 
truncate
d to fit: R_ARM_PC24 against `.text'
collect2: ld returned 1 exit status
make: *** [door.elf] Error 1

--------makefile-------------

PROJ = door

top_srcdir = ..

*include* Makedefs

SRCS =  $(PROJ).c
LIBS =  -lnutpro -lnutos -lnutarch -lnutdev -lnutnet -lnutfs -lnutcrt -lnutc 

#OBJS  = $(SRCS:.c=.o)
OBJS  = start_rom.o $(SRCS:.c=.o)
TARG  = $(PROJ).hex
BTARG = $(PROJ).bin

all: $(OBJS) $(TARG) $(BTARG)

*include* Makerules

clean:
	-rm -f $(OBJS)
	-rm -f $(TARG)
	-rm -f $(PROJ).obj
	-rm -f $(PROJ).sym
	-rm -f $(PROJ).map
	-rm -f $(SRCS:.c=.lst)
	-rm -f $(SRCS:.c=.bak)


--------makedefs-------------

DEFS += -DEE_CONFNET=64
DEFS += -DEE_CONFBOOT=128
DEFS += -DETHERNUT3
#DEFS += -DNUTDEBUG

ENTRY = 0x1F000

INCDIR = ../../../lloyd/include/
LIBDIR = ../../../nutbld/lib/

TRGT = arm-elf-
CC     = $(TRGT)gcc
AR     = $(TRGT)ar
CP     = cp
AS     = $(TRGT)gcc -x assembler-with-cpp

BIN    = $(TRGT)objcopy

MCU=arm7tdmi
LDSCRIPT=at91_rom.ld
BURN=C:\proj\work\jtagomat\Release\jtagomat
BURNMEMORY=FLASH
BURNFLAGS=-DDEVICE=0x1F0F0F0F -DIMAGE=./$(BTARG) BATCH at91-upl.jom $(BURNMEMORY)

MCFLAGS   = -mcpu=$(MCU)
CPFLAGS = $(MCFLAGS) -Os -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes -Wa,-ahlms=$(<F:.c=.lst) $(DEFS)
ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(<F:.S=.lst) $(DEFS)
LDFLAGS   = $(MCFLAGS) -Wl, ../../../nutbld/lib/nutinit.o -Wl,-nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(PROJ).map,--cref,--no-warn-mismatch -L$(LIBDIR)
#LDFLAGS = $(MCFLAGS) -Wl, ../../../nutbld/lib/nutinit.o -Wl,-T$(LDSCRIPT),-Map=$(PROJ).map,--relax,--sort-common,--strip-all,--cref -L$(LIBDIR)
#LDFLAGS   = $(MCFLAGS) -Wl, ../../../nutbld/lib/nutinit.o -Wl,-Map=$(PROJ).map,--cref,--defsym,__stack=0x10FF -nostartfiles -nodefaultlibs -Ttext=$(ENTRY)

ELFCOF    = $(BIN) --debugging \
	--change-section-address .data-0x800000 \
	--change-section-address .bss-0x800000 \
	--change-section-address .noinit-0x800000 \
	--change-section-address .eeprom-0x810000


-- 
IT-afdelingen
Pharma Nord
Sadelmagervej 30-32
7100 Vejle
Denmark
Tel:. +45 75 85 74 00





More information about the En-Nut-Discussion mailing list