[Patch ][RFC] [ARM] Remove use of real start of function for ARM EABI configurations.

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Patch ][RFC] [ARM] Remove use of real start of function for ARM EABI configurations.

Ramana Radhakrishnan-4
Hi,

If you have a bl or a branch from a function in Thumb ISA mode to a local
function in Thumb ISA mode, gas prints a warning about not being able to
find the real start of function.

This is an artefact of the ".real_start_of" prefix is applied only for
functions that have the "interfacearm" attribute specified. Since the
"interfacearm" attribute for functions in C can only be applied by the PE
configuration of GCC, I'd like to remove support for this from the ELF
configurations.

Tested with the binutils testsuite with no regressions.

I should point out that the assembler doesn't handle branches or calls to
local functions defined to be in Thumb ISA from functions written in ARM ISA
and vice versa that will do the right thing according to the ABI. I am
working on a follow up patch to handle those cases.

Ok to commit ?
 
2009-03-27  Ramana Radhakrishnan  <[hidden email]>

        * config/tc-arm.c (arm_validate_fix): Define only for OBJ_COFF.
        (find_real_start): Likewise.
        * config/tc-arm.h (TC_VALIDATE_FIX): Likewise.

Cheers
Ramana

Ramana Radhakrishnan
ARM Ltd. (www.arm.com)


real-remove.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Patch ][RFC] [ARM] Remove use of real start of function for ARM EABI configurations.

Paul Brook
> I should point out that the assembler doesn't handle branches or calls to
> local functions defined to be in Thumb ISA from functions written in ARM
> ISA and vice versa that will do the right thing according to the ABI. I am
> working on a follow up patch to handle those cases.

I'm pretty sure this is a bug in your code. Function symbols should be marked
as such regardless of whether they are local.

Paul
Reply | Threaded
Open this post in threaded view
|

RE: [Patch ][RFC] [ARM] Remove use of real start of function for ARM EABI configurations.

Ramana Radhakrishnan-4
 

> -----Original Message-----
> From: Paul Brook [mailto:[hidden email]]
> Sent: 27 March 2009 15:40
> To: [hidden email]
> Cc: Ramana Radhakrishnan; Richard Earnshaw
> Subject: Re: [Patch ][RFC] [ARM] Remove use of real start of function
> for ARM EABI configurations.
>
> > I should point out that the assembler doesn't handle branches or
> calls to
> > local functions defined to be in Thumb ISA from functions written in
> ARM
> > ISA and vice versa that will do the right thing according to the ABI.
> I am
> > working on a follow up patch to handle those cases.
>
> I'm pretty sure this is a bug in your code. Function symbols should be
> marked
> as such regardless of whether they are local.

Consider the following case.

        .text
        .arch armv5t
        .arm
one:
        bl      foo
        .thumb
        .type foo, %function
        .thumb_func
foo:
        nop
        nop


In this case if foo were global we end up being interworking safe because
the assembler generates a reloc and the linker knows how to fix it. However
because this is local , the assembler would accept the same without
squawking. I'm trying to make the behaviour of the tools consistent across
local and global functions. OTOH if the bl were to a symbol with type
STT_NOTYPE it would be accepted as is and it's up to the user to be smart
about that.


cheers
Ramana



Reply | Threaded
Open this post in threaded view
|

Re: [Patch ][RFC] [ARM] Remove use of real start of function for ARM EABI configurations.

Richard Earnshaw
In reply to this post by Ramana Radhakrishnan-4
On Fri, 2009-03-27 at 14:33 +0000, Ramana Radhakrishnan wrote:

> Hi,
>
> If you have a bl or a branch from a function in Thumb ISA mode to a local
> function in Thumb ISA mode, gas prints a warning about not being able to
> find the real start of function.
>
> This is an artefact of the ".real_start_of" prefix is applied only for
> functions that have the "interfacearm" attribute specified. Since the
> "interfacearm" attribute for functions in C can only be applied by the PE
> configuration of GCC, I'd like to remove support for this from the ELF
> configurations.
>
> Tested with the binutils testsuite with no regressions.
>
> I should point out that the assembler doesn't handle branches or calls to
> local functions defined to be in Thumb ISA from functions written in ARM ISA
> and vice versa that will do the right thing according to the ABI. I am
> working on a follow up patch to handle those cases.
>
> Ok to commit ?
>  
> 2009-03-27  Ramana Radhakrishnan  <[hidden email]>
>
>         * config/tc-arm.c (arm_validate_fix): Define only for OBJ_COFF.
>         (find_real_start): Likewise.
>         * config/tc-arm.h (TC_VALIDATE_FIX): Likewise.

This is OK.

R.

Reply | Threaded
Open this post in threaded view
|

RE: [Patch ][RFC] [ARM] Remove use of real start of function forARM EABI configurations.

Ramana Radhakrishnan-4
> >
> > Ok to commit ?
> >
> > 2009-03-27  Ramana Radhakrishnan  <[hidden email]>
> >
> >         * config/tc-arm.c (arm_validate_fix): Define only for
> OBJ_COFF.
> >         (find_real_start): Likewise.
> >         * config/tc-arm.h (TC_VALIDATE_FIX): Likewise.
>
> This is OK.

Thanks and now committed.

Ramana

>
> R.