[PATCH 1/8] ARM: assembler: introduce adr_l, ldr_l and str_l macros

Ard Biesheuvel ard.biesheuvel at linaro.org
Thu Aug 4 04:34:03 PDT 2016


On 4 August 2016 at 13:30, Dave Martin <Dave.Martin at arm.com> wrote:
> On Thu, Aug 04, 2016 at 01:10:55PM +0200, Ard Biesheuvel wrote:
>> On 4 August 2016 at 13:08, Dave Martin <Dave.Martin at arm.com> wrote:
>
> [...]
>
>> > or, for ldr_l:
>> >
>> > 0:      add     \dst, pc, #-8
>> > 1:      add     \dst, \dst, #-4
>> > 2:      ldr     [\dst, #0]
>> >
>> > .reloc  0b, R_ARM_ALU_PC_G0_NC, \sym
>> > .reloc  1b, R_ARM_ALU_PC_G1_NC, \sym
>> > .reloc  2b, R_ARM_LDR_PC_G2, \sym
>> >
>> > ... should produce precisely the same result at the .o stage.
>> >
>>
>> Yes, but how is LD going to perform the arithmetic involved in
>
> What arithmetic?
>

The arithmetic involved in populating the immediate fields of these
instructions based on the actual offset between the Place and the
Symbol in the final image.

>> handling these relocations? That's is the more interesting part, and
>> that is not implemented either in binutils < 2.18
>
> You mean .reloc is not implemented < 2.18?
>

Yes, .reloc is implemented, but that is not sufficient.



More information about the linux-arm-kernel mailing list