EmbDev.net

Forum: ARM programming with GCC/GNU tools Yagarto: _start redefined and Interworking problem


von Dan C. (julia989)


Rate this post
useful
not useful
Hi All,

I was going through the article by Miro Samek, "Building Bare-Metal ARM
Systems with GNU" at www.embedded.com. The link to the article is below

http://www.embedded.com/design/opensource/200000632?_requestid=34242

I had downloaded his example c_blinky.zip and wanted to try compiling it
after setting up GNU ARM toolchain on windows PC.

The link to the example is
ftp://ftp.embedded.com/pub/2007/06Samek/c_blinky.zip

These are the steps I had followed

1. Download and install YAGARTO tool chain to D:\yagarto
2. Update the windows path with D:\yagarto\bin
3. Uncompress the example c_blinky.zip
4. Modify the Makefile provided with the example c_blinky to select
YAGARTO tool chain compiler, assembler and enabled verbose option. Below
is the modified makefile

=====================================================
######################################################################## 
######
# Product: BLINKY/C example application
# Date of the Last Update:  Jun 14, 2007
#
#                    Q u a n t u m     L e a P s
#                    ---------------------------
#                    innovating embedded systems
#
# Copyright (C) 2002-2007 Quantum Leaps, LLC. All rights reserved.
#
# Contact information:
# Quantum Leaps Web site:  http://www.quantum-leaps.com
# e-mail:                  info@quantum-leaps.com
######################################################################## 
######
# general utilities
RM = rm -f

# GNU-ARM tools directory
GNU_ARM = D:/yagarto

# The gcc compiler and linker
CC      = $(GNU_ARM)/bin/arm-elf-gcc
ASM     = $(GNU_ARM)/bin/arm-elf-as
LINK    = $(GNU_ARM)/bin/arm-elf-gcc
OBJCOPY = $(GNU_ARM)/bin/arm-elf-objcopy

BLDDIR  = .

CCINC   = -I$(BLDDIR)

APP_DEP = $(BLDDIR)/bsp.h \
  $(BLDDIR)/arm_exc.h \
  $(BLDDIR)/isr.h

APP_NAME = blinky
ARM_CPU  = arm7tdmi


# dbg (default target)
.......................................................

BINDIR   = dbg

# gcc options for ARM and THUMB
# -c    : compile only
# -g    : source level debugging
CCFLAGS = -gdwarf-2 -c -mcpu=$(ARM_CPU) -mthumb-interwork -O \
  -mlong-calls -ffunction-sections -Wall -o$@ -v

ASMFLAGS = -gdwarf2 -mcpu=$(ARM_CPU) -mthumb-interwork -o$@ -v

LINKFLAGS = -T ./$(APP_NAME).ld -o $(BINDIR)/$(APP_NAME).elf \
  -Wl,-Map,$(BINDIR)/$(APP_NAME).map,--cref -lm


# release
....................................................................
ifeq ($(MAKECMDGOALS), rel)

BINDIR   = rel

# gcc options for ARM and THUMB
# -c    : compile only
# -g    : source level debugging
CCFLAGS = -c -mcpu=$(ARM_CPU) -mthumb-interwork -O2 \
  -mlong-calls -ffunction-sections -Wall -DNDBEBUG -o$@

ASMFLAGS = -gdwarf2 -mcpu=$(ARM_CPU) -mthumb-interwork -o$@

LINKFLAGS = -T ./$(APP_NAME).ld -o $(BINDIR)/$(APP_NAME).elf \
  -Wl,-Map,$(BINDIR)/$(APP_NAME).map,--cref -lm

endif
ifeq ($(MAKECMDGOALS), rel_clean)

BINDIR   = rel

endif

#....................................................................... 
......

all: $(BINDIR)/$(APP_NAME).bin

$(BINDIR)/$(APP_NAME).bin : $(BINDIR)/$(APP_NAME).elf
  $(OBJCOPY) -O binary $(BINDIR)/$(APP_NAME).elf
$(BINDIR)/$(APP_NAME).bin

