1 config/tc-ppc.c (PPC_VLE_SPLIT16A): Delete unused macro.
2 (PPC_VLE_SPLIT16D, PPC_VLE_LO16A, PPC_VLE_LO16D):
3 Likewise. (PPC_VLE_HI16A, PPC_VLE_HI16D):
4 Likewise. (PPC_VLE_HA16A, PPC_VLE_HA16D):
5 Likewise. (md_apply_fix):
6 Set fx_no_overflow for assorted relocations.
7 Shift and sign-extend fieldval for use by some VLE reloc
8 operand->insert functions.
10 Upstream-Status: Backport
12 Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
14 commit ee75ce72fd7a4b2dc47db46acc36905da8904be4
15 Author: Alan Modra <amodra@bigpond.net.au>
16 Date: Mon May 6 23:36:48 2013 +0000
18 --- binutils-2.23.2/gas/config/tc-ppc.c.orig 2013-06-02 21:44:34.000000000 -0500
19 +++ binutils-2.23.2/gas/config/tc-ppc.c 2013-06-02 21:51:37.000000000 -0500
21 /* #lo(value) denotes the least significant 16 bits of the indicated. */
22 #define PPC_LO(v) ((v) & 0xffff)
24 -/* Split the indicated value with the msbs in bits 11-15
25 - and the lsbs in bits 21-31. */
26 -#define PPC_VLE_SPLIT16A(v) ((v & 0xf800) << 11) | (v & 0x7ff)
28 -/* Split the indicated value with the msbs in bits 6-10
29 - and the lsbs in bits 21-31. */
30 -#define PPC_VLE_SPLIT16D(v) ((v & 0xf800) << 5) | (v & 0x7ff)
32 -/* #lo(value) denotes the lsb 16 bits in split16a format. */
33 -#define PPC_VLE_LO16A(v) PPC_VLE_SPLIT16A(PPC_LO(v))
35 -/* #lo(value) denotes the lsb 16 bits in split16d format. */
36 -#define PPC_VLE_LO16D(v) PPC_VLE_SPLIT16D(PPC_LO(v))
38 /* #hi(value) denotes bits 16 through 31 of the indicated value. */
39 #define PPC_HI(v) (((v) >> 16) & 0xffff)
41 -/* #lo(value) denotes the msb 16 bits in split16a format. */
42 -#define PPC_VLE_HI16A(v) PPC_VLE_SPLIT16A(PPC_HI(v))
44 -/* #lo(value) denotes the msb 16 bits in split16d format. */
45 -#define PPC_VLE_HI16D(v) PPC_VLE_SPLIT16D(PPC_HI(v))
47 /* #ha(value) denotes the high adjusted value: bits 16 through 31 of
48 the indicated value, compensating for #lo() being treated as a
50 #define PPC_HA(v) PPC_HI ((v) + 0x8000)
52 -/* #ha(value) denotes the high adjusted value in split16a format. */
53 -#define PPC_VLE_HA16A(v) PPC_VLE_SPLIT16A(PPC_HA(v))
55 -/* #ha(value) denotes the high adjusted value in split16d format. */
56 -#define PPC_VLE_HA16D(v) PPC_VLE_SPLIT16D(PPC_HA(v))
58 /* #higher(value) denotes bits 32 through 47 of the indicated value. */
59 #define PPC_HIGHER(v) (((v) >> 16 >> 16) & 0xffff)
61 @@ -6379,7 +6353,10 @@
62 fixP->fx_r_type = BFD_RELOC_LO16_PCREL;
64 case BFD_RELOC_LO16_PCREL:
65 + case BFD_RELOC_PPC_VLE_LO16A:
66 + case BFD_RELOC_PPC_VLE_LO16D:
67 fieldval = SEX16 (value);
68 + fixP->fx_no_overflow = 1;
72 @@ -6387,7 +6364,10 @@
73 fixP->fx_r_type = BFD_RELOC_HI16_PCREL;
75 case BFD_RELOC_HI16_PCREL:
76 + case BFD_RELOC_PPC_VLE_HI16A:
77 + case BFD_RELOC_PPC_VLE_HI16D:
78 fieldval = SEX16 (PPC_HI (value));
79 + fixP->fx_no_overflow = 1;
82 case BFD_RELOC_HI16_S:
83 @@ -6395,7 +6375,10 @@
84 fixP->fx_r_type = BFD_RELOC_HI16_S_PCREL;
86 case BFD_RELOC_HI16_S_PCREL:
87 + case BFD_RELOC_PPC_VLE_HA16A:
88 + case BFD_RELOC_PPC_VLE_HA16D:
89 fieldval = SEX16 (PPC_HA (value));
90 + fixP->fx_no_overflow = 1;
94 @@ -6403,24 +6386,28 @@
97 fieldval = SEX16 (PPC_HIGHER (value));
98 + fixP->fx_no_overflow = 1;
101 case BFD_RELOC_PPC64_HIGHER_S:
104 fieldval = SEX16 (PPC_HIGHERA (value));
105 + fixP->fx_no_overflow = 1;
108 case BFD_RELOC_PPC64_HIGHEST:
111 fieldval = SEX16 (PPC_HIGHEST (value));
112 + fixP->fx_no_overflow = 1;
115 case BFD_RELOC_PPC64_HIGHEST_S:
118 fieldval = SEX16 (PPC_HIGHESTA (value));
119 + fixP->fx_no_overflow = 1;
122 /* The following relocs can't be calculated by the assembler.