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: ARM bfd Error: cannot represent BFD_RELOC_ARM_MOVW relocation in this object file format


Hi Pavel,

I'm using cegcc (compiler for windows mobile) and if I compile for armv7 then I'll get everywhere tons off errors from assembler that
Error: cannot represent BFD_RELOC_ARM_MOVW relocation in this object file format
Error: cannot represent BFD_RELOC_ARM_MOVT relocation in this object file format

This is because gcc generates movw/movt sequence instead of using a constant pool.

Which suggests that gcc could also be at fault for generating these instructions for a target which does not support them in this particular usage. But anyway...


Windows loader supports IMAGE_REL_BASED_HIGH and be IMAGE_REL_BASED_LOW which seems to be perfect match for BFD_RELOC_ARM_MOVW/BFD_RELOC_ARM_MOVT.

So, my question is: how can I teach bfd/binutils to generate that kind of relocs for wince/arm-pe?

First you need to pick two numbers for these relocations. Using the same numbers as IMAGE_REL_BASED_HIGH and IMAGE_REL_BASED_LOW would seem to be ideal. Then you need to edit bfd/coff-arm.c and add support for these two new relocs. (Note - you are working with COFF based support files here not ELF based ones. That is probably why you did not find the code yourself).


Cheers
  Nick


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