This is the mail archive of the binutils@sources.redhat.com 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-wince-pe support resurrection


Hi Dmitry,

  [Sorry for the slow response on this patch]

> *************** coff_arm_relocate_section (output_bfd, i
> *** 1269,1280 ****
>       	       complain_overflow_signed,
>       	       aoutarm_fix_pcrel_26 ,
>       	       "ARM_26",
> !     	       FALSE,
>       	       0x00ffffff,
>       	       0x00ffffff,
> !     	       FALSE);
>
>             addend -= rel->r_vaddr - input_section->vma;
>             howto = &fake_arm26_reloc;
>           }
>
> --- 1270,1286 ----
>       	       complain_overflow_signed,
>       	       aoutarm_fix_pcrel_26 ,
>       	       "ARM_26",
> !     	       TRUE,            /* partial_inplace */
>       	       0x00ffffff,
>       	       0x00ffffff,
> !     	       FALSE);          /* pcrel_offset */
>
>             addend -= rel->r_vaddr - input_section->vma;
> + #ifdef ARM_WINCE
> +           /* FIXME: I don't know why, but the hack is necessary for correct
> +                     generation of bl's instruction offset. */
> +           addend -= 8;
> + #endif
>             howto = &fake_arm26_reloc;
>           }


This looks like a hack.  It would be much better if we could find out
why this was needed and fix the *real* bug.  Besides, it looks like
this problem has already been encountered before.  The code just
beyond this patch reads:

  #ifdef ARM_WINCE
      /* MS ARM-CE makes the reloc relative to the opcode's pc, not
	 the next opcode's pc, so is off by one.  */
  #if 0 /* This appears to have been true for WINCE 2.0, but it is not
	 true for WINCE 3.0.  */
      if (howto->pc_relative && !info->relocatable)
	addend -= 8;
  #endif
  #endif

So - it looks like this might be dependent upon the version of WinCE
that you are using.  Which version do you use ?

Cheers
        Nick
        


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