Re: [arm-gnu] thumb code calling arm subroutine causes undefined insn exception
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] thumb code calling arm subroutine causes undefined insn exception



On Wed, 2010-04-28 at 11:33 -0400, Andrew Kohlsmith (mailing lists
account) wrote:
> On Wednesday 28 April 2010 10:57:54 am Richard Earnshaw wrote:
> > .thumb_func shouldn't be needed these days.
> 
> > However, you probably want to add a
> > 	.type thumb_start, %function
> > directive.
> 
> Interesting. Could you give an example, I'm not quite getting how this works.
> 

> Is it a matter of
> 
> 	.type thumb_start, %my_thumb_func
> 

No.  %function says that 'thumb_start' is a function-like symbol (as
opposed to a data-like, or untyped.  The linker needs this information
to know when inter-working veneers are needed and when not.  So if I
write:

	.text
	.code32
	.global _start
	.type _start, %function
_start:
	b _thumb_start
	.code16
	.type _thumb_start, %function
.thumb_start:
	bl main
	b .

The linker will be able to patch this all up and make things work.

R.