ARM interworking with different linker sections
Eric de Jong
ericdejong@gmx.net
Wed Feb 12 08:41:00 GMT 2003
Hello Nick,
I use gcc 3.2.1, binutils 2.13.1 and newlib 1.10.0. They are compiled on cygwin
1.3.19-1 with --target=arm-unknown-elf.
Attached you will find interwork.zip. After a make, I did an
"arm-unknown-elf-objdump -d a.out > a.s"
If you look in the file 'a.s' at line 182 you will see:
1c6: f831f000 bl 22c <LedLoop_rom_thumb+0x88>
The last address in 'a.s' is 0x20a, 0x22c does not exist.
Please note the following about the attached project:
- for simplicity, no startup files are included
- the makefile is configured to compile thumbfunc.c with -mthumb
and -mthumb-interwork flag,
all other files compile with -mthumb-interwork flag
- in thumbfunc.h, you will find for LedLoop_rom_thumb and SetLeds: __attribute__
((section(".virtrom")))
- the linker file link_rom.cmd will put section .virtrom behind all other
sections (but still in ram, before rom section at 0x1000000)
----- Original Message -----
From: "Nick Clifton"
Subject: Re: ARM interworking with different linker sections
Hi Eric,
> Function main (arm function) calls LedLoop_rom_thumb (thumb function) which
> calls SetLeds (arm function)
> Calling LedLoop_rom_thumb works well, the interworking stub
> LedLoop_rom_thumb_from_arm is called at 0xee4 which calls LedLoop_rom_thumb at
> 0x1315 (0x1314 with thumb mode bit). However the call to SetLeds is translated
> in a call to 0x2128. At this location there is no code or data present.
> arm-objdump -S a.out reveils that the stub SetLeds_from_thumb is located at
> 0xedc.
>
> When I move LedLoop_rom to segment .text all works well.
> When I move LedLoop_rom and SetLeds to segment .text all works well too.
>
> Who can help?
Please can you supply som emore details of the problem:
* What version of the compiler, assembler and linker are you using ?
* Do you have a *small* reproducible test case that demonstrates the
problem ?
Cheers
Nick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: interwork.zip
Type: application/x-zip-compressed
Size: 13985 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20030212/242ceeee/attachment.bin>
More information about the Gcc
mailing list