EmbDev.net

Forum: ARM programming with GCC/GNU tools Problems moving to yagarto from gnuarm


von Rui (Guest)


Rate this post
useful
not useful
Hi all.
I'm using GNUARM with gcc 4.0.2.
I installed YAGARTO with gcc 4.4.1 and I was trying to compile my 
project with it.
My project uses a LPC2292.
When I try to compile my project with yagarto I get errors like this:

c:/program 
files/yagarto/bin/../lib/gcc/arm-elf/4.4.1/../../../../arm-elf/bin/ld.ex 
e:  ERROR: c:/program 
files/yagarto/bin/../lib/gcc/arm-elf/4.4.1\libgcc.a(_udivsi3.o) uses 
hardware FP, whereas armit_21.o uses software FP

c:/program 
files/yagarto/bin/../lib/gcc/arm-elf/4.4.1/../../../../arm-elf/bin/ld.ex 
e:  failed to merge target specific data of file c:/program 
files/yagarto/bin/../lib/gcc/arm-elf/4.4.1\libgcc.a(_udivsi3.o)

c:/program 
files/yagarto/bin/../lib/gcc/arm-elf/4.4.1/../../../../arm-elf/bin/ld.ex 
e:  error: no memory region specified for loadable section `.eh_frame'

I try to compile my file with option -mhard-float but the result is the 
same.
I also try the options -mfloat-abi=softfp and -msoft-float but the 
result is the same.
Can anyone help with this?
I'm around this for a couple of days and I'm stuck.
Thanks.
Rui

:
von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
- Use the compiler-frontend (arm-elf-gcc) for linking, do not call the 
linker (arm-elf-ld) directly
- Pass the target specific options to the gcc-call for linking as you 
use for compilation (mcu, thumb, thumb-interwork...)
- Show the complete output of "make all" so all options for compiling 
assembling and linking can be seen.
- Show the linker-script
- Create a minimal example with all needed files (makefile, sources, 
linker-script) to reproduce the problem, pack them into a zip-file and 
attach the zip-file to a forum-message.

von Giovanni D. (gdisirio)


Rate this post
useful
not useful
The .eh_frame section is a known GCC 4.4.x problem: 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40521

You have to discard it by adding something like this to the linker 
script:
1
    /DISCARD/ :
2
    {
3
        *(.eh_*)
4
    }

regards,
Giovanni
---
ChibiOS/RT http://chibios.sourceforge.net

von Rui (Guest)


Rate this post
useful
not useful
Thank you very much Giovani.

Your solution works just fine.
I can compiled without any problems and the program runs in my board as 
I expected.

I had found the .eh_frame section issue already.
But I had implemented the solution found in the yagarto site:
. = ALIGN(4);
.eh_frame :
{
     KEEP (*(.eh_frame))
} > ram

It compiled ok but I couldn't download the program using lpc21isp 
(version 1.64).
I got this error:
«New Extended Linear Address Record [04] out of memory range
Current Memory starts at: 0x00000000, new Address is: 0x40000000»
So I remove this section and went back to the linker problem.

Thank you very much once again.
Regards.
Rui

von Rui (Guest)


Rate this post
useful
not useful
Thank you very much Martin.
I learn many in the past from your posts.

By my reply to Giovani you can see my problem is solved.
Nevertheless I would like to give you some feedback on your post.
Maybe I'm doing things in the wrong way or they could be done better.
Your feedback is appreciated.

For compiling I'm using:
arm-elf-gcc -I"inc" -I"inc/tcp_ip" -mcpu=arm7tdmi -c -save-temps 
-fverbose-asm -Wall -Wextra -Wmissing-include-dirs -Wswitch-default 
-Wfloat-equal -Wundef -Wcast-qual -Wpacked -Wshadow -Wcast-align 
-Wswitch-enum -Wbad-function-cast -Winit-self -Wpointer-arith 
-Waggregate-return  -Wstrict-prototypes -Wmissing-prototypes 
-Wmissing-declarations -O3 src/main.c


For linking
arm-elf-gcc -nostartfiles -Wl,-Map=armit_21.map,--cref,-nostdlib \
  -Tlink/lpc2292.ld -s -o armit_21.o asm/crt0.s \
  asm/interrupts.s main.o cmd_int.o nv_mem.o app_can.o card.o ...


then
arm-elf-objdump -x -t --source --full-contents armit_21.o > armit_21.dmp


then
arm-elf-objcopy --output-target ihex armit_21.o armit_21.hex


Regards.
Rui

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.