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


> Subject: 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


Hi Nick, thanks for reply. Off course I know it's not elf :) I didn't even try to look for it, because I had absolutely no idea where to look for it.
When I'll have some free time I'll look into bfd/coff-arm.c to see if I can add it easily.
There are a few major obstacles about adding support for these relocs: 1) Even though IMAGE_REL_BASED_HIGH and IMAGE_REL_BASED_LOW exist, it doesn't mean that wince loader handles them correctly or handles them at all. (I saw some post around the web saying that these aren't used, but i was related to x86). Even if I'll be able to add support for these into bfd and if wince will be able to load it 2) I'm still not sure about future of cegcc (gcc port for building for windows mobile), after that strange move by microsoft when they announced that their next windows phone 7 won't have native development support people started to lose interest in cegcc because of uncertainty. And even if cegcc wasn't abandoned, it seems that gcc has no interest to incorporate changes from cegcc into mainline, moreover, they announced that arm-wince-pe will be removed in next major release.
So, I came to conclusion that there is little value to it. The only reason I'd do it is to have some certain experience with bfd/binutils code and make a tiny contribution ;)



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