rtl problem when processing arm thumb mode switch

Peng Fan van.freenix at gmail.com
Thu May 9 15:00:58 UTC 2013


I am trying to make the mode switch work on rtl for arm.

The following code is disassembled using arm linux gcc.

elf object file:  compiled in thumb mode.
38: f7ff bffe b.w 0 <rtems>
 38: R_ARM_THM_JUMP24 rtems
It invokes a function "rtems" which are in arm mode.

elf executable file:
8414: f000 b85c b.w 84d0 <__rtems_from_thumb>

000084d0 <__rtems_from_thumb>: //stub code
    84d0: 4778       bx pc
    84d2: 46c0       nop ; (mov r8, r8)
    84d4: eaffffc0 b 83dc <rtems>

the arm linux gcc uses a stub code to handle the thumb to arm invoking.
I also want to introduce this for arm rtl.But I do not have a good idea
about how to manage the stub code. Each rap file may contain many such
reloc entry, each such reloc entry needs a stub code.
How to manage the stub codes?

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130509/55f92ffc/attachment.html>

More information about the devel mailing list