This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Thumb interworking on untyped symbols
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 08 Jun 2011 17:15:39 +0100
- Subject: Re: Thumb interworking on untyped symbols
- References: <201105311510.11813.paul@codesourcery.com>
On 31/05/11 15:10, Paul Brook wrote:
> The ARM EABI requires that linkers support interworking for function
> (STT_FUNC) symbols, either via veneers or by bl/blx conversion. We already do
> this.
>
> However for untyped symbols we blindly assume that these are ARM code. At the
> time this was implemented it probably made sense - the EABI didn't exist and
> most of the world was ARM mode anyway. With the advent of Thumb-2 and ARMv7-
> M, likely as not this is wrong.
>
> The EABI only requires interworking be performed for function symbols. For
> other symbols the behavior is less clear, the EABI stating that "interworking
> for untyped symbols must be encoded directly in the object file". By my
> reading that means we should assume the user wrote bl/blx as appropriate and
> leave well alone.
>
> The attached patch implements this by effectively disabling veneer generation
> for symbols that do not have funciton type.
>
Yes, that sounds sensible. In particular a linker only has freedom to
insert a veneer that clobbers IP when it's a STT_FUNC symbol.
R.