This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [ARM] gas miscompiles ADR statement
- From: Nick Clifton <nickc at redhat dot com>
- To: amodra at bigpond dot net dot au
- Cc: enrico dot scholz at sigma-chemnitz dot de, binutils at sources dot redhat dot com
- Date: 03 Dec 2002 09:30:17 +0000
- Subject: Re: [ARM] gas miscompiles ADR statement
- References: <ly1y50fjow.fsf@ensc-pc.intern.sigma-chemnitz.de><20021203000110.GL27956@bubble.sa.bigpond.net.au>
Hi Alan,
> I'm guilty. The problem was introduced with my gas reloc rewrite.
> The following should fix it, but I'd like one of the ARM maintainers
> to OK it before I commit.
>
> * config/tc-arm.c (arm_force_relocation): Return 0 for IMMEDIATE
> and ADRL_IMMEDIATE.
Approved - but ...
> + /* Resolve immediate relocations even if the symbol is extern or weak. */
> + if (fixp->fx_r_type == BFD_RELOC_ARM_IMMEDIATE
> + || fixp->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE)
> + return 0;
> +
> return S_FORCE_RELOC (fixp->fx_addsy);
I think that the comment is probably too general. There are quite a
lot of other immediate relocations supported by the ARM:
BFD_RELOC_ARM_OFFSET_IMM
BFD_RELOC_ARM_SHIFT_IMM
BFD_RELOC_ARM_SWI
BFD_RELOC_ARM_CP_OFF_IMM
BFD_RELOC_ARM_ADR_IMM
BFD_RELOC_ARM_LDR_IMM
BFD_RELOC_ARM_LITERAL
BFD_RELOC_ARM_OFFSET_IMM8
BFD_RELOC_ARM_HWLITERAL
BFD_RELOC_ARM_THUMB_IMM
Plus - I think that it would be a very good idea to include Enrico's
little test program in the ARM GAS testsuite, so that this bug does
not resurface in the future.
Cheers
Nick