This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: as constant calculation question


Hi Efim,

does anyone know why as for ARM can use
.word __load_section_end__
.word __init_start__
.word __load_section_end__ - 0x300000

but not:
.word __load_section_end__ - __init_start__

Because the ARM ABI does not define a reloc (or rather pair of relocs) to handle the difference between two undefined symbols.


A single reloc can only reference at most one symbol. Thus the first three cases can all be handled by the R_ARM_ABS32 reloc which will refer to the appropriate (undefined) symbol. The last case however requires that *two* symbols be referenced. This requires that two relocs be generated and the ARM ABI has not been set up to enable this feature.

Cheers
  Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]