This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Support for R_ARM_MOVW_BREL_NC et al.
- From: Mark Shinwell <shinwell at codesourcery dot com>
- To: binutils at sourceware dot org
- Date: Tue, 17 Oct 2006 16:57:47 +0100
- Subject: [PATCH] Support for R_ARM_MOVW_BREL_NC et al.
This patch provides support for the ARM relocations listed below.
Tested on arm-none-linux-gnueabi. OK?
Mark
--
2006-10-17 Mark Shinwell <shinwell@codesourcery.com>
bfd/
* elf32-arm.c (elf32_arm_final_link_relocate): Add support for
R_ARM_MOVW_BREL_NC, R_ARM_MOVW_BREL, R_ARM_MOVT_BREL,
R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVW_BREL and
R_ARM_THM_MOVT_BREL relocations.
Index: bfd/elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.95
diff -r1.95 elf32-arm.c
4834a4835,4841
> /* Until we properly support segment-base-relative addressing then
> we assume the segment base to be zero, as for the group relocations.
> Thus R_ARM_MOVW_BREL_NC has the same semantics as R_ARM_MOVW_ABS_NC
> and R_ARM_MOVT_BREL has the same semantics as R_ARM_MOVT_ABS. */
> case R_ARM_MOVW_BREL_NC:
> case R_ARM_MOVW_BREL:
> case R_ARM_MOVT_BREL:
4842a4850
>
4844,4845d4851
< if (sym_flags == STT_ARM_TFUNC)
< value |= 1;
4851c4857,4864
< if (r_type == R_ARM_MOVT_ABS || r_type == R_ARM_MOVT_PREL)
---
> if (r_type == R_ARM_MOVW_BREL && value >= 0x10000)
> return bfd_reloc_overflow;
>
> if (sym_flags == STT_ARM_TFUNC)
> value |= 1;
>
> if (r_type == R_ARM_MOVT_ABS || r_type == R_ARM_MOVT_PREL
> || r_type == R_ARM_MOVT_BREL)
4864a4878,4885
> /* Until we properly support segment-base-relative addressing then
> we assume the segment base to be zero, as for the above relocations.
> Thus R_ARM_THM_MOVW_BREL_NC has the same semantics as
> R_ARM_THM_MOVW_ABS_NC and R_ARM_THM_MOVT_BREL has the same semantics
> as R_ARM_THM_MOVT_ABS. */
> case R_ARM_THM_MOVW_BREL_NC:
> case R_ARM_THM_MOVW_BREL:
> case R_ARM_THM_MOVT_BREL:
4878a4900
>
4880,4881d4901
< if (sym_flags == STT_ARM_TFUNC)
< value |= 1;
4887c4907,4914
< if (r_type == R_ARM_THM_MOVT_ABS || r_type == R_ARM_THM_MOVT_PREL)
---
> if (r_type == R_ARM_THM_MOVW_BREL && value >= 0x10000)
> return bfd_reloc_overflow;
>
> if (sym_flags == STT_ARM_TFUNC)
> value |= 1;
>
> if (r_type == R_ARM_THM_MOVT_ABS || r_type == R_ARM_THM_MOVT_PREL
> || r_type == R_ARM_THM_MOVT_BREL)