This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: arm-wince-pe support resurrection
- From: Nick Clifton <nickc at redhat dot com>
- To: <Dmitry dot Semyonov at oktet dot ru>
- Cc: <binutils at sources dot redhat dot com>
- Date: Mon, 15 Dec 2003 15:14:16 +0000
- Subject: Re: arm-wince-pe support resurrection
- References: <Pine.LNX.4.33.0312052233270.20991-100000@mail.oktet.ru>
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