Fwd: [PATCH] arm: ensure symbol is a thumb symbol in new binutils
Ramana Radhakrishnan
ramana.gcc@googlemail.com
Mon Jun 11 14:07:00 GMT 2018
On Mon, Jun 11, 2018 at 3:03 PM, Nick Clifton <nickc@redhat.com> wrote:
> Hi Christophe,
>
>> On code generated we see the issue on entry-common.o
>> (arch/arm/kernel/entry-common.o):
>> code ok: f2af 1e3b subw lr, pc, #315 ; 0x13b
>> code KO: f2af 1e3a subw lr, pc, #314 ; 0x13a
>> (see assembler code obtained by objdump)
>
> OK - so this translates to the use of the "badr" macro defined
> in include/asm/assembler.h:
>
> .macro badr\c, rd, sym
> #ifdef CONFIG_THUMB2_KERNEL
> adr\c \rd, \sym + 1
> #else
> adr\c \rd, \sym
> #endif
> .endm
>
>
> What is the CONFIG_THUMB2_KERNEL flag ?
>
> I am wondering why it alters the behaviour of the badr macro...
>
>
>> -fno-PIE -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp
>
> Question - is the -mno-thumb-interwork flag always used ?
>
> It seems to me that this flag might provide a much simpler option
> to fix the assembler. Ie: if -mthumb-interwork is enabled then
> the ADR pseudo-instruction should include the interworking bit (for
> thumb function symbols), whereas if -mno-thumb-interwork is in
> effect, then it should not.
Why is -mthumb-interwork relevant for Thumb2 ? Interworking is a
given at that level of the architecture.
Ramana
>
> Cheers
> Nick
More information about the Binutils
mailing list