$(BINDIR)/$(APP_NAME).elf : \
  ./$(APP_NAME).ld \
  $(BINDIR)/startup.o \
  $(BINDIR)/arm_exc.o \
  $(BINDIR)/low_level_init.o \
  $(BINDIR)/bsp.o \
  $(BINDIR)/isr.o \
  $(BINDIR)/blinky.o
  $(LINK) \
  $(BINDIR)/startup.o \
  $(BINDIR)/arm_exc.o \
  $(BINDIR)/low_level_init.o \
  $(BINDIR)/bsp.o \
  $(BINDIR)/isr.o \
  $(BINDIR)/blinky.o \
  $(LINKFLAGS)


$(BINDIR)/startup.o: $(BLDDIR)/startup.s
  $(ASM) $(ASMFLAGS) $<

$(BINDIR)/arm_exc.o: $(BLDDIR)/arm_exc.s
  $(ASM) $(ASMFLAGS) $<

$(BINDIR)/low_level_init.o: $(BLDDIR)/low_level_init.c $(APP_DEP)
  $(CC) -marm $(CCFLAGS) $(CCINC) $<

$(BINDIR)/bsp.o: $(BLDDIR)/bsp.c $(APP_DEP)
  $(CC) -mthumb $(CCFLAGS) $(CCINC) $<

$(BINDIR)/isr.o: $(BLDDIR)/isr.c $(APP_DEP)
  $(CC) -marm $(CCFLAGS) $(CCINC) $<

$(BINDIR)/blinky.o: $(BLDDIR)/blinky.c $(APP_DEP)
  $(CC) -mthumb $(CCFLAGS) $(CCINC) $<


dbg: all

rel: all


# clean targets...

.PHONY: clean rel_clean

rel_clean: clean

dbg_clean: clean

