This is the mail archive of the
mailing list for the binutils project.
Re: [ARM] register label conflict with blx instruction
- From: Christian Bruel <christian dot bruel at st dot com>
- To: Richard Earnshaw <rearnsha at arm dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>
- Date: Wed, 5 Nov 2014 12:34:32 +0100
- Subject: Re: [ARM] register label conflict with blx instruction
- Authentication-results: sourceware.org; auth=none
- References: <5459FAA5 dot 7000208 at st dot com> <5459FE94 dot 4000803 at arm dot com>
On 11/05/2014 11:40 AM, Richard Earnshaw wrote:
On 05/11/14 10:23, Christian Bruel wrote:
I'm wondering what would be the best way to deal with labels conflicting
with a register name in ARM gas.
.type r0, %function
.type f, %function
then let the linker fix it up. Compilers shouldn't need to emit blx
that was my hope, but it does not always fix it up, I entered a bz
binutils #17505 for this. So thought emitting it directly when possible
would be a alternative.
On a side note, there is a REGISTER_PREFIX in the assembler. What about
having the compiler generates prefixed register names to avoid the
conflict ? %a0 vs a0 ?
the assembler will see r0 as a reg and of course produce wrong code.
Prefixing labels in the assembler fixes the issue. But this is compiler
generated code (from the attribute target work), Changing
USER_LABEL_PREFIX would modify all visible symbols which is not
desirable. I only wish to generate this for static function to bypass a
current limitation with the assembler.
Any idea about an arm assembly syntax to avoid naming conflict between
regs and symbols for instruction that support boths ?