Start mass upgrade
[dragora.git] / patches / binutils / 2.35 / binutils-s390-build.patch
blobcdb6a5d1a86387d6ead4d664c68bc8d468d37426
1 diff -rup binutils.orig/libctf/ctf-create.c binutils-2.34.0/libctf/ctf-create.c
2 --- binutils.orig/libctf/ctf-create.c 2020-06-16 12:06:28.466468753 +0100
3 +++ binutils-2.34.0/libctf/ctf-create.c 2020-06-16 12:16:19.744482839 +0100
4 @@ -871,7 +871,8 @@ ctf_add_encoded (ctf_file_t *fp, uint32_
6 if ((type = ctf_add_generic (fp, flag, name, kind, &dtd)) == CTF_ERR)
7 return CTF_ERR; /* errno is set for us. */
9 + if (dtd == NULL)
10 + return CTF_ERR;
11 dtd->dtd_data.ctt_info = CTF_TYPE_INFO (kind, flag, 0);
12 dtd->dtd_data.ctt_size = clp2 (P2ROUNDUP (ep->cte_bits, CHAR_BIT)
13 / CHAR_BIT);
14 @@ -896,6 +897,8 @@ ctf_add_reftype (ctf_file_t *fp, uint32_
16 if ((type = ctf_add_generic (fp, flag, NULL, kind, &dtd)) == CTF_ERR)
17 return CTF_ERR; /* errno is set for us. */
18 + if (dtd == NULL)
19 + return CTF_ERR;
21 dtd->dtd_data.ctt_info = CTF_TYPE_INFO (kind, flag, 0);
22 dtd->dtd_data.ctt_type = (uint32_t) ref;
23 @@ -958,6 +961,8 @@ ctf_add_slice (ctf_file_t *fp, uint32_t
25 if ((type = ctf_add_generic (fp, flag, NULL, CTF_K_SLICE, &dtd)) == CTF_ERR)
26 return CTF_ERR; /* errno is set for us. */
27 + if (dtd == NULL)
28 + return CTF_ERR;
30 dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_SLICE, flag, 0);
31 dtd->dtd_data.ctt_size = clp2 (P2ROUNDUP (ep->cte_bits, CHAR_BIT)
32 @@ -1008,6 +1013,8 @@ ctf_add_array (ctf_file_t *fp, uint32_t
34 if ((type = ctf_add_generic (fp, flag, NULL, CTF_K_ARRAY, &dtd)) == CTF_ERR)
35 return CTF_ERR; /* errno is set for us. */
36 + if (dtd == NULL)
37 + return CTF_ERR;
39 dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_ARRAY, flag, 0);
40 dtd->dtd_data.ctt_size = 0;
41 @@ -1075,6 +1082,8 @@ ctf_add_function (ctf_file_t *fp, uint32
42 free (vdat);
43 return CTF_ERR; /* errno is set for us. */
45 + if (dtd == NULL)
46 + return CTF_ERR;
48 dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_FUNCTION, flag, vlen);
49 dtd->dtd_data.ctt_type = (uint32_t) ctc->ctc_return;
50 @@ -1104,6 +1113,8 @@ ctf_add_struct_sized (ctf_file_t *fp, ui
51 else if ((type = ctf_add_generic (fp, flag, name, CTF_K_STRUCT,
52 &dtd)) == CTF_ERR)
53 return CTF_ERR; /* errno is set for us. */
54 + if (dtd == NULL)
55 + return CTF_ERR;
57 dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_STRUCT, flag, 0);
59 @@ -1141,6 +1152,8 @@ ctf_add_union_sized (ctf_file_t *fp, uin
60 else if ((type = ctf_add_generic (fp, flag, name, CTF_K_UNION,
61 &dtd)) == CTF_ERR)
62 return CTF_ERR; /* errno is set for us */
63 + if (dtd == NULL)
64 + return CTF_ERR;
66 dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_UNION, flag, 0);
68 @@ -1177,6 +1190,8 @@ ctf_add_enum (ctf_file_t *fp, uint32_t f
69 else if ((type = ctf_add_generic (fp, flag, name, CTF_K_ENUM,
70 &dtd)) == CTF_ERR)
71 return CTF_ERR; /* errno is set for us. */
72 + if (dtd == NULL)
73 + return CTF_ERR;
75 dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_ENUM, flag, 0);
76 dtd->dtd_data.ctt_size = fp->ctf_dmodel->ctd_int;
77 diff -rup binutils.orig/libctf/ctf-types.c binutils-2.34.0/libctf/ctf-types.c
78 --- binutils.orig/libctf/ctf-types.c 2020-06-16 12:06:28.466468753 +0100
79 +++ binutils-2.34.0/libctf/ctf-types.c 2020-06-16 12:10:58.033563365 +0100
80 @@ -748,7 +748,7 @@ ctf_type_encoding (ctf_file_t *fp, ctf_i
81 case CTF_K_SLICE:
83 const ctf_slice_t *slice;
84 - ctf_encoding_t underlying_en;
85 + ctf_encoding_t underlying_en = {0};
86 slice = &dtd->dtd_u.dtu_slice;
88 data = ctf_type_encoding (fp, slice->cts_type, &underlying_en);
89 diff -rup binutils.orig/opcodes/s390-mkopc.c binutils-2.34.0/opcodes/s390-mkopc.c
90 --- binutils.orig/opcodes/s390-mkopc.c 2020-06-16 12:06:28.447468816 +0100
91 +++ binutils-2.34.0/opcodes/s390-mkopc.c 2020-06-16 12:17:10.783311417 +0100
92 @@ -168,7 +168,7 @@ insertExpandedMnemonic (char *opcode, ch
93 int mask_start, i = 0, tag_found = 0, reading_number = 0;
94 int number_p = 0, suffix_p = 0, prefix_p = 0;
95 const struct s390_cond_ext_format *ext_table;
96 - int ext_table_length;
97 + int ext_table_length = 0;
99 if (!(tag = strpbrk (mnemonic, "*$")))
101 Only in binutils.orig/libctf: .#ctf-create.c
102 diff -rup binutils.orig/libctf/ctf-create.c binutils-2.34.0/libctf/ctf-create.c
103 --- binutils.orig/libctf/ctf-create.c 2020-06-16 14:49:06.080801319 +0100
104 +++ binutils-2.34.0/libctf/ctf-create.c 2020-06-16 14:49:08.046794113 +0100
105 @@ -798,6 +798,7 @@ ctf_add_generic (ctf_file_t *fp, uint32_
107 ctf_dtdef_t *dtd;
108 ctf_id_t type;
109 + *rp = NULL;
111 if (flag != CTF_ADD_NONROOT && flag != CTF_ADD_ROOT)
112 return (ctf_set_errno (fp, EINVAL));
113 diff -rup binutils.orig/opcodes/fr30-ibld.c binutils-2.34.0/opcodes/fr30-ibld.c
114 --- binutils.orig/opcodes/fr30-ibld.c 2020-06-16 14:49:06.074801341 +0100
115 +++ binutils-2.34.0/opcodes/fr30-ibld.c 2020-06-16 16:43:31.428324833 +0100
116 @@ -810,7 +810,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
117 break;
118 case FR30_OPERAND_DIR10 :
120 - long value;
121 + long value = 0;
122 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 16, total_length, pc, & value);
123 value = ((value) << (2));
124 fields->f_dir10 = value;
125 @@ -821,7 +821,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
126 break;
127 case FR30_OPERAND_DIR9 :
129 - long value;
130 + long value = 0;
131 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 16, total_length, pc, & value);
132 value = ((value) << (1));
133 fields->f_dir9 = value;
134 @@ -829,7 +829,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
135 break;
136 case FR30_OPERAND_DISP10 :
138 - long value;
139 + long value = 0;
140 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 8, 16, total_length, pc, & value);
141 value = ((value) * (4));
142 fields->f_disp10 = value;
143 @@ -840,7 +840,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
144 break;
145 case FR30_OPERAND_DISP9 :
147 - long value;
148 + long value = 0;
149 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 8, 16, total_length, pc, & value);
150 value = ((value) * (2));
151 fields->f_disp9 = value;
152 @@ -865,7 +865,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
153 break;
154 case FR30_OPERAND_LABEL12 :
156 - long value;
157 + long value = 0;
158 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 5, 11, 16, total_length, pc, & value);
159 value = ((((value) * (2))) + (((pc) + (2))));
160 fields->f_rel12 = value;
161 @@ -873,7 +873,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
162 break;
163 case FR30_OPERAND_LABEL9 :
165 - long value;
166 + long value = 0;
167 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 8, 16, total_length, pc, & value);
168 value = ((((value) * (2))) + (((pc) + (2))));
169 fields->f_rel9 = value;
170 @@ -881,7 +881,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
171 break;
172 case FR30_OPERAND_M4 :
174 - long value;
175 + long value = 0;
176 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 16, total_length, pc, & value);
177 value = ((value) | (-16));
178 fields->f_m4 = value;
179 @@ -911,7 +911,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
180 break;
181 case FR30_OPERAND_U10 :
183 - long value;
184 + long value = 0;
185 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 16, total_length, pc, & value);
186 value = ((value) << (2));
187 fields->f_u10 = value;
188 @@ -928,7 +928,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
189 break;
190 case FR30_OPERAND_UDISP6 :
192 - long value;
193 + long value = 0;
194 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 16, total_length, pc, & value);
195 value = ((value) << (2));
196 fields->f_udisp6 = value;
198 diff -rup binutils.orig/opcodes/fr30-ibld.c binutils-2.34.0/opcodes/fr30-ibld.c
199 --- binutils.orig/opcodes/fr30-ibld.c 2020-06-16 17:10:22.540563440 +0100
200 +++ binutils-2.34.0/opcodes/fr30-ibld.c 2020-06-16 17:10:48.966468906 +0100
201 @@ -903,7 +903,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
202 break;
203 case FR30_OPERAND_S10 :
205 - long value;
206 + long value = 0;
207 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 8, 16, total_length, pc, & value);
208 value = ((value) * (4));
209 fields->f_s10 = value;
210 Only in binutils-2.34.0/opcodes: fr30-ibld.c~
211 --- binutils.orig/opcodes/m32c-ibld.c 2020-06-16 17:10:22.531563472 +0100
212 +++ binutils-2.34.0/opcodes/m32c-ibld.c 2020-06-16 17:25:48.612258094 +0100
213 @@ -1805,7 +1805,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
214 break;
215 case M32C_OPERAND_BIT32RNPREFIXED :
217 - long value;
218 + long value = 0;
219 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value);
220 value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
221 fields->f_dst32_rn_prefixed_QI = value;
222 @@ -1813,7 +1813,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
223 break;
224 case M32C_OPERAND_BIT32RNUNPREFIXED :
226 - long value;
227 + long value = 0;
228 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value);
229 value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
230 fields->f_dst32_rn_unprefixed_QI = value;
231 @@ -1824,7 +1824,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
232 break;
233 case M32C_OPERAND_BITBASE16_16_U16 :
235 - long value;
236 + long value = 0;
237 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
238 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
239 fields->f_dsp_16_u16 = value;
240 @@ -1860,7 +1860,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
241 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed);
242 if (length <= 0) break;
244 - long value;
245 + long value = 0;
246 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, pc, & value);
247 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
248 fields->f_dsp_16_s16 = value;
249 @@ -1887,7 +1887,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
250 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed);
251 if (length <= 0) break;
253 - long value;
254 + long value = 0;
255 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
256 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
257 fields->f_dsp_16_u16 = value;
258 @@ -1903,7 +1903,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
259 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed);
260 if (length <= 0) break;
262 - long value;
263 + long value = 0;
264 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
265 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
266 fields->f_dsp_16_u16 = value;
267 @@ -1971,7 +1971,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
268 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
269 if (length <= 0) break;
271 - long value;
272 + long value = 0;
273 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value);
274 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
275 fields->f_dsp_32_u16 = value;
276 @@ -1996,7 +1996,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
277 break;
278 case M32C_OPERAND_DSP_16_S16 :
280 - long value;
281 + long value = 0;
282 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, pc, & value);
283 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
284 fields->f_dsp_16_s16 = value;
285 @@ -2007,7 +2007,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
286 break;
287 case M32C_OPERAND_DSP_16_U16 :
289 - long value;
290 + long value = 0;
291 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
292 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
293 fields->f_dsp_16_u16 = value;
294 @@ -2016,7 +2016,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
295 case M32C_OPERAND_DSP_16_U20 :
298 - long value;
299 + long value = 0;
300 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
301 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
302 fields->f_dsp_16_u16 = value;
303 @@ -2032,7 +2032,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
304 case M32C_OPERAND_DSP_16_U24 :
307 - long value;
308 + long value = 0;
309 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
310 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
311 fields->f_dsp_16_u16 = value;
312 @@ -2078,7 +2078,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
313 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
314 if (length <= 0) break;
316 - long value;
317 + long value = 0;
318 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value);
319 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
320 fields->f_dsp_32_u16 = value;
321 @@ -2094,7 +2094,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
322 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
323 if (length <= 0) break;
325 - long value;
326 + long value = 0;
327 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value);
328 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
329 fields->f_dsp_32_u16 = value;
330 @@ -2110,7 +2110,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
331 break;
332 case M32C_OPERAND_DSP_32_S16 :
334 - long value;
335 + long value = 0;
336 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 16, 32, total_length, pc, & value);
337 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
338 fields->f_dsp_32_s16 = value;
339 @@ -2121,7 +2121,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
340 break;
341 case M32C_OPERAND_DSP_32_U16 :
343 - long value;
344 + long value = 0;
345 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value);
346 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
347 fields->f_dsp_32_u16 = value;
348 @@ -2129,7 +2129,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
349 break;
350 case M32C_OPERAND_DSP_32_U20 :
352 - long value;
353 + long value = 0;
354 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 24, 32, total_length, pc, & value);
355 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
356 fields->f_dsp_32_u24 = value;
357 @@ -2137,7 +2137,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
358 break;
359 case M32C_OPERAND_DSP_32_U24 :
361 - long value;
362 + long value = 0;
363 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 24, 32, total_length, pc, & value);
364 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
365 fields->f_dsp_32_u24 = value;
366 @@ -2148,7 +2148,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
367 break;
368 case M32C_OPERAND_DSP_40_S16 :
370 - long value;
371 + long value = 0;
372 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 8, 16, 32, total_length, pc, & value);
373 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
374 fields->f_dsp_40_s16 = value;
375 @@ -2159,7 +2159,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
376 break;
377 case M32C_OPERAND_DSP_40_U16 :
379 - long value;
380 + long value = 0;
381 length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 16, 32, total_length, pc, & value);
382 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
383 fields->f_dsp_40_u16 = value;
384 @@ -2167,7 +2167,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
385 break;
386 case M32C_OPERAND_DSP_40_U20 :
388 - long value;
389 + long value = 0;
390 length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 20, 32, total_length, pc, & value);
391 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (983040))));
392 fields->f_dsp_40_u20 = value;
393 @@ -2175,7 +2175,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
394 break;
395 case M32C_OPERAND_DSP_40_U24 :
397 - long value;
398 + long value = 0;
399 length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 24, 32, total_length, pc, & value);
400 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
401 fields->f_dsp_40_u24 = value;
402 @@ -2186,7 +2186,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
403 break;
404 case M32C_OPERAND_DSP_48_S16 :
406 - long value;
407 + long value = 0;
408 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 16, 16, 32, total_length, pc, & value);
409 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
410 fields->f_dsp_48_s16 = value;
411 @@ -2197,7 +2197,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
412 break;
413 case M32C_OPERAND_DSP_48_U16 :
415 - long value;
416 + long value = 0;
417 length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value);
418 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
419 fields->f_dsp_48_u16 = value;
420 @@ -2206,7 +2206,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
421 case M32C_OPERAND_DSP_48_U20 :
424 - long value;
425 + long value = 0;
426 length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value);
427 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
428 fields->f_dsp_48_u16 = value;
429 @@ -2222,7 +2222,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
430 case M32C_OPERAND_DSP_48_U24 :
433 - long value;
434 + long value = 0;
435 length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value);
436 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
437 fields->f_dsp_48_u16 = value;
438 @@ -2240,7 +2240,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
439 break;
440 case M32C_OPERAND_DSP_8_S24 :
442 - long value;
443 + long value = 0;
444 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 24, 32, total_length, pc, & value);
445 value = ((((((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) & (255))) << (16))))) ^ (8388608))) - (8388608));
446 fields->f_dsp_8_s24 = value;
447 @@ -2251,7 +2251,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
448 break;
449 case M32C_OPERAND_DSP_8_U16 :
451 - long value;
452 + long value = 0;
453 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 16, 32, total_length, pc, & value);
454 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
455 fields->f_dsp_8_u16 = value;
456 @@ -2259,7 +2259,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
457 break;
458 case M32C_OPERAND_DSP_8_U24 :
460 - long value;
461 + long value = 0;
462 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 24, 32, total_length, pc, & value);
463 value = ((((((USI) (value) >> (16))) | (((value) & (65280))))) | (((((value) & (255))) << (16))));
464 fields->f_dsp_8_u24 = value;
465 @@ -2343,7 +2343,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
466 break;
467 case M32C_OPERAND_DST32RNPREFIXEDHI :
469 - long value;
470 + long value = 0;
471 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value);
472 value = ((((value) + (2))) % (4));
473 fields->f_dst32_rn_prefixed_HI = value;
474 @@ -2351,7 +2351,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
475 break;
476 case M32C_OPERAND_DST32RNPREFIXEDQI :
478 - long value;
479 + long value = 0;
480 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value);
481 value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
482 fields->f_dst32_rn_prefixed_QI = value;
483 @@ -2359,7 +2359,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
484 break;
485 case M32C_OPERAND_DST32RNPREFIXEDSI :
487 - long value;
488 + long value = 0;
489 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value);
490 value = ((value) - (2));
491 fields->f_dst32_rn_prefixed_SI = value;
492 @@ -2367,7 +2367,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
493 break;
494 case M32C_OPERAND_DST32RNUNPREFIXEDHI :
496 - long value;
497 + long value = 0;
498 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value);
499 value = ((((value) + (2))) % (4));
500 fields->f_dst32_rn_unprefixed_HI = value;
501 @@ -2375,7 +2375,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
502 break;
503 case M32C_OPERAND_DST32RNUNPREFIXEDQI :
505 - long value;
506 + long value = 0;
507 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value);
508 value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
509 fields->f_dst32_rn_unprefixed_QI = value;
510 @@ -2383,7 +2383,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
511 break;
512 case M32C_OPERAND_DST32RNUNPREFIXEDSI :
514 - long value;
515 + long value = 0;
516 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value);
517 value = ((value) - (2));
518 fields->f_dst32_rn_unprefixed_SI = value;
519 @@ -2402,7 +2402,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
520 break;
521 case M32C_OPERAND_IMM_16_HI :
523 - long value;
524 + long value = 0;
525 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, pc, & value);
526 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
527 fields->f_dsp_16_s16 = value;
528 @@ -2414,14 +2414,14 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
529 case M32C_OPERAND_IMM_16_SI :
532 - long value;
533 + long value = 0;
534 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
535 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
536 fields->f_dsp_16_u16 = value;
538 if (length <= 0) break;
540 - long value;
541 + long value = 0;
542 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value);
543 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
544 fields->f_dsp_32_u16 = value;
545 @@ -2454,7 +2454,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
546 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
547 if (length <= 0) break;
549 - long value;
550 + long value = 0;
551 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 24, 32, total_length, pc, & value);
552 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
553 fields->f_dsp_32_u24 = value;
554 @@ -2467,7 +2467,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
555 break;
556 case M32C_OPERAND_IMM_32_HI :
558 - long value;
559 + long value = 0;
560 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 16, 32, total_length, pc, & value);
561 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
562 fields->f_dsp_32_s16 = value;
563 @@ -2486,7 +2486,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
564 break;
565 case M32C_OPERAND_IMM_40_HI :
567 - long value;
568 + long value = 0;
569 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 8, 16, 32, total_length, pc, & value);
570 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
571 fields->f_dsp_40_s16 = value;
572 @@ -2498,7 +2498,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
573 case M32C_OPERAND_IMM_40_SI :
576 - long value;
577 + long value = 0;
578 length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 24, 32, total_length, pc, & value);
579 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
580 fields->f_dsp_40_u24 = value;
581 @@ -2513,7 +2513,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
582 break;
583 case M32C_OPERAND_IMM_48_HI :
585 - long value;
586 + long value = 0;
587 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 16, 16, 32, total_length, pc, & value);
588 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
589 fields->f_dsp_48_s16 = value;
590 @@ -2525,14 +2525,14 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
591 case M32C_OPERAND_IMM_48_SI :
594 - long value;
595 + long value = 0;
596 length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value);
597 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
598 fields->f_dsp_48_u16 = value;
600 if (length <= 0) break;
602 - long value;
603 + long value = 0;
604 length = extract_normal (cd, ex_info, insn_value, 0, 64, 0, 16, 32, total_length, pc, & value);
605 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
606 fields->f_dsp_64_u16 = value;
607 @@ -2567,7 +2567,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
608 break;
609 case M32C_OPERAND_IMM_8_HI :
611 - long value;
612 + long value = 0;
613 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 16, 32, total_length, pc, & value);
614 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
615 fields->f_dsp_8_s16 = value;
616 @@ -2593,7 +2593,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
617 break;
618 case M32C_OPERAND_IMM1_S :
620 - long value;
621 + long value = 0;
622 length = extract_normal (cd, ex_info, insn_value, 0, 0, 2, 1, 32, total_length, pc, & value);
623 value = ((value) + (1));
624 fields->f_imm1_S = value;
625 @@ -2612,7 +2612,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
626 break;
627 case M32C_OPERAND_LAB_16_8 :
629 - long value;
630 + long value = 0;
631 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 16, 8, 32, total_length, pc, & value);
632 value = ((value) + (((pc) + (2))));
633 fields->f_lab_16_8 = value;
634 @@ -2620,7 +2620,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
635 break;
636 case M32C_OPERAND_LAB_24_8 :
638 - long value;
639 + long value = 0;
640 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 24, 8, 32, total_length, pc, & value);
641 value = ((value) + (((pc) + (2))));
642 fields->f_lab_24_8 = value;
643 @@ -2628,7 +2628,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
644 break;
645 case M32C_OPERAND_LAB_32_8 :
647 - long value;
648 + long value = 0;
649 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 32, 0, 8, 32, total_length, pc, & value);
650 value = ((value) + (((pc) + (2))));
651 fields->f_lab_32_8 = value;
652 @@ -2636,7 +2636,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
653 break;
654 case M32C_OPERAND_LAB_40_8 :
656 - long value;
657 + long value = 0;
658 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 32, 8, 8, 32, total_length, pc, & value);
659 value = ((value) + (((pc) + (2))));
660 fields->f_lab_40_8 = value;
661 @@ -2644,7 +2644,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
662 break;
663 case M32C_OPERAND_LAB_5_3 :
665 - long value;
666 + long value = 0;
667 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_PCREL_ADDR), 0, 5, 3, 32, total_length, pc, & value);
668 value = ((value) + (((pc) + (2))));
669 fields->f_lab_5_3 = value;
670 @@ -2652,7 +2652,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
671 break;
672 case M32C_OPERAND_LAB_8_16 :
674 - long value;
675 + long value = 0;
676 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGN_OPT)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 16, 32, total_length, pc, & value);
677 value = ((((((((((USI) (((value) & (65280))) >> (8))) | (((((value) & (255))) << (8))))) ^ (32768))) - (32768))) + (((pc) + (1))));
678 fields->f_lab_8_16 = value;
679 @@ -2660,7 +2660,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
680 break;
681 case M32C_OPERAND_LAB_8_24 :
683 - long value;
684 + long value = 0;
685 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_ABS_ADDR), 0, 8, 24, 32, total_length, pc, & value);
686 value = ((((((USI) (value) >> (16))) | (((value) & (65280))))) | (((((value) & (255))) << (16))));
687 fields->f_lab_8_24 = value;
688 @@ -2668,7 +2668,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
689 break;
690 case M32C_OPERAND_LAB_8_8 :
692 - long value;
693 + long value = 0;
694 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 8, 32, total_length, pc, & value);
695 value = ((value) + (((pc) + (1))));
696 fields->f_lab_8_8 = value;
697 @@ -2757,7 +2757,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
698 break;
699 case M32C_OPERAND_SRC32RNPREFIXEDHI :
701 - long value;
702 + long value = 0;
703 length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 2, 32, total_length, pc, & value);
704 value = ((((value) + (2))) % (4));
705 fields->f_src32_rn_prefixed_HI = value;
706 @@ -2765,7 +2765,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
707 break;
708 case M32C_OPERAND_SRC32RNPREFIXEDQI :
710 - long value;
711 + long value = 0;
712 length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 2, 32, total_length, pc, & value);
713 value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
714 fields->f_src32_rn_prefixed_QI = value;
715 @@ -2773,7 +2773,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
716 break;
717 case M32C_OPERAND_SRC32RNPREFIXEDSI :
719 - long value;
720 + long value = 0;
721 length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 2, 32, total_length, pc, & value);
722 value = ((value) - (2));
723 fields->f_src32_rn_prefixed_SI = value;
724 @@ -2781,7 +2781,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
725 break;
726 case M32C_OPERAND_SRC32RNUNPREFIXEDHI :
728 - long value;
729 + long value = 0;
730 length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & value);
731 value = ((((value) + (2))) % (4));
732 fields->f_src32_rn_unprefixed_HI = value;
733 @@ -2789,7 +2789,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
734 break;
735 case M32C_OPERAND_SRC32RNUNPREFIXEDQI :
737 - long value;
738 + long value = 0;
739 length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & value);
740 value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
741 fields->f_src32_rn_unprefixed_QI = value;
742 @@ -2797,7 +2797,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
743 break;
744 case M32C_OPERAND_SRC32RNUNPREFIXEDSI :
746 - long value;
747 + long value = 0;
748 length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & value);
749 value = ((value) - (2));
750 fields->f_src32_rn_unprefixed_SI = value;
751 --- binutils.orig/binutils/srconv.c 2020-06-16 17:10:22.251564474 +0100
752 +++ binutils-2.34.0/binutils/srconv.c 2020-06-16 20:07:51.670025912 +0100
753 @@ -492,6 +492,8 @@ wr_rl (struct coff_ofile *ptr ATTRIBUTE_
754 rl.addr = r->offset;
755 rl.bitloc = 0;
756 rl.flen = 32; /* SH Specific. */
757 + rl.dunno = 0;
758 + rl.symn = 0;
760 /* What sort of reloc ? Look in the section to find out. */
761 ref = r->symbol;
762 --- binutils.orig/libctf/ctf-create.c 2020-07-24 15:33:26.100996335 +0100
763 +++ binutils-2.35/libctf/ctf-create.c 2020-07-24 15:33:29.042977475 +0100
764 @@ -1257,6 +1257,8 @@ ctf_add_forward (ctf_file_t *fp, uint32_
766 if ((type = ctf_add_generic (fp, flag, name, kind, &dtd)) == CTF_ERR)
767 return CTF_ERR; /* errno is set for us. */
768 + if (dtd == NULL)
769 + return CTF_ERR;
771 dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_FORWARD, flag, 0);
772 dtd->dtd_data.ctt_type = kind;