clean:
  -$(RM) $(BINDIR)/*.o
  -$(RM) $(BINDIR)/*.elf
  -$(RM) $(BINDIR)/*.map
==================================================

5. I used cygwin installed Make version 3.8.1 to run the makefile

The following are the errors I got
********************************************************************
D:/yagarto/bin/arm-elf-as -gdwarf2 -mcpu=arm7tdmi -mthumb-interwork
-odbg/startup.o -v startup.s
GNU assembler version 2.18 (arm-elf) using BFD version (GNU Binutils)
2.18
D:/yagarto/bin/arm-elf-as -gdwarf2 -mcpu=arm7tdmi -mthumb-interwork
-odbg/arm_exc.o -v arm_exc.s
GNU assembler version 2.18 (arm-elf) using BFD version (GNU Binutils)
2.18
D:/yagarto/bin/arm-elf-gcc -marm -gdwarf-2 -c -mcpu=arm7tdmi
-mthumb-interwork -O -mlong-calls -ffunction-sections -Wall -odbg/low
_level_init.o -v -I. low_level_init.c
Using built-in specs.
Target: arm-elf
Configured with: ../gcc-4.2.2/configure --target=arm-elf
--prefix=/home/yagarto/install --disable-nls --disable-shared
--disable-t
hreads --with-gcc --with-gnu-ld --with-gnu-as --with-dwarf2
--enable-languages=c,c++ --enable-interwork --enable-multilib --with-n
ewlib --with-headers=../newlib-1.16.0/newlib/libc/include
--disable-libssp --disable-libstdcxx-pch --disable-libmudflap --disable-
libgomp -v
Thread model: single
gcc version 4.2.2
 d:/yagarto/bin/../libexec/gcc/arm-elf/4.2.2/cc1.exe -quiet -v -I.
-imultilib interwork -iprefix d:\yagarto\bin\../lib/gcc/arm-elf
/4.2.2/ -D__USES_INITFINI__ low_level_init.c -quiet -dumpbase
low_level_init.c -marm -mcpu=arm7tdmi -mthumb-interwork -mlong-calls
 -auxbase-strip dbg/low_level_init.o -gdwarf-2 -O -Wall -version
-ffunction-sections -o C:\DOCUME~1\SAMAVA~1\LOCALS~1\Temp/ccrrtja
F.s
#include "..." search starts here:
#include <...> search starts here:
 .
 d:\yagarto\bin\../lib/gcc/arm-elf/4.2.2/include
 d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/include
 d:/yagarto/bin/../arm-elf/sys-include
 d:/yagarto/bin/../arm-elf/include
End of search list.
GNU C version 4.2.2 (arm-elf)
        compiled by GNU C version 3.4.5 (mingw special).
GGC heuristics: --param ggc-min-expand=100 --param
ggc-min-heapsize=131072
Compiler executable checksum: 17d82494ce6037e4c50af8ea602988cc
 d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/as.exe
-mcpu=arm7tdmi -mthumb-interwork -odbg/low_level_init.o C:
\DOCUME~1\SAMAVA~1\LOCALS~1\Temp/ccrrtjaF.s
D:/yagarto/bin/arm-elf-gcc -mthumb -gdwarf-2 -c -mcpu=arm7tdmi
-mthumb-interwork -O -mlong-calls -ffunction-sections -Wall -odbg/b
sp.o -v -I. bsp.c
Using built-in specs.
Target: arm-elf
Configured with: ../gcc-4.2.2/configure --target=arm-elf
--prefix=/home/yagarto/install --disable-nls --disable-shared
--disable-t
hreads --with-gcc --with-gnu-ld --with-gnu-as --with-dwarf2
--enable-languages=c,c++ --enable-interwork --enable-multilib --with-n
ewlib --with-headers=../newlib-1.16.0/newlib/libc/include
--disable-libssp --disable-libstdcxx-pch --disable-libmudflap --disable-
libgomp -v
Thread model: single
gcc version 4.2.2
 d:/yagarto/bin/../libexec/gcc/arm-elf/4.2.2/cc1.exe -quiet -v -I.
-imultilib thumb/interwork -iprefix d:\yagarto\bin\../lib/gcc/a
rm-elf/4.2.2/ -D__USES_INITFINI__ bsp.c -quiet -dumpbase bsp.c -mthumb
-mcpu=arm7tdmi -mthumb-interwork -mlong-calls -auxbase-stri
p dbg/bsp.o -gdwarf-2 -O -Wall -version -ffunction-sections -o
C:\DOCUME~1\SAMAVA~1\LOCALS~1\Temp/ccHzN4ER.s
#include "..." search starts here:
#include <...> search starts here:
 .
 d:\yagarto\bin\../lib/gcc/arm-elf/4.2.2/include
 d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/include
 d:/yagarto/bin/../arm-elf/sys-include
 d:/yagarto/bin/../arm-elf/include
End of search list.
GNU C version 4.2.2 (arm-elf)
        compiled by GNU C version 3.4.5 (mingw special).
GGC heuristics: --param ggc-min-expand=100 --param
ggc-min-heapsize=131072
Compiler executable checksum: 17d82494ce6037e4c50af8ea602988cc
 d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/as.exe
-mcpu=arm7tdmi -mthumb-interwork -odbg/bsp.o C:\DOCUME~1\S
AMAVA~1\LOCALS~1\Temp/ccHzN4ER.s
D:/yagarto/bin/arm-elf-gcc -marm -gdwarf-2 -c -mcpu=arm7tdmi
-mthumb-interwork -O -mlong-calls -ffunction-sections -Wall -odbg/isr
.o -v -I. isr.c
Using built-in specs.
Target: arm-elf
Configured with: ../gcc-4.2.2/configure --target=arm-elf
--prefix=/home/yagarto/install --disable-nls --disable-shared
--disable-t
hreads --with-gcc --with-gnu-ld --with-gnu-as --with-dwarf2
--enable-languages=c,c++ --enable-interwork --enable-multilib --with-n
ewlib --with-headers=../newlib-1.16.0/newlib/libc/include
--disable-libssp --disable-libstdcxx-pch --disable-libmudflap --disable-
libgomp -v
Thread model: single
gcc version 4.2.2
 d:/yagarto/bin/../libexec/gcc/arm-elf/4.2.2/cc1.exe -quiet -v -I.
-imultilib interwork -iprefix d:\yagarto\bin\../lib/gcc/arm-elf
/4.2.2/ -D__USES_INITFINI__ isr.c -quiet -dumpbase isr.c -marm
-mcpu=arm7tdmi -mthumb-interwork -mlong-calls -auxbase-strip dbg/is
r.o -gdwarf-2 -O -Wall -version -ffunction-sections -o
C:\DOCUME~1\SAMAVA~1\LOCALS~1\Temp/ccznrYw1.s
#include "..." search starts here:
#include <...> search starts here:
 .
 d:\yagarto\bin\../lib/gcc/arm-elf/4.2.2/include
 d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/include
 d:/yagarto/bin/../arm-elf/sys-include
 d:/yagarto/bin/../arm-elf/include
End of search list.
GNU C version 4.2.2 (arm-elf)
        compiled by GNU C version 3.4.5 (mingw special).
GGC heuristics: --param ggc-min-expand=100 --param
ggc-min-heapsize=131072
Compiler executable checksum: 17d82494ce6037e4c50af8ea602988cc
 d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/as.exe
-mcpu=arm7tdmi -mthumb-interwork -odbg/isr.o C:\DOCUME~1\S
AMAVA~1\LOCALS~1\Temp/ccznrYw1.s
D:/yagarto/bin/arm-elf-gcc -mthumb -gdwarf-2 -c -mcpu=arm7tdmi
-mthumb-interwork -O -mlong-calls -ffunction-sections -Wall -odbg/b
linky.o -v -I. blinky.c
Using built-in specs.
Target: arm-elf
Configured with: ../gcc-4.2.2/configure --target=arm-elf
--prefix=/home/yagarto/install --disable-nls --disable-shared
--disable-t
hreads --with-gcc --with-gnu-ld --with-gnu-as --with-dwarf2
--enable-languages=c,c++ --enable-interwork --enable-multilib --with-n
ewlib --with-headers=../newlib-1.16.0/newlib/libc/include
--disable-libssp --disable-libstdcxx-pch --disable-libmudflap --disable-
libgomp -v
Thread model: single
gcc version 4.2.2
 d:/yagarto/bin/../libexec/gcc/arm-elf/4.2.2/cc1.exe -quiet -v -I.
-imultilib thumb/interwork -iprefix d:\yagarto\bin\../lib/gcc/a
rm-elf/4.2.2/ -D__USES_INITFINI__ blinky.c -quiet -dumpbase blinky.c
-mthumb -mcpu=arm7tdmi -mthumb-interwork -mlong-calls -auxbas
e-strip dbg/blinky.o -gdwarf-2 -O -Wall -version -ffunction-sections -o
C:\DOCUME~1\SAMAVA~1\LOCALS~1\Temp/ccv1Cul9.s
#include "..." search starts here:
#include <...> search starts here:
 .
 d:\yagarto\bin\../lib/gcc/arm-elf/4.2.2/include
 d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/include
 d:/yagarto/bin/../arm-elf/sys-include
 d:/yagarto/bin/../arm-elf/include
End of search list.
GNU C version 4.2.2 (arm-elf)
        compiled by GNU C version 3.4.5 (mingw special).
GGC heuristics: --param ggc-min-expand=100 --param
ggc-min-heapsize=131072
Compiler executable checksum: 17d82494ce6037e4c50af8ea602988cc
 d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/as.exe
-mcpu=arm7tdmi -mthumb-interwork -odbg/blinky.o C:\DOCUME~
1\SAMAVA~1\LOCALS~1\Temp/ccv1Cul9.s
D:/yagarto/bin/arm-elf-gcc \
        dbg/startup.o \
        dbg/arm_exc.o \
        dbg/low_level_init.o \
        dbg/bsp.o \
        dbg/isr.o \
        dbg/blinky.o \
        -T ./blinky.ld -o dbg/blinky.elf -Wl,-Map,dbg/blinky.map,--cref
-lm
dbg/startup.o: In function `_start':
C:\Downloads\c_blinky\c_blinky/startup.s:47: multiple definition of
`_start'
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/lib/crt0.o:( 
.text+0x0):
first defined here
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-atexit.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-exit.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-impure.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-init.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-memset.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-syscalls.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-__atexit.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-__call_atexit.o) does not support
interworking, whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-errno.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-findfp.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-fwalk.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-malloc.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-mallocr.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-mlock.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-sbrkr.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-stdio.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-strlen.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-writer.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-closer.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-fclose.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-fflush.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-freer.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-lseekr.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-readr.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../
../arm-elf/lib\libc.a(lib_a-reent.o) does not support interworking,
whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/crtend.o
does not support interworking, whereas dbg/blinky.elf does
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
Warning: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/crtn.o do
es not support interworking, whereas dbg/blinky.elf does
collect2: ld returned 1 exit status
make: *** [dbg/blinky.elf] Error 1
********************************************************************

I am not able to understand how to solve these errors and warnings.
Please kindly help in solving the compilation problem.

Thanks,
Dan

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Try to add -mthumb-interwork to the linker-options. For the _start
problem I'd have to look into the code. Did you search all files for
"_start", where can you find it?

von Dan C. (julia989)


Rate this post
useful
not useful
Martin Thomas wrote:
> Try to add -mthumb-interwork to the linker-options. For the _start
> problem I'd have to look into the code. Did you search all files for
> "_start", where can you find it?

Hi Martin,

Thanks for the sugesstion, will try it out and let you know the result.
The _start is in startup.s.

Thanks,
Dan

von Dan C. (julia989)


Rate this post
useful
not useful
Dan Clo wrote:
> Martin Thomas wrote:
>> Try to add -mthumb-interwork to the linker-options. For the _start
>> problem I'd have to look into the code. Did you search all files for
>> "_start", where can you find it?
>
> Hi Martin,
>
> Thanks for the sugesstion, will try it out and let you know the result.
> The _start is in startup.s.
>
> Thanks,
> Dan

Hi Martin,

Thanks alot. Adding -mthumb-interwork to the linker-options did work.
But I am still trying to figure out how to solve the _start problem.
This is the output

======================================================================
D:/yagarto/bin/arm-elf-as -gdwarf2 -mcpu=arm7tdmi -mthumb-interwork
-odbg/startup.o startup.s
D:/yagarto/bin/arm-elf-as -gdwarf2 -mcpu=arm7tdmi -mthumb-interwork
-odbg/arm_exc.o arm_exc.s
D:/yagarto/bin/arm-elf-gcc -marm -gdwarf-2 -c -mcpu=arm7tdmi
-mthumb-interwork -O -mlong-calls -ffunction-sections -Wall -odbg/low
_level_init.o -I. low_level_init.c
D:/yagarto/bin/arm-elf-gcc -mthumb -gdwarf-2 -c -mcpu=arm7tdmi
-mthumb-interwork -O -mlong-calls -ffunction-sections -Wall -odbg/b
sp.o -I. bsp.c
D:/yagarto/bin/arm-elf-gcc -marm -gdwarf-2 -c -mcpu=arm7tdmi
-mthumb-interwork -O -mlong-calls -ffunction-sections -Wall -odbg/isr
.o -I. isr.c
D:/yagarto/bin/arm-elf-gcc -mthumb -gdwarf-2 -c -mcpu=arm7tdmi
-mthumb-interwork -O -mlong-calls -ffunction-sections -Wall -odbg/b
linky.o -I. blinky.c
D:/yagarto/bin/arm-elf-gcc \
        dbg/startup.o \
        dbg/arm_exc.o \
        dbg/low_level_init.o \
        dbg/bsp.o \
        dbg/isr.o \
        dbg/blinky.o \
        -T ./blinky.ld -o dbg/blinky.elf -Wl,-Map,dbg/blinky.map,--cref
-lm -mthumb-interwork
dbg/startup.o: In function `_start':
C:\Downloads\c_blinky\c_blinky/startup.s:47: multiple definition of
`_start'
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/lib/interwor 
k/crt0.o:(.text+0x0):
first defined here
collect2: ld returned 1 exit status
make: *** [dbg/blinky.elf] Error 1
=======================================================================

Thanks,
Dan

von Michael F. (mifi)


Rate this post
useful
not useful
Hello Dan,

only an idea, try to use:

-nostartfiles

for the link flags too.

Best regards,

Michael

von Dan C. (julia989)


Rate this post
useful
not useful
Michael Fischer wrote:
> Hello Dan,
>
> only an idea, try to use:
>
> -nostartfiles
>
> for the link flags too.
>
> Best regards,
>
> Michael

Hi Michael,

Thanks for trying to help. I tried applying your suggestion but didnt
work, I got a few more errors. The result is below.

======================================================================== 
====
D:/yagarto/bin/arm-elf-as -gdwarf2 -mcpu=arm926ej-s -mthumb-interwork
-odbg/startup.o startup.s
D:/yagarto/bin/arm-elf-as -gdwarf2 -mcpu=arm926ej-s -mthumb-interwork
-odbg/arm_exc.o arm_exc.s
D:/yagarto/bin/arm-elf-gcc -marm -gdwarf-2 -c -mcpu=arm926ej-s
-mthumb-interwork  -O -mlong-calls -ffunction-sections -Wall -odbg/
low_level_init.o  -I. low_level_init.c
D:/yagarto/bin/arm-elf-gcc -mthumb -gdwarf-2 -c -mcpu=arm926ej-s
-mthumb-interwork  -O -mlong-calls -ffunction-sections -Wall -odb
g/bsp.o  -I. bsp.c
D:/yagarto/bin/arm-elf-gcc -marm -gdwarf-2 -c -mcpu=arm926ej-s
-mthumb-interwork  -O -mlong-calls -ffunction-sections -Wall -odbg/
isr.o  -I. isr.c
D:/yagarto/bin/arm-elf-gcc -mthumb -gdwarf-2 -c -mcpu=arm926ej-s
-mthumb-interwork  -O -mlong-calls -ffunction-sections -Wall -odb
g/blinky.o  -I. blinky.c
D:/yagarto/bin/arm-elf-gcc \
        dbg/startup.o \
        dbg/arm_exc.o \
        dbg/low_level_init.o \
        dbg/bsp.o \
        dbg/isr.o \
        dbg/blinky.o \
        -T ./blinky.ld -o dbg/blinky.elf -Wl,-Map,dbg/blinky.map,--cref
-lm -mthumb-interwork  -nostartfiles
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
ERROR: d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../..
/arm-elf/lib/interwork\libc.a(lib_a-init.o) uses FPA instructions,
whereas dbg/blinky.elf does not
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe:
failed to merge target specific data of file d:/yagarto/bi
n/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/lib/interwork\libc.a(lib_ 
a-init.o)
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/lib/interwor 
k\libc.a(lib_a-init.o):
In function `__libc_fini_array':
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\interwork\newlib\libc\misc 
/../../../../../../newlib-1.16.0/newlib/libc/misc/init.c:5
8: undefined reference to `_fini'
d:/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/lib/interwor 
k\libc.a(lib_a-init.o):
In function `__libc_init_array':
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\interwork\newlib\libc\misc 
/../../../../../../newlib-1.16.0/newlib/libc/misc/init.c:4
0: undefined reference to `_init'
collect2: ld returned 1 exit status
make: *** [dbg/blinky.elf] Error 1
======================================================================== 
=======


Thanks again,
Sam

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Please read the embedded.com article series about "bare-metal" esp. the
linker-script explanations.

If you expect help from me: please try to use one of my makefiles form
one of the newer examples on my web-pages. Even if they look a little
complicated at first but I have tested them and the options to the tools
should work.

von Dan C. (julia989)


Rate this post
useful
not useful
Martin Thomas wrote:
> Please read the embedded.com article series about "bare-metal" esp. the
> linker-script explanations.
>
> If you expect help from me: please try to use one of my makefiles form
> one of the newer examples on my web-pages. Even if they look a little
> complicated at first but I have tested them and the options to the tools
> should work.

Hi Martin,

Thanks for your help. Will try out with your makefiles.

Regards,
Dan

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.