[PATCH] : Correct ARM_RVA32 value in pe images generation for arm Windows CE.

Pedro Alves pedro_alves@portugalmail.pt
Tue Jul 4 13:28:00 GMT 2006


Hi all,

Please find attached a patch against ld/pe-dll.c that fixes pei .reloc 
section generation for arm Windows CE targets.

The problem was that the wrong ARM_RVA32 value was filled in the
pe_details->imagebase_reloc for ARM targets.

The PE Coff specification states:
	Constant - IMAGE_REL_ARM_ADDR32NB
	Value - 0x0002
	Description  - The 32-bit RVA of the target.

And indeed the correct values are defined in bfd/coff-arm.c:

#ifdef ARM_WINCE
...
#define ARM_26D      0
#define ARM_32       1
#define ARM_RVA32    2
#define ARM_26	     3
#define ARM_THUMB12  4
#define ARM_SECTION  14
#define ARM_SECREL   15
#endif

And for all other coff arm targets:
#define ARM_RVA32   11

But since those defines are not in a header, the pe-dll.c value
bitrotted.

This is one of those bugs that makes you hate magic constants to
the gut ;)

I have caught this while fixing --enable-runtime-pseudo-reloc for
arm-wince-pe, so I am quite sure it works correctly for that target.

The PE_ARCH_arm_epoc I am not sure, but it I guess the
reloc values should come from the PE COFF specification too.

Can anyone point me to a list of which platforms use arm-pe?
What is this epoc arm target used for?

Cheers,
Pedro Alves

---
2006-07-04  Pedro Alves <pedro_alves@portugalmail.pt>

	* pe-dll.c (pe_detail_list): Use correct ARM_RVA32 value for
PE_ARCH_arm, and PE_ARCH_arm_epoc cases.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ld-rva.diff
URL: <https://sourceware.org/pipermail/binutils/attachments/20060704/41de0c94/attachment.ksh>


More information about the Binutils mailing list