gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / bfd / ChangeLog
1 2020-06-03 Stephen Casner <casner@acm.org>
2
3 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
4
5 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
6 files with relocs.
7 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
8 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
9 other size that doesn't qcover the header word.
10 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
11 string table, and zero it.
12 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
13 message and set bfd_error on finding an invalid name string offset.
14 (add_to_stringtab): INLINE -> inline
15 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
16 bound check.
17 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
18 any relocs that could not be recognised.
19 92744f05809 PR 20929 - Check for relocs without an associated symbol.
20 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
21 name exists and is long enough, before attempting to see if it is
22 for a .o file.
23 c3864421222 - Correct case for N_SO being the last symbol.
24 50455f1ab29 PR 20891 - Handle the case where the main file name
25 and the directory name are both empty.
26 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
27 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
28 range string table offsets.
29 531336e3a0b PR 20909 - Fix off-by-one error in check for an
30 illegal string offset.
31 (aout_link_includes_newfunc): Add comment.
32 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
33 on unexpected relocation type rather than ASSERT.
34
35 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
36
37 PR ld/26066
38 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
39 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
40
41 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
42
43 PR ld/26066
44 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
45 non-alloced sections.
46
47 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
48
49 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
50 dynamic relocations for non SEC_ALLOC sections.
51
52 2020-06-03 Gunther Nikl <gnikl@justmail.de>
53
54 * aout64.c (BMAGIC, QMAGIC): Do not define.
55 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
56 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
57 to check the file format.
58 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
59 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
60 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
61
62 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
63
64 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
65 relocations for non SEC_ALLOC sections.
66
67 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
68
69 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
70 * elf32-arm.c (maybe_set_textrel): Removed.
71 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
72 with _bfd_elf_maybe_set_textrel.
73 * elf32-csky.c (maybe_set_textrel): Removed.
74 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
75 with _bfd_elf_maybe_set_textrel.
76 * elf32-hppa.c (maybe_set_textrel): Removed.
77 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
78 with _bfd_elf_maybe_set_textrel.
79 * elf32-lm32.c (maybe_set_textrel): Removed.
80 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
81 with _bfd_elf_maybe_set_textrel.
82 * elf32-m32r.c (maybe_set_textrel): Removed.
83 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
84 with _bfd_elf_maybe_set_textrel.
85 * elf32-metag.c (maybe_set_textrel): Removed.
86 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
87 with _bfd_elf_maybe_set_textrel.
88 * elf32-nds32.c (maybe_set_textrel): Removed.
89 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
90 with _bfd_elf_maybe_set_textrel.
91 * elf32-or1k.c (maybe_set_textrel): Removed.
92 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
93 with _bfd_elf_maybe_set_textrel.
94 * elf32-ppc.c (maybe_set_textrel): Removed.
95 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
96 with _bfd_elf_maybe_set_textrel.
97 * elf32-s390.c (maybe_set_textrel): Removed.
98 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
99 with _bfd_elf_maybe_set_textrel.
100 * elf32-sh.c (maybe_set_textrel): Removed.
101 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
102 with _bfd_elf_maybe_set_textrel.
103 * elf32-tic6x.c (maybe_set_textrel): Removed.
104 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
105 with _bfd_elf_maybe_set_textrel.
106 * elf32-tilepro.c (maybe_set_textrel): Removed.
107 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
108 with _bfd_elf_maybe_set_textrel.
109 * elf64-ppc.c (maybe_set_textrel): Removed.
110 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
111 with _bfd_elf_maybe_set_textrel.
112 * elf64-s390.c (maybe_set_textrel): Removed.
113 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
114 with _bfd_elf_maybe_set_textrel.
115 * elfnn-aarch64.c (maybe_set_textrel): Removed.
116 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
117 with _bfd_elf_maybe_set_textrel.
118 * elfnn-riscv.c (maybe_set_textrel): Removed.
119 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
120 with _bfd_elf_maybe_set_textrel.
121 * elfxx-sparc.c (maybe_set_textrel): Removed.
122 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
123 with _bfd_elf_maybe_set_textrel.
124 * elfxx-tilegx.c (maybe_set_textrel): Removed.
125 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
126 with _bfd_elf_maybe_set_textrel.
127 * elfxx-x86.c (maybe_set_textrel): Removed.
128 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
129 with _bfd_elf_maybe_set_textrel.
130 * elflink.c (_bfd_elf_maybe_set_textrel): New.
131
132 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
133
134 PR ld/26067
135 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
136 dyn_relocs.
137 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
138 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
139 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
140 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
141 Likewise.
142 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
143 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
144 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
145 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
146 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
147 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
148 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
149 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
150 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
151 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
152 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
153 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
154 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
155 (elf_backend_copy_indirect_symbol): Likewise.
156 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
157 (elf_backend_copy_indirect_symbol): Likewise.
158 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
159
160 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
161
162 PR ld/26067
163 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
164 * elf32-arm.c (readonly_dynrelocs): Removed.
165 (maybe_set_textrel): Replace readonly_dynrelocs with
166 _bfd_elf_readonly_dynrelocs.
167 * elf32-csky.c (readonly_dynrelocs): Removed.
168 (maybe_set_textrel): Replace readonly_dynrelocs with
169 _bfd_elf_readonly_dynrelocs.
170 * elf32-hppa.c(readonly_dynrelocs): Removed.
171 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
172 _bfd_elf_readonly_dynrelocs.
173 (maybe_set_textrel): Likewise.
174 * elf32-lm32.c (readonly_dynrelocs): Removed.
175 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
176 with _bfd_elf_readonly_dynrelocs.
177 (maybe_set_textrel): Likewise.
178 * elf32-m32r.c (readonly_dynrelocs): Removed.
179 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
180 with _bfd_elf_readonly_dynrelocs.
181 (maybe_set_textrel): Likewise.
182 * elf32-metag.c (readonly_dynrelocs): Removed.
183 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
184 with _bfd_elf_readonly_dynrelocs.
185 (maybe_set_textrel): Likewise.
186 * elf32-microblaze.c (readonly_dynrelocs): Removed.
187 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
188 with _bfd_elf_readonly_dynrelocs.
189 * elf32-nds32.c (readonly_dynrelocs): Removed.
190 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
191 with _bfd_elf_readonly_dynrelocs.
192 (maybe_set_textrel): Likewise.
193 * elf32-or1k.c (readonly_dynrelocs): Removed.
194 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
195 with _bfd_elf_readonly_dynrelocs.
196 * elf32-ppc.c (readonly_dynrelocs): Removed.
197 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
198 _bfd_elf_readonly_dynrelocs.
199 (ppc_elf_adjust_dynamic_symbol): Likewise.
200 (maybe_set_textrel): Likewise.
201 * elf32-s390.c (readonly_dynrelocs): Removed.
202 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
203 with _bfd_elf_readonly_dynrelocs.
204 (maybe_set_textrel): Likewise.
205 * elf32-sh.c (readonly_dynrelocs): Removed.
206 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
207 _bfd_elf_readonly_dynrelocs.
208 (maybe_set_textrel): Likewise.
209 * elf32-tic6x.c (readonly_dynrelocs): Removed.
210 (maybe_set_textrel): Replace readonly_dynrelocs with
211 _bfd_elf_readonly_dynrelocs.
212 * elf32-tilepro.c (readonly_dynrelocs): Removed.
213 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
214 with _bfd_elf_readonly_dynrelocs.
215 (maybe_set_textrel): Likewise.
216 * elf64-ppc.c (readonly_dynrelocs): Removed.
217 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
218 _bfd_elf_readonly_dynrelocs.
219 (ppc64_elf_adjust_dynamic_symbol): Likewise.
220 (maybe_set_textrel): Likewise.
221 * elf64-s390.c (readonly_dynrelocs): Removed.
222 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
223 with _bfd_elf_readonly_dynrelocs.
224 (maybe_set_textrel): Likewise.
225 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
226 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
227 (maybe_set_textrel): Replace readonly_dynrelocs with
228 _bfd_elf_readonly_dynrelocs.
229 * elfnn-riscv.c (readonly_dynrelocs): Removed.
230 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
231 with _bfd_elf_readonly_dynrelocs.
232 (maybe_set_textrel): Likewise.
233 * elfxx-sparc.c (readonly_dynrelocs): Removed.
234 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
235 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
236 (maybe_set_textrel): Likewise.
237 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
238 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
239 with _bfd_elf_readonly_dynrelocs.
240 (maybe_set_textrel): Likewise.
241 * elfxx-x86.c (readonly_dynrelocs): Removed.
242 (maybe_set_textrel): Replace readonly_dynrelocs with
243 _bfd_elf_readonly_dynrelocs.
244 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
245
246 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
247
248 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
249 -fsanitize=undefined.
250
251 2020-06-03 Alan Modra <amodra@gmail.com>
252
253 PR 26069
254 PR 18758
255 * peicode.h (pe_ILF_make_a_section): Align data for compilers
256 other than gcc.
257 (pe_ILF_build_a_bfd): Likewise.
258
259 2020-06-03 Alan Modra <amodra@gmail.com>
260
261 PR 26069
262 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
263 core files as well as objects.
264
265 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
266
267 PR ld/26067
268 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
269 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
270 Updated.
271 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
272 (elf_arc_link_hash_newfunc): Updated.
273 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
274 (elf32_arm_link_hash_newfunc): Updated.
275 (elf32_arm_copy_indirect_symbol): Likewise.
276 (elf32_arm_check_relocs): Likewise.
277 (readonly_dynrelocs): Likewise.
278 (allocate_dynrelocs_for_symbol): Likewise.
279 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
280 (csky_elf_link_hash_newfunc): Updated.
281 (csky_allocate_dynrelocs): Likewise.
282 (readonly_dynrelocs): Likewise.
283 (csky_elf_copy_indirect_symbol): Likewise.
284 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
285 (hppa_link_hash_newfunc): Updated.
286 (elf32_hppa_copy_indirect_symbol): Likewise.
287 (elf32_hppa_hide_symbol): Likewise.
288 (elf32_hppa_adjust_dynamic_symbol): Likewise.
289 (allocate_dynrelocs): Likewise.
290 (elf32_hppa_relocate_section): Likewise.
291 * elf32-i386.c (elf_i386_check_relocs): Likewise.
292 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
293 (lm32_elf_link_hash_newfunc): Likewise.
294 (lm32_elf_link_hash_table_create): Updated.
295 (readonly_dynrelocs): Likewise.
296 (allocate_dynrelocs): Likewise.
297 (lm32_elf_copy_indirect_symbol): Likewise.
298 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
299 (m32r_elf_link_hash_newfunc): Likewise.
300 (m32r_elf_link_hash_table_create): Updated.
301 (m32r_elf_copy_indirect_symbol): Likewise.
302 (allocate_dynrelocs): Likewise.
303 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
304 (metag_link_hash_newfunc): Updated.
305 (elf_metag_copy_indirect_symbol): Likewise.
306 (readonly_dynrelocs): Likewise.
307 (allocate_dynrelocs): Likewise.
308 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
309 dyn_relocs.
310 (link_hash_newfunc): Updated.
311 (microblaze_elf_check_relocs): Likewise.
312 (microblaze_elf_copy_indirect_symbol): Likewise.
313 (readonly_dynrelocs): Likewise.
314 (allocate_dynrelocs): Likewise.
315 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
316 (nds32_elf_link_hash_newfunc): Updated.
317 (nds32_elf_copy_indirect_symbol): Likewise.
318 (readonly_dynrelocs): Likewise.
319 (allocate_dynrelocs): Likewise.
320 (nds32_elf_check_relocs): Likewise.
321 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
322 (link_hash_newfunc): Updated.
323 (nios2_elf32_copy_indirect_symbol): Likewise.
324 (nios2_elf32_check_relocs): Likewise.
325 (allocate_dynrelocs): Likewise.
326 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
327 (or1k_elf_link_hash_newfunc): Updated.
328 (readonly_dynrelocs): Likewise.
329 (allocate_dynrelocs): Likewise.
330 (or1k_elf_copy_indirect_symbol): Likewise.
331 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
332 (ppc_elf_link_hash_newfunc): Updated.
333 (ppc_elf_copy_indirect_symbol): Likewise.
334 (ppc_elf_check_relocs): Likewise.
335 (readonly_dynrelocs): Likewise.
336 (ppc_elf_adjust_dynamic_symbol): Likewise.
337 (allocate_dynrelocs): Likewise.
338 (ppc_elf_relocate_section): Likewise.
339 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
340 (link_hash_newfunc): Updated.
341 (elf_s390_copy_indirect_symbol): Likewise.
342 (readonly_dynrelocs): Likewise.
343 (elf_s390_adjust_dynamic_symbol): Likewise.
344 (allocate_dynrelocs): Likewise.
345 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
346 (sh_elf_link_hash_newfunc): Updated.
347 (readonly_dynrelocs): Likewise.
348 (allocate_dynrelocs): Likewise.
349 (sh_elf_copy_indirect_symbol): Likewise.
350 (sh_elf_check_relocs): Likewise.
351 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
352 (elf32_tic6x_link_hash_newfunc): Likewise.
353 (elf32_tic6x_link_hash_table_create): Updated.
354 (readonly_dynrelocs): Likewise.
355 (elf32_tic6x_check_relocs): Likewise.
356 (elf32_tic6x_allocate_dynrelocs): Likewise.
357 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
358 dyn_relocs.
359 (link_hash_newfunc): Updated.
360 (tilepro_elf_copy_indirect_symbol): Likewise.
361 (tilepro_elf_check_relocs): Likewise.
362 (allocate_dynrelocs): Likewise.
363 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
364 (ppc64_elf_copy_indirect_symbol): Updated.
365 (ppc64_elf_check_relocs): Likewise.
366 (readonly_dynrelocs): Likewise.
367 (ppc64_elf_adjust_dynamic_symbol): Likewise.
368 (dec_dynrel_count): Likewise.
369 (allocate_dynrelocs): Likewise.
370 (ppc64_elf_relocate_section): Likewise.
371 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
372 (link_hash_newfunc): Updated.
373 (elf_s390_copy_indirect_symbol): Likewise.
374 (readonly_dynrelocs): Likewise.
375 (allocate_dynrelocs): Likewise.
376 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
377 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
378 dyn_relocs.
379 (elfNN_aarch64_link_hash_newfunc): Updated.
380 (elfNN_aarch64_copy_indirect_symbol): Likewise.
381 (readonly_dynrelocs): Likewise.
382 (need_copy_relocation_p): Likewise.
383 (elfNN_aarch64_allocate_dynrelocs): Likewise.
384 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
385 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
386 (link_hash_newfunc): Updated.
387 (riscv_elf_copy_indirect_symbol): Likewise.
388 (riscv_elf_check_relocs): Likewise.
389 (readonly_dynrelocs): Likewise.
390 (allocate_dynrelocs): Likewise.
391 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
392 dyn_relocs.
393 (link_hash_newfunc): Updated.
394 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
395 (_bfd_sparc_elf_check_relocs): Likewise.
396 (readonly_dynrelocs): Likewise.
397 (allocate_dynrelocs): Likewise.
398 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
399 (link_hash_newfunc): Updated.
400 (tilegx_elf_copy_indirect_symbol): Likewise.
401 (tilegx_elf_check_relocs): Likewise.
402 (readonly_dynrelocs): Likewise.
403 (allocate_dynrelocs): Likewise.
404 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
405 (readonly_dynrelocs): Likewise.
406 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
407 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
408
409 2020-06-01 Alan Modra <amodra@gmail.com>
410
411 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
412 command against cmd_length, not the end of record. For
413 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
414 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
415 cmd_length test.
416
417 2020-05-28 David Faust <david.faust@oracle.com>
418
419 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
420 R_BPF_INSN_{32,64} relocations.
421
422 2020-05-28 Stephen Casner <casner@acm.org>
423
424 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
425 addreses in .long (used in testsuites) and .stab values.
426
427 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
428
429 PR ld/22909
430 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
431 Check bfd_link_dll when issue a DT_TEXTREL warning.
432 * elfxx-x86.c (maybe_set_textrel): Likewise.
433 (_bfd_x86_elf_size_dynamic_sections): Likewise.
434
435 2020-05-26 Nick Clifton <nickc@redhat.com>
436
437 * plugin.c (try_load_plugin): Extend error message when a plugin
438 fails to open.
439
440 2020-05-23 Alan Modra <amodra@gmail.com>
441
442 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
443
444 2020-05-22 Alan Modra <amodra@gmail.com>
445
446 PR 25882
447 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
448 attributes from shared libraries, and do not return an error if
449 they don't match.
450
451 2020-05-21 Alan Modra <amodra@gmail.com>
452
453 PR 25993
454 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
455 filename.
456 (_bfd_delete_bfd): Free the copy.
457 (_bfd_new_bfd): Free nbfd->memory on error.
458
459 2020-05-21 Alan Modra <amodra@gmail.com>
460
461 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
462 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
463 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
464 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
465 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
466 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
467 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
468 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
469 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
470 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
471 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
472 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
473 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
474 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
475 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
476 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
477 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
478 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
479 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
480 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
481
482 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
483
484 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
485 get_default_version. It is used to find the default version for
486 the specific extension.
487 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
488 default_major_version and default_minor_version. Add new bfd_boolean
489 parameter *use_default_version. Set it to TRUE if we need to call
490 the callback rps->get_default_version to find the default version.
491 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
492 the default version in riscv_parsing_subset_version, and then call
493 riscv_add_subset to add the subset into subset list.
494 (riscv_parse_prefixed_ext): Likewise.
495 (riscv_std_z_ext_strtab): Support Zicsr extensions.
496 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
497 strings rather than characters.
498 riscv_merge_arch_attr_info): The callback function get_default_version
499 is only needed for assembler, so set it to NULL int the linker.
500 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
501 * elfxx-riscv.h: Updated.
502
503 2020-05-20 Alan Modra <amodra@gmail.com>
504
505 PR 25993
506 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
507 use bfd_set_filename.
508 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
509 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
510 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
511 (bfd_create): Likewise.
512 (_bfd_delete_bfd): Don't free filename.
513 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
514 return pointer to the copy or NULL on alloc fail.
515 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
516 result of bfd_set_filename.
517 * bfd-in2.h: Regenerate.
518
519 2020-05-20 Alan Modra <amodra@gmail.com>
520
521 PR 26011
522 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
523 section size against file size.
524 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
525
526 2020-05-19 Gunther Nikl <gnikl@justmail.de>
527
528 PR 26005
529 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
530 and memset when allocating memory for the sections_being_created
531 array.
532
533 2020-05-19 Stafford Horne <shorne@gmail.com>
534
535 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
536 to relgot.
537 (or1k_elf_relocate_section): Access srelgot via
538 htab->root.srelgot. Add assertions for srelgot->contents.
539 Introduce local variable for srelgot to not reuse global
540 sreloc.
541 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
542 (or1k_set_got_and_rela_sizes): New function.
543 (or1k_initial_exec_offset): New function.
544 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
545 (or1k_elf_relocate_section): Allow for TLS to handle multiple
546 model access.
547 (or1k_elf_check_relocs): Use OR to set TLS access.
548 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
549 sizes.
550 (or1k_elf_size_dynamic_sections): Use
551 or1k_set_got_and_rela_sizes to set sizes.
552 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
553 (TCB_SIZE): New macro.
554 (tpoff): Use TCB_SIZE and alignment to calculate offset.
555 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
556 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
557 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
558 (tpoff): Add dynamic boolean argument.
559 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
560
561 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
562
563 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
564 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
565 cases with BFD_RELOC_AARCH64_JUMP26.
566 (elfNN_aarch64_check_relocs): Likewise.
567
568 2020-05-19 Alan Modra <amodra@gmail.com>
569
570 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
571 bfd_get_filename rather than accessing bfd->filename directly.
572 * aout-target.h (MY (object_p)): Likewise.
573 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
574 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
575 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
576 (_bfd_archive_bsd44_construct_extended_name_table),
577 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
578 (_bfd_bsd_write_armap): Likewise.
579 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
580 * cache.c (bfd_open_file): Likewise.
581 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
582 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
583 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
584 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
585 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
586 * elf32-nds32.c (nds32_elf_output_symbol_hook),
587 (patch_tls_desc_to_ie): Likewise.
588 * elf32-spu.c (sort_bfds, print_one_overlay_section),
589 (spu_elf_auto_overlay): Likewise.
590 * elf64-hppa.c (elf_hppa_final_link): Likewise.
591 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
592 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
593 * elflink.c (bfd_elf_size_dynamic_sections),
594 (elf_link_input_bfd): Likewise.
595 * linker.c (_bfd_generic_link_output_symbols): Likewise.
596 * mach-o.c (bfd_mach_o_follow_dsym),
597 (bfd_mach_o_close_and_cleanup): Likewise.
598 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
599 (find_separate_debug_file, get_build_id_name): Likewise.
600 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
601 * plugin.c (bfd_plugin_open_input): Likewise.
602 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
603 * som.c (som_write_armap): Likewise.
604 * srec.c (srec_write_record, srec_write_symbols): Likewise.
605 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
606 (_bfd_vms_lib_write_archive_contents): Likewise.
607 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
608
609 2020-05-19 Alan Modra <amodra@gmail.com>
610
611 PR 25713
612 * bfdio.c (_bfd_real_fopen): Typo fix.
613
614 2020-05-18 Nick Clifton <nickc@redhat.com>
615
616 PR 26005
617 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
618 for the sections_being_created array.
619
620 2020-05-18 Alan Modra <amodra@gmail.com>
621
622 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
623 they can be freed without also freeing internal_relocs.
624
625 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
626
627 PR 25713
628 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
629 separators into DOS style when creating a WIN32 fullpath.
630
631 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
632
633 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
634 to initialize RISC-V tdata.
635
636 2020-05-12 Gunther Nikl <gnikl@justmail.de>
637
638 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
639 relocation size.
640
641 2020-05-11 Alan Modra <amodra@gmail.com>
642
643 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
644
645 2020-05-11 Alan Modra <amodra@gmail.com>
646
647 * elf64-ppc.c: Rename powerxx to power10 throughout.
648
649 2020-05-11 Alan Modra <amodra@gmail.com>
650
651 PR 25961
652 * coffgen.c (coff_get_normalized_symtab): Check that buffer
653 contains required number of auxents before processing any auxent.
654 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
655 file name from auxents for PE.
656
657 2020-05-04 Gunther Nikl <gnikl@justmail.de>
658
659 * aout-cris.c (DEFAULT_ARCH): Delete define.
660 (MY_set_arch_mach): Likewise.
661 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
662 of bfd_arch_cris.
663 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
664 of r_type before the shift.
665
666 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
667
668 PR ld/25665
669 * elfnn-aarch64.c (group_sections): Copy implementation from
670 elf32-arm.c.
671
672 2020-05-01 Alan Modra <amodra@gmail.com>
673
674 PR 25900
675 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
676 accessing root.u.def of symbols. Also check root.u.def.section
677 is non-NULL. Reverse tests so as to make the logic positive.
678
679 2020-05-01 Alan Modra <amodra@gmail.com>
680
681 PR 25882
682 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
683 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
684
685 2020-05-01 Alan Modra <amodra@gmail.com>
686
687 PR 25882
688 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
689 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
690 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
691 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
692 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
693 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
694 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
695 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
696 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
697 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
698
699 2020-05-01 Alan Modra <amodra@gmail.com>
700
701 PR 25882
702 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
703 from shared libraries.
704
705 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
706
707 * elf32-xtensa.c (relax_section): Don't negate diff_value for
708 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
709 equals 0. Report overflow when the result has negative sign but
710 all significant bits are zero.
711
712 2020-04-29 Gunther Nikl <gnikl@justmail.de>
713
714 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
715 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
716
717 2020-04-28 Alan Modra <amodra@gmail.com>
718
719 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
720 Emit warning message.
721
722 2020-04-27 Tamar Christina <tamar.christina@arm.com>
723
724 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
725 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
726 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
727 to x86_64_pe_big_vec as it not a big-endian format.
728 (vec i386_pe_big_vec): New.
729 * configure.ac: Likewise.
730 * targets.c: Likewise.
731 * configure: Regenerate.
732 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
733 COFF_WITH_PE_BIGOBJ): New.
734 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
735 New.
736 (x86_64_pe_be_vec): Moved.
737
738 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
739
740 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
741 * elf.c (elfcore_grok_arc_v2): New function.
742 (elfcore_grok_note): Call the new function to handle the corresponding
743 note.
744 (elfcore_write_arc_v2): New function.
745 (elfcore_write_register_note): Call the new function to handle the
746 corresponding pseudo-sections.
747
748 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
749
750 PR ld/25861
751 * bfd-in2.h: Regenerated.
752 * elf32-xtensa.c (elf_howto_table): New entries for
753 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
754 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
755 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
756 R_XTENSA_NDIFF{8,16,32}.
757 * libbfd.h (bfd_reloc_code_real_names): Add names for
758 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
759 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
760 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
761 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
762
763 2020-04-21 Tamar Christina <tamar.christina@arm.com>
764
765 PR binutils/24753
766 * compress.c (bfd_get_full_section_contents): Exclude sections with no
767 content.
768
769 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
770
771 PR ld/25849
772 * elf-bfd.h (elf_backend_data): Add
773 elf_backend_strip_zero_sized_dynamic_sections.
774 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
775 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
776 New macro.
777 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
778 function.
779 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
780 New macro.
781 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
782
783 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
784
785 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
786 sec.
787 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
788 DT_TEXTREL with -M.
789 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
790
791 2020-04-21 Nick Clifton <nickc@redhat.com>
792
793 * po/sr.po: Updated Serbian translation.
794
795 2020-04-21 Alan Modra <amodra@gmail.com>
796
797 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
798 processing.
799
800 2020-04-20 Stephen Casner <casner@acm.org>
801
802 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
803 causing globals from linker script to be treated as debug symbols.
804 (translate_symbol_table): Don't sign-extend symbol values from 16
805 to 64 bits in nm output.
806
807 2020-04-20 Alan Modra <amodra@gmail.com>
808
809 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
810
811 2020-04-18 Alan Modra <amodra@gmail.com>
812
813 * section.c (bfd_is_const_section): Correct test for special
814 sections.
815 * bfd-in2.h: Regenerate.
816
817 2020-04-17 Alan Modra <amodra@gmail.com>
818
819 PR 25842
820 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
821 NULL nodename.
822
823 2020-04-16 Nick Clifton <nickc@redhat.com>
824
825 PR 25803
826 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
827 abort with a more helpful error message.
828
829 2020-04-16 Alan Modra <amodra@gmail.com>
830
831 PR 25827
832 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
833 strdup(0).
834
835 2020-04-15 Fangrui Song <maskray@google.com>
836
837 PR binutils/24613
838 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
839 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
840 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
841 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
842 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
843 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
844 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
845 * elf32-sh.c (sh_elf_relocate_section): Likewise.
846 * elf32-spu.c (spu_elf_relocate_section): Likewise.
847 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
848 * elflink.c (elf_link_output_extsym): Likewise.
849 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
850
851 2020-04-15 Alan Modra <amodra@gmail.com>
852
853 PR 25823
854 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
855 pointer into strings that may be freed for section name, always
856 allocate a new string.
857
858 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
859 Jan W. Jagersma <jwjagersma@gmail.com>
860
861 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
862 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
863 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
864 (_bfd_go32_mkobject): New functions.
865 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
866 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
867 (go32exe_mkobject): Call _bfd_go32_mkobject.
868 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
869 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
870 and COFF_GO32.
871 (coff_write_relocs): Enable extended reloc counter code if
872 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
873 (coff_write_object_contents): Likewise. Pad section headers
874 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
875 instead of coff_swap_scnhdr_out.
876 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
877 enable extended reloc counter.
878 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
879 Declare with ATTRIBUTE_UNUSED.
880 * libcoff-in.h: (struct coff_tdata): New field go32.
881 (obj_go32): Define.
882 * libcoff.h: Regenerate.
883
884 2020-04-14 Fangrui Song <maskray@google.com>
885
886 PR gas/25768
887 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
888 12.
889
890 2020-04-14 Stephen Casner <casner@acm.org>
891
892 PR ld/25677
893 * pdp11.c: Add implementation of --imagic option.
894 (adjust_o_magic): Fix objcopy --extract-symbol test.
895 * libaout.h (enum aout_magic): Add i_magic.
896
897 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
898 Nick Clifton <nickc@redhat.com>
899
900 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
901 <0>: Ignore.
902 <default>: Error rather than abort.
903
904 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
905
906 PR ld/25767
907 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
908 relocation section from section group.
909
910 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
911
912 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
913 bfd->origin to file offset.
914 * bfdwin.c (bfd_get_file_window): Likewise.
915 * bfd.c: Clarify the use of the bfd->origin field.
916 * bfd-in2.h: Regenerate.
917 * coff-i386.c: Don't include go32exe.h. Allow overriding
918 coff_write_object_contents via COFF_WRITE_CONTENTS.
919 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
920 (go32exe_write_object_contents): New functions.
921 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
922 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
923 (create_go32_stub): Remove check for 2k size limit. Read stub
924 from go32exe_temp_stub if present.
925 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
926 copy variable-length stub.
927 (go32_check_format): Read stub to go32exe_temp_stub, set
928 origin, return go32exe_cleanup.
929 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
930 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
931 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
932 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
933 Remove functions and their associated #defines.
934 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
935 * libcoff-in.h: (struct coff_tdata): New field stub_size.
936 Rename field go32stub to stub.
937 * libcoff.h: Regenerate.
938 * coff-stgo32.c (go32_check_format): Rename to...
939 (go32exe_check_format): ...this.
940 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
941 (go32exe_copy_private_bfd_data): ...this.
942 (stub_bytes): Rename to...
943 (go32exe_default_stub): ...this.
944 (create_go32_stub): Rename to...
945 (go32exe_create_stub): ...this.
946 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
947 when possible.
948
949 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
950
951 PR ld/25749
952 PR ld/25754
953 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
954 relocation to R_386_32 for relocation against non-preemptible
955 absolute symbol.
956 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
957 allocate dynamic relocation for non-preemptible absolute symbol.
958 (elf_i386_relocate_section): Pass sec to
959 GENERATE_DYNAMIC_RELOCATION_P.
960 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
961 (elf_x86_64_convert_load_reloc): Covert load relocation to
962 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
963 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
964 for non-preemptible absolute symbol if they overflow.
965 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
966 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
967 symbol. Don't allocate dynamic relocation for non-preemptible
968 absolute symbol.
969 (elf_x86_64_relocate_section): Don't generate relative relocation
970 for GOTPCREL relocations aganst local absolute symbol. Pass sec
971 to GENERATE_DYNAMIC_RELOCATION_P.
972 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
973 against non-preemptible absolute symbol.
974 (_bfd_elf_x86_valid_reloc_p): New function.
975 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
976 GOT_ABS GOT slot.
977 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
978 argument. Don't generate dynamic relocation against
979 non-preemptible absolute symbol.
980 (ABS_SYMBOL_P): New.
981 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
982 against non-preemptible absolute symbol.
983 (GOT_ABS): New.
984 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
985 (_bfd_elf_x86_valid_reloc_p): New.
986
987 2020-04-01 Tamar Christina <tamar.christina@arm.com>
988
989 PR ld/16017
990 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
991 address in the GOT if in thumb only mode.
992
993 2020-04-01 Tamar Christina <tamar.christina@arm.com>
994
995 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
996
997 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
998
999 * mmo.c (mmo_scan): Create .text section only when needed, not
1000 from the start.
1001
1002 2020-03-31 Alan Modra <amodra@gmail.com>
1003
1004 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
1005 return value check.
1006
1007 2020-03-31 Alan Modra <amodra@gmail.com>
1008
1009 * vms-alpha.c (image_write): Check bounds for sections without
1010 contents too. Error on non-zero write to section without
1011 contents.
1012 (_bfd_vms_slurp_etir): Check return of image_write* functions.
1013
1014 2020-03-31 Alan Modra <amodra@gmail.com>
1015
1016 * tekhex.c (pass_over): Check is_eof before reading buffer.
1017
1018 2020-03-30 Nick Clifton <nickc@redhat.com>
1019
1020 PR binutils/pr25662
1021 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
1022 field to timestamp and make it an integer.
1023 * libcoff.h: Regenerate.
1024 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
1025 field in the pe_data structure rather than the insert_timestamp
1026 field.
1027
1028 2020-03-30 Alan Modra <amodra@gmail.com>
1029
1030 PR 25745
1031 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
1032 statistics message.
1033
1034 2020-03-26 Nick Clifton <nickc@redhat.com>
1035
1036 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
1037 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
1038 prototype.
1039 * libbfd.h: Regenerate.
1040
1041 2020-03-26 Alan Modra <amodra@gmail.com>
1042
1043 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
1044
1045 2020-03-26 Alan Modra <amodra@gmail.com>
1046
1047 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
1048 array.
1049 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
1050
1051 2020-03-25 Nick Clifton <nickc@redhat.com>
1052
1053 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
1054 function.
1055 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
1056 * libbfd.h: Regenerate.
1057
1058 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
1059
1060 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
1061 correct field name in the output string.
1062
1063 2020-03-25 Alan Modra <amodra@gmail.com>
1064
1065 PR 25662
1066 * elf.c (assign_file_positions_for_load_sections): Adjust offset
1067 for SHT_NOBITS section if first in segment.
1068
1069 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1070
1071 PR binutils/25708
1072 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
1073 (_bfd_elf_get_symbol_version_string): This.
1074 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
1075 (_bfd_elf_get_symbol_version_string): This.
1076 (bfd_elf_print_symbol): Pass TRUE to
1077 _bfd_elf_get_symbol_version_string.
1078 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
1079 bfd_boolean argument.
1080 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
1081 * targets.c (_bfd_get_symbol_version_string): Likewise.
1082 (bfd_get_symbol_version_string): Likewise.
1083 * bfd-in2.h: Regenerated.
1084
1085 2020-03-24 Nick Clifton <nickc@redhat.com>
1086 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1087
1088 PR 25713
1089 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
1090 Win32 systems.
1091
1092 2020-03-24 Nick Clifton <nickc@redhat.com>
1093
1094 PR 25681
1095 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
1096 segment to use for PT_GNU_RELRO, ignore empty sections in a
1097 segment's current list.
1098
1099 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1100
1101 PR binutils/25717
1102 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
1103
1104 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1105
1106 PR binutils/25708
1107 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
1108 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
1109 on the previous _bfd_elf_get_symbol_version_string.
1110 (_bfd_elf_get_symbol_version_string): Use it.
1111
1112 2020-03-24 Alan Modra <amodra@gmail.com>
1113
1114 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
1115 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
1116 struct areltdata.
1117
1118 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
1119
1120 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
1121
1122 2020-03-23 Alan Modra <amodra@gmail.com>
1123
1124 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
1125 symbol count. Allocate an extra byte to ensure name strings
1126 are terminated. Sanity check name offsets. Release memory on
1127 error return.
1128
1129 2020-03-23 Alan Modra <amodra@gmail.com>
1130
1131 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
1132 field hasn't been read. Remove unnecessary casts.
1133
1134 2020-03-22 Alan Modra <amodra@gmail.com>
1135
1136 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
1137 enough to read number of symbols.
1138
1139 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
1140
1141 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
1142 (EXECUTABLE_SUFFIX): Likewise.
1143 * config.in: Regenerated.
1144 * configure: Likewise.
1145 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
1146 _bfd_generic_close_and_cleanup.
1147 (plugin_list_entry): Remove resolution_file, resolution_option,
1148 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
1149 lto_wrapper, gcc_env and initialized,
1150 (need_lto_wrapper_p): Removed.
1151 (get_lto_wrapper): Likewise.
1152 (setup_lto_wrapper_env): Likewise.
1153 (register_all_symbols_read): Likewise.
1154 (egister_cleanup): Likewise.
1155 (get_symbols): Likewise.
1156 (add_input_file): Likewise.
1157 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
1158 (add_symbols): Updated.
1159 (try_claim): Likewise.
1160 (try_load_plugin): Likewise.
1161 (bfd_plugin_canonicalize_symtab): Likewise.
1162 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
1163 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
1164
1165 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
1166
1167 PR binutils/25640
1168 * plugin.c (plugin_list_entry): Add has_symbol_type.
1169 (add_symbols_v2): New function.
1170 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
1171 provides symbol type.
1172 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
1173 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
1174 available.
1175
1176 2020-03-20 Alan Modra <amodra@gmail.com>
1177
1178 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
1179 enough to read number of symbols.
1180
1181 2020-03-20 Alan Modra <amodra@gmail.com>
1182
1183 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
1184 backend functions for NULL before calling.
1185 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
1186 (bfd_section_from_shdr, assign_section_numbers): Likewise.
1187 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
1188 * elfnn-ia64.c (ignore_errors): New function.
1189 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
1190
1191 2020-03-19 Nick Clifton <nickc@redhat.com>
1192
1193 PR 25676
1194 * dwarf2.c (struct varinfo): Add unit_offset field to record the
1195 location of the varinfo in the unit's debug info data. Change the
1196 type of the stack field to a boolean.
1197 (lookup_var_by_offset): New function. Returns the varinfo
1198 structure for the variable described at the given offset in the
1199 unit's debug info.
1200 (scan_unit_for_symbols): Add support for variables which have the
1201 DW_AT_specification attribute.
1202
1203 2020-03-19 Nick Clifton <nickc@redhat.com>
1204
1205 PR 25699
1206 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
1207 error return.
1208
1209 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
1210
1211 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
1212
1213 2020-03-18 Nick Clifton <nickc@redhat.com>
1214
1215 PR 25673
1216 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
1217 memory access when processing a corrupt secondary reloc section.
1218
1219 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
1220
1221 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
1222 instead of calling abort.
1223 * elf32-csky.c (csky_build_one_stub): Likewise.
1224 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1225 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1226 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1227 * elf32-metag.c (metag_build_one_stub): Likewise.
1228 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1229 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1230 (ppc_size_one_stub): Likewise.
1231 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1232
1233 2020-03-17 Nick Clifton <nickc@redhat.com>
1234
1235 PR 25688
1236 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
1237 with error messages.
1238
1239 2020-03-17 Nick Clifton <nickc@redhat.com>
1240
1241 PR 25687
1242 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
1243 free. Add free on another failure path.
1244
1245 2020-03-16 Alan Modra <amodra@gmail.com>
1246
1247 PR 25675
1248 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
1249 we have a non-zero section count. Do lma comparison in octets.
1250
1251 2020-03-16 Alan Modra <amodra@gmail.com>
1252
1253 * vms-alpha.c (dst_restore_location): Validate index into
1254 dst_ptr_offsets array before accessing. Return status.
1255 (dst_retrieve_location): Similarly, making "loc" parameter a
1256 pointer to return value.
1257 (_bfd_vms_slurp_etir): Update calls to above functions.
1258
1259 2020-03-14 Kamil Rytarowski <n54@gmx.com>
1260
1261 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
1262 targets.
1263 * configure: Regenerated.
1264
1265 2020-03-14 Alan Modra <amodra@gmail.com>
1266
1267 * section.c (BFD_FAKE_SECTIONS): Formatting.
1268 * bfd-in2.h: Regenerate.
1269
1270 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1271
1272 * elf.c (elfcore_grok_netbsd_note): Add support for
1273 NT_NETBSDCORE_LWPSTATUS notes.
1274
1275 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
1276
1277 * bfd-in2.h: Regenerate.
1278 * section.c (asection): Add already_assigned field.
1279 (BFD_FAKE_SECTION): Add default initializer for it.
1280 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
1281 * elf32-arm.c (arm_build_one_stub): Add support for
1282 non_contiguous_regions.
1283 * elf32-csky.c (csky_build_one_stub): Likewise.
1284 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1285 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1286 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1287 * elf32-metag.c (metag_build_one_stub): Likewise.
1288 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1289 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1290 (ppc_size_one_stub): Likewise.
1291 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1292 * elflink.c (elf_link_input_bfd): Likewise.
1293
1294 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
1295
1296 PR ld/24920
1297 * elf-linker-x86.h (elf_linker_x86_params): Add
1298 static_before_all_inputs and has_dynamic_linker.
1299 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
1300 dynamic input objects if -static is passed at command-line
1301 before all input files without --dynamic-linker unless
1302 --no-dynamic-linker is used.
1303
1304 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1305
1306 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
1307
1308 2020-03-13 Christian Eggers <ceggers@gmx.de>
1309
1310 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
1311 "p_paddr" from "at".
1312 * elfcode.h (bfd_from_remote_memory): Add units to several
1313 parameters. New local "opb". Fix usage of p_align. Fix
1314 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
1315 call of target_read_memory.
1316 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
1317 calculation of "offset" and "output_offset".
1318 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
1319 from "offset" and fix calculation of "end" from "vma+size". Fix
1320 comparison between "sh_addr" and "vma"/"output_offset".
1321 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
1322 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
1323 member.
1324 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
1325 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
1326 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
1327 assignment of p_paddr from phdr_lma. Fix comparison between
1328 "lma+size" and "next->lma".
1329 (elf_sort_segments): Fix assignment from p_paddr to lma.
1330 (assign_file_positions_for_load_sections): Add unit (bytes) to
1331 local "align". Fix calculation of local "off_adjust". Fix
1332 calculation of local "filehdr_vaddr".
1333 (assign_file_positions_for_non_load_sections): New local "opb".
1334 Fix calculation of "end" from "p_size". Fix comparison between
1335 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
1336 from "end" and "p_vaddr".
1337 (rewrite_elf_program_header): Fix comparison between p_vaddr and
1338 vma. Fix assignment to p_paddr from lma. Fix comparison between
1339 p_paddr and lma. Fix assignment to p_paddr from lma.
1340 * merge.c (sec_merge_emit): New local "opb". Convert
1341 "alignment_power" to octets.
1342 (_bfd_add_merge_section): New locals "alignment_power" and
1343 "opb". Fix comparison between "alignment_power" and
1344 "sizeof(align)".
1345 (_bfd_merge_sections): New local "opb". Divide size by opb
1346 before checking align mask.
1347
1348 2020-03-13 Christian Eggers <ceggers@gmx.de>
1349
1350 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
1351 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
1352 section LMA/VMA.
1353 (_bfd_elf_make_section_from_phdr): Similarly.
1354 (elf_fake_sections): Fix calculation of
1355 Elf_Internal_shdr::sh_addr from section VMA.
1356 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
1357 and bytes.
1358 (assign_file_positions_for_load_sections): Fix calculations of
1359 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
1360 comparison between program header address and section LMA.
1361 (assign_file_positions_for_non_load_sections): Likewise.
1362 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
1363 (IS_CONTAINED_BY_VMA): Add parameter opb.
1364 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
1365 INCLUDE_SECTION_IN_SEGMENT): Likewise.
1366 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
1367 Fix calculations of p_addr_valid and p_vaddr_offset.
1368 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
1369 with octets per byte when comparing against p_vaddr.
1370
1371 2020-03-11 Alan Modra <amodra@gmail.com>
1372
1373 * som.c (setup_sections): Sanity check subspace.name.
1374
1375 2020-03-11 Alan Modra <amodra@gmail.com>
1376
1377 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
1378
1379 2020-03-10 Alan Modra <amodra@gmail.com>
1380
1381 PR 25648
1382 * ihex.c (ihex_write_object_contents): Don't assume ordering of
1383 addresses here.
1384
1385 2020-03-09 Alan Modra <amodra@gmail.com>
1386
1387 * wasm-module.c (wasm_scan): Sanity check file name length
1388 before allocating memory. Move common section setup code. Do
1389 without bfd_tell to calculate section size.
1390
1391 2020-03-06 Nick Clifton <nickc@redhat.com>
1392
1393 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
1394 with error messages and failure return values.
1395
1396 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
1397
1398 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
1399 relocation sections for any removed reference to a dynamic symbol.
1400
1401 2020-03-05 Nick Clifton <nickc@redhat.com>
1402
1403 * elf-bfd.h (struct elf_backend_data): Add new fields:
1404 init_secondary_reloc_section, slurp_secondary_reloc_section,
1405 write_secondary_reloc_section.
1406 (_bfd_elf_init_secondary_reloc_section): Prototype.
1407 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
1408 (_bfd_elf_write_secondary_reloc_section): Prototype.
1409 * elf.c ( bfd_section_from_shdr): Invoke the new
1410 init_secondary_reloc_section backend function, if defined, when a
1411 second reloc section is encountered.
1412 (swap_out_syms): Invoke the new symbol_section_index function, if
1413 defined, when computing the section index of an OS/PROC specific
1414 symbol.
1415 (_bfd_elf_init_secondary_reloc_section): New function.
1416 (_bfd_elf_slurp_secondary_reloc_section): New function.
1417 (_bfd_elf_write_secondary_reloc_section): New function.
1418 (_bfd_elf_copy_special_section_fields): New function.
1419 * elfcode.h (elf_write_relocs): Invoke the new
1420 write_secondary_relocs function, if defined, in order to emit
1421 secondary relocs.
1422 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
1423 function, if defined, in order to read in secondary relocs.
1424 * elfxx-target.h (elf_backend_copy_special_section_fields):
1425 Provide a non-NULL default definition.
1426 (elf_backend_init_secondary_reloc_section): Likewise.
1427 (elf_backend_slurp_secondary_reloc_section): Likewise.
1428 (elf_backend_write_secondary_reloc_section): Likewise.
1429 (struct elf_backend_data elfNN_bed): Add initialisers for the new
1430 fields.
1431 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
1432 * configure: Regenerate.
1433
1434 2020-03-05 Alan Modra <amodra@gmail.com>
1435
1436 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
1437 against file size before allocating memory. Use bfd_alloc rather
1438 than bfd_zalloc for carsym/strings memory.
1439
1440 2020-03-04 Alan Modra <amodra@gmail.com>
1441
1442 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
1443 sh_addr mod sh_addalign is zero.
1444
1445 2020-03-04 Alan Modra <amodra@gmail.com>
1446
1447 * format.c (bfd_check_format_matches): Call cleanup on error exit.
1448
1449 2020-03-03 Alan Modra <amodra@gmail.com>
1450
1451 * format.c (struct bfd_preserve): Add cleanup field.
1452 (bfd_preserve_save): Add cleanup param and save.
1453 (bfd_preserve_restore): Return cleanup.
1454 (bfd_preserve_finish): Call the cleanup for the discarded match.
1455 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
1456 and clear when preserving a match. Restore cleanup too when
1457 restoring that match.
1458
1459 2020-03-02 Alan Modra <amodra@gmail.com>
1460
1461 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
1462 * hpux-core.c (hpux_core_core_file_p): Update prototype.
1463 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
1464 (core_sco5_vec): Correct initialisers.
1465
1466 2020-03-02 Alan Modra <amodra@gmail.com>
1467
1468 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
1469 * aix5ppc-core.c (xcoff64_core_p): Likewise.
1470 * cisco-core.c (cisco_core_file_validate): Likewise.
1471 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
1472 * hpux-core.c (hpux_core_core_file_p): Likewise.
1473 * irix-core.c (irix_core_core_file_p): Likewise.
1474 * lynx-core.c (lynx_core_file_p): Likewise.
1475 * netbsd-core.c (netbsd_core_file_p): Likewise.
1476 * osf-core.c (osf_core_core_file_p): Likewise.
1477 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1478 * sco5-core.c (sco5_core_file_p): Likewise.
1479
1480 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
1481
1482 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
1483
1484 2020-03-02 Alan Modra <amodra@gmail.com>
1485
1486 * targets.c (bfd_cleanup): New typedef.
1487 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
1488 * libbfd-in.h (_bfd_no_cleanup): Define.
1489 * format.c (bfd_reinit): Add cleanup parameter, call it.
1490 (bfd_check_format_matches): Set cleanup from _bfd_check_format
1491 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
1492 * aout-target.h (callback, object_p): Return bfd_cleanup.
1493 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
1494 * archive.c (bfd_generic_archive_p): Likewise.
1495 * binary.c (binary_object_p): Likewise.
1496 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
1497 * coff-ia64.c (ia64coff_object_p): Likewise.
1498 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
1499 * coff-sh.c (coff_small_object_p): Likewise.
1500 * coff-stgo32.c (go32_check_format): Likewise.
1501 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
1502 (xcoff64_core_p): Likewise.
1503 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
1504 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
1505 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
1506 * elfcode.h (elf_object_p): Likewise.
1507 * elfcore.h (elf_core_file_p): Likewise.
1508 * i386msdos.c (msdos_object_p): Likewise.
1509 * ihex.c (ihex_object_p): Likewise.
1510 * libaout.h (some_aout_object_p): Likewise.
1511 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
1512 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
1513 * libbfd.c (_bfd_dummy_target): Likewise.
1514 * libcoff-in.h (coff_object_p): Likewise.
1515 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
1516 (bfd_mach_o_arm64_core_p): Likewise.
1517 * mach-o-arm.c (bfd_mach_o_arm_object_p),
1518 (bfd_mach_o_arm_core_p): Likewise.
1519 * mach-o-i386.c (bfd_mach_o_i386_object_p),
1520 (bfd_mach_o_i386_core_p): Likewise.
1521 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
1522 (bfd_mach_o_x86_64_core_p): Likewise.
1523 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
1524 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
1525 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
1526 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
1527 * mmo.c (mmo_object_p): Likewise.
1528 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
1529 * peicode.h (coff_real_object_p, pe_ILF_object_p),
1530 (pe_bfd_object_p): Likewise.
1531 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
1532 * ppcboot.c (ppcboot_object_p): Likewise.
1533 * rs6000-core.c (rs6000coff_core_p): Likewise.
1534 * som.c (som_object_setup, som_object_p): Likewise.
1535 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
1536 * tekhex.c (tekhex_object_p): Likewise.
1537 * vms-alpha.c (alpha_vms_object_p): Likewise.
1538 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
1539 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
1540 * wasm-module.c (wasm_object_p): Likewise.
1541 * xsym.c (bfd_sym_object_p): Likewise.
1542 * xsym.h (bfd_sym_object_p): Likewise.
1543 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
1544 return type.
1545 * pdp11.c (some_aout_object_p): Likewise.
1546 * plugin.c (register_ld_plugin_object_p): Update object_p
1547 parameter type.
1548 * plugin.h (register_ld_plugin_object_p): Likewise.
1549 * bfd-in2.h: Regenerate.
1550 * libbfd.h: Regenerate.
1551 * libcoff.h: Regenerate.
1552
1553 2020-03-02 Alan Modra <amodra@gmail.com>
1554
1555 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
1556 applicable section flags.
1557 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
1558 (mips_ecoff_bele_vec): Likewise.
1559 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
1560 and .sbss sections.
1561 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
1562 (_bfd_ecoff_styp_to_sec_flags): Likewise.
1563
1564 2020-03-02 Alan Modra <amodra@gmail.com>
1565
1566 * elf32-m32r.c (m32r_elf_section_flags): New function.
1567 (elf_backend_section_flags): Define.
1568 * elf32-nds32.c (nds32_elf_section_flags): New function.
1569 (elf_backend_section_flags): Define.
1570 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
1571 .sbss and .sdata sections.
1572 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
1573 for SHF_V850_GPREL sections.
1574 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
1575 FIXME.
1576 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
1577 for SHF_PARISC_SHORT sections.
1578 * elf64-ppc.c (ppc64_elf_section_flags): New function.
1579 (elf_backend_section_flags): Define.
1580 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
1581 for SHF_MIPS_GPREL sections. Delete FIXME.
1582
1583 2020-03-02 Alan Modra <amodra@gmail.com>
1584
1585 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
1586 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
1587 calling elf_backend_section_flags with adjusted params. Use
1588 newsect->flags past that point.
1589 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
1590 special sections.
1591 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
1592 to have their type overridden, and all sh_flags but processor and
1593 os specific.
1594 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
1595 * elf32-mep.c (mep_elf_section_flags): Likewise.
1596 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
1597 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
1598 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
1599 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
1600 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
1601 stub BFD and non-aarch64 input files when scanning for stubs.
1602
1603 2020-03-02 Alan Modra <amodra@gmail.com>
1604
1605 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
1606 limit to decompressed element size.
1607
1608 2020-03-02 Alan Modra <amodra@gmail.com>
1609
1610 * vms-lib.c (vms_traverse_index): Add recur_count param and
1611 update calls. Fail on excessive recursion.
1612
1613 2020-03-02 Alan Modra <amodra@gmail.com>
1614
1615 * vms-alpha.c (vms_get_remaining_object_record): Use
1616 bfd_realloc_or_free rather than bfd_realloc.
1617 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
1618 (dst_define_location, parse_module): Likewise, and check realloc
1619 return status before using memory. Return status from function
1620 adjusting all callers.
1621
1622 2020-02-28 Alan Modra <amodra@gmail.com>
1623
1624 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
1625
1626 2020-02-28 Alan Modra <amodra@gmail.com>
1627
1628 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
1629 Remove duplicate undersize check.
1630
1631 2020-02-27 Alan Modra <amodra@gmail.com>
1632
1633 PR 24511
1634 * mmo.c (mmo_scan): Set SEC_DATA for .data.
1635
1636 2020-02-27 Alan Modra <amodra@gmail.com>
1637
1638 PR 24511
1639 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
1640 (coff_section_type): Adjust comment.
1641 (decode_section_type): Likewise. Call coff_section_type before
1642 decode_section_type.
1643 (bfd_decode_symclass): Use 'c' for common sections other than
1644 the standard one.
1645
1646 2020-02-27 Alan Modra <amodra@gmail.com>
1647
1648 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
1649 malloc'd block.
1650
1651 2020-02-27 Alan Modra <amodra@gmail.com>
1652
1653 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
1654 if file is an archive element.
1655 * bfd-in2.h: Regenerate.
1656
1657 2020-02-26 Alan Modra <amodra@gmail.com>
1658
1659 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
1660 bfd_set_error on failing test. Don't bother changing bfd_error on
1661 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
1662 Check sym name is within string buffer. Use size_t for some vars.
1663 (do_slurp_coff_armap): Use size_t for some variables, fix size of
1664 int_buf. Don't change bfd_error on file read error. Use
1665 _bfd_mul_overflow when calculating carsym buffer size. Reorder
1666 calculations to catch overflows before they occur. malloc and
1667 free raw armap rather than using bfd_alloc. Read raw armap before
1668 allocating carsym+strings buffer.
1669 (_bfd_slurp_extended_name_table): Localize variables. Check
1670 name size against file size.
1671
1672 2020-02-26 Alan Modra <amodra@gmail.com>
1673
1674 * vms-lib.c (vms_lib_read_index): Release correct buffer.
1675
1676 2020-02-26 Alan Modra <amodra@gmail.com>
1677
1678 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
1679 malloc. Check for NULL return from bfd_malloc.
1680 (rx_table_find, rx_table_map): Likewise.
1681 (rx_set_section_contents): Check bfd_alloc return.
1682 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
1683
1684 2020-02-26 Alan Modra <amodra@gmail.com>
1685
1686 * aoutx.h: Indent labels correctly. Format error strings.
1687 * archive.c: Likewise.
1688 * archive64.c: Likewise.
1689 * coff-arm.c: Likewise.
1690 * coff-rs6000.c: Likewise.
1691 * coff-stgo32.c: Likewise.
1692 * cpu-arm.c: Likewise.
1693 * dwarf2.c: Likewise.
1694 * elf-ifunc.c: Likewise.
1695 * elf-properties.c: Likewise.
1696 * elf-s390-common.c: Likewise.
1697 * elf-strtab.c: Likewise.
1698 * elf.c: Likewise.
1699 * elf32-arm.c: Likewise.
1700 * elf32-bfin.c: Likewise.
1701 * elf32-cr16.c: Likewise.
1702 * elf32-csky.c: Likewise.
1703 * elf32-i386.c: Likewise.
1704 * elf32-m68k.c: Likewise.
1705 * elf32-msp430.c: Likewise.
1706 * elf32-nds32.c: Likewise.
1707 * elf32-nios2.c: Likewise.
1708 * elf32-pru.c: Likewise.
1709 * elf32-xtensa.c: Likewise.
1710 * elf64-ia64-vms.c: Likewise.
1711 * elf64-x86-64.c: Likewise.
1712 * elfcode.h: Likewise.
1713 * elfcore.h: Likewise.
1714 * elflink.c: Likewise.
1715 * elfnn-aarch64.c: Likewise.
1716 * elfnn-ia64.c: Likewise.
1717 * elfnn-riscv.c: Likewise.
1718 * elfxx-mips.c: Likewise.
1719 * elfxx-sparc.c: Likewise.
1720 * elfxx-x86.c: Likewise.
1721 * i386lynx.c: Likewise.
1722 * merge.c: Likewise.
1723 * pdp11.c: Likewise.
1724 * plugin.c: Likewise.
1725 * reloc.c: Likewise.
1726
1727 2020-02-26 Alan Modra <amodra@gmail.com>
1728
1729 PR 25593
1730 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
1731 "dyn_loaded".
1732 (bfd_elf_add_dt_needed_tag): Declare.
1733 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
1734 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
1735 from elf_add_dt_needed_tag. Remove soname and doit param.
1736 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
1737 to see whether as-needed lib is already loaded, use dyn_loaded
1738 list instead. When saving and restoring around as-needed lib
1739 handle possibility that dynstr has not been initialised. Don't
1740 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
1741 Mark libs loaded via DT_NEEDED entries of other libs with
1742 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
1743 the output.
1744 (elf_link_check_versioned_symbol): Remove now unneccesary
1745 DYNAMIC check when traversing dyn_loaded list.
1746
1747 2020-02-26 Alan Modra <amodra@gmail.com>
1748
1749 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
1750
1751 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
1752
1753 PR binutils/25584
1754 * plugin.c (need_lto_wrapper_p): New.
1755 (bfd_plugin_set_program_name): Add an int argument to set
1756 need_lto_wrapper_p.
1757 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
1758 set.
1759 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
1760
1761 2020-02-24 Alan Modra <amodra@gmail.com>
1762
1763 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
1764
1765 2020-02-24 Alan Modra <amodra@gmail.com>
1766
1767 * vms-lib.c (struct carsym_mem): Add limit.
1768 (vms_add_index): Heed limit.
1769 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
1770 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
1771 Always return actual number read.
1772 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
1773 assertion with error exit.
1774
1775 2020-02-22 Alan Modra <amodra@gmail.com>
1776
1777 PR 25585
1778 * elf.c (assign_file_positions_for_load_sections): Continue linking
1779 on "PHDR segment not covered by LOAD segment" errors.
1780
1781 2020-02-21 Alan Modra <amodra@gmail.com>
1782
1783 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
1784 overflow check.
1785 (bfd_mach_o_canonicalize_reloc): Likewise.
1786 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
1787 counts and offsets against file size.
1788 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
1789 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
1790 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
1791 against file size. Delete symbol table error message.
1792 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
1793 against file size.
1794 (bfd_mach_o_read_symtab): Likewise.
1795 (bfd_mach_o_read_command): Pass file size.
1796 (bfd_mach_o_scan): Sanity check command count against file size.
1797
1798 2020-02-21 Alan Modra <amodra@gmail.com>
1799
1800 PR 25569
1801 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
1802 "text", "data" and "bss" section pointer vars. Don't update
1803 section size, just exec header sizes.
1804 (adjust_sizes_and_vmas): Don't update text section size. Set
1805 initial exec header a_text. Print exec headers sizes.
1806 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
1807 (adjust_sizes_and_vmas): Similarly. Formatting.
1808 (final_link): Correct final file extension.
1809
1810 2020-02-20 Nick Clifton <nickc@redhat.com>
1811
1812 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
1813 callback.
1814 * elfxx-target.h (elf_backend_symbol_section_index): Provide
1815 default definition.
1816 (elfNN_bed): Initialise the symbol_section_index field.
1817 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
1818 OS and PROC specific section indicies. Warn if converting other
1819 reserved incidies to SHN_ABS.
1820
1821 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
1822
1823 PR 25537
1824 * cpu-z80.c: Add machine type compatibility checking.
1825
1826 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
1827
1828 PR binutils/25355
1829 * plugin.c (plugin_list_entry): Remove handle.
1830 (try_load_plugin): Call dlclose before return.
1831
1832 2020-02-19 Alan Modra <amodra@gmail.com>
1833
1834 * libbfd-in.h (_bfd_constant_p): Define.
1835 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
1836 file size before allocating memory.
1837 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
1838 * elf.c (bfd_elf_get_str_section): Likewise.
1839 (_bfd_elf_slurp_version_tables): Likewise.
1840 * libbfd.h: Regenerate.
1841
1842 2020-02-19 Alan Modra <amodra@gmail.com>
1843
1844 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
1845 * aoutx.h (aout_get_external_symbols): Replace calls to
1846 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
1847 (slurp_reloc_table): Likewise.
1848 * archive.c (do_slurp_bsd_armap): Likewise.
1849 (do_slurp_coff_armap): Likewise.
1850 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
1851 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
1852 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
1853 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
1854 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
1855 (_bfd_coff_get_external_symbols): Likewise.
1856 * ecoff.c (ecoff_slurp_symbolic_header),
1857 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
1858 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
1859 (ecoff_indirect_link_order): Likewise.
1860 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
1861 (_bfd_elf_slurp_version_tables): Likewise.
1862 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1863 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1864 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1865 * elf64-alpha.c (READ): Likewise.
1866 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
1867 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
1868 * elfcode.h (elf_slurp_symbol_table),
1869 (elf_slurp_reloc_table_from_section): Likewise.
1870 * elflink.c (elf_link_add_object_symbols),
1871 (elf_link_check_versioned_symbol): Likewise.
1872 * elfxx-mips.c (READ): Likewise.
1873 * i386lynx.c (slurp_reloc_table): Likewise.
1874 * lynx-core.c (lynx_core_file_p): Likewise.
1875 * mach-o.c (bfd_mach_o_canonicalize_relocs),
1876 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
1877 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
1878 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
1879 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
1880 (bfd_pef_parse_symbols): Likewise.
1881 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
1882 * som.c (setup_sections, som_slurp_string_table),
1883 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1884 (som_bfd_fill_in_ar_symbols): Likewise.
1885 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
1886 (evax_bfd_print_image): Likewise.
1887 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
1888 * wasm-module.c (wasm_scan): Likewise.
1889 * xcofflink.c (xcoff_link_add_symbols): Likewise.
1890 * xsym.c (bfd_sym_read_name_table),
1891 (bfd_sym_print_type_information_table_entry): Likewise.
1892 * libbfd.h: Regenerate.
1893
1894 2020-02-19 Alan Modra <amodra@gmail.com>
1895
1896 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
1897 reading external relocs.
1898 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
1899 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
1900 after bfd_bread.
1901 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
1902 bfd_release.
1903 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
1904 (m32c_elf_relax_section): Likewise.
1905 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
1906 (rl78_elf_relax_section): Likewise.
1907 * elf32-rx.c (rx_offset_for_reloc): Likewise.
1908 (elf32_rx_relax_section): Likewise.
1909 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
1910 parameter types and use..
1911 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
1912 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
1913 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
1914 being read from file, just the extra.
1915 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
1916 after reading external syms. Free on failure.
1917
1918 2020-02-19 Alan Modra <amodra@gmail.com>
1919
1920 * coffcode.h (buy_and_read, coff_slurp_line_table),
1921 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
1922 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
1923 corresponding bfd_alloc call. Adjust variables to suit.
1924 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1925 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
1926 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
1927 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
1928 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
1929 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1930 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1931 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1932 * elf64-alpha.c (READ): Likewise.
1933 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
1934 (elf_slurp_symbol_table, elf_slurp_reloc_table),
1935 (bfd_from_remote_memory): Likewise.
1936 * elfcore.h (core_find_build_id): Likewise.
1937 * elfxx-mips.c (READ): Likewise.
1938 * mach-o.c (bfd_mach_o_mangle_sections),
1939 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
1940 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
1941 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
1942 * som.c (setup_sections, som_prep_for_fixups)
1943 (som_build_and_write_symbol_table, som_slurp_symbol_table),
1944 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1945 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
1946 (som_bfd_ar_write_symbol_stuff): Likewise.
1947 * vms-alpha.c (vector_grow1): Likewise.
1948 * vms-lib.c (vms_add_index): Likewise.
1949 * wasm-module.c (wasm_scan_name_function_section): Likewise.
1950 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
1951 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
1952 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
1953 (bfd_alloc2, bfd_zalloc2): Delete.
1954 (_bfd_mul_overflow): Define.
1955 * libbfd.h: Regenerate.
1956
1957 2020-02-19 Alan Modra <amodra@gmail.com>
1958
1959 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
1960 bfd_zalloc2.
1961 (assign_section_numbers): Likewise.
1962 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
1963 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
1964 bfd_malloc2, size_t amt, and unsigned tls_count.
1965 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
1966 * elflink.c (elf_create_symbuf): Use bfd_malloc.
1967 (elf_output_implib): Use bfd_alloc.
1968
1969 2020-02-19 Alan Modra <amodra@gmail.com>
1970
1971 * bfd.c (struct bfd): Move format and direction to other
1972 bitfields. Add "size".
1973 * bfdio.c (bfd_get_size): Cache size when not writing file.
1974 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
1975 returning zero, ie. unknown.
1976 (bfd_get_alt_debug_link_info): Likewise.
1977 * bfd-in2.h: Regenerate.
1978
1979 2020-02-19 Alan Modra <amodra@gmail.com>
1980
1981 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
1982 bfd_get_file_size twice.
1983 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
1984 zero, ie. unknown, return.
1985 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
1986 * elfcode.h (elf_swap_shdr_in): Likewise.
1987 (elf_object_p): Don't call bfd_get_file_size twice and correct
1988 file size check.
1989
1990 2020-02-19 Alan Modra <amodra@gmail.com>
1991
1992 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
1993 FALSE if memory alloc fails. Adjust calls.
1994 * som.c (som_prep_for_fixups): Likewise.
1995 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
1996 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
1997 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
1998 * som.c (som_build_and_write_symbol_table): Return via error_return
1999 on seek failure.
2000 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
2001 (VEC_APPEND_EL): Delete.
2002 (vector_grow1): Return pointer to element. Catch overflow.
2003 Return NULL on memory allocation failure.
2004 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
2005 (alpha_vms_add_fixup_ca): Likewise.
2006 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
2007 before using.
2008 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
2009
2010 2020-02-19 Alan Modra <amodra@gmail.com>
2011
2012 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
2013 * aout-target.h (object_p): Likewise.
2014 * aout-tic30.c (tic30_aout_object_p): Likewise.
2015 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
2016 (emit_stringtab, write_syms, link_hash_table_create),
2017 (aout_link_write_other_symbol): Likewise.
2018 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
2019 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
2020 (_bfd_compute_and_write_armap): Likewise.
2021 * archures.c (bfd_arch_list): Likewise.
2022 * bfd.c (bfd_record_phdr): Likewise.
2023 * binary.c (binary_canonicalize_symtab): Likewise.
2024 * cisco-core.c (cisco_core_file_validate): Likewise.
2025 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
2026 (find_arm_glue, record_arm_to_thumb_glue),
2027 (record_thumb_to_arm_glue): Likewise.
2028 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
2029 (ppc_allocate_toc_section): Likewise.
2030 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
2031 * coff-sh.c (sh_relax_section): Likewise.
2032 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
2033 * coffcode.h (handle_COMDAT, coff_new_section_hook),
2034 (coff_set_alignment_hook, coff_mkobject),
2035 (coff_compute_section_file_positions): Likewise.
2036 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
2037 (coff_find_nearest_line_with_names),
2038 ( bfd_coff_set_symbol_class): Likewise.
2039 * cofflink.c (_bfd_coff_link_hash_table_create),
2040 (_bfd_coff_link_input_bfd): Likewise.
2041 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
2042 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
2043 (build_line_info_table, sort_line_sequences),
2044 (line_info_add_include_dir, line_info_add_file_name),
2045 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
2046 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
2047 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
2048 (_bfd_ecoff_find_nearest_line),
2049 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
2050 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
2051 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
2052 * elf-m10300.c (mn10300_elf_relax_section),
2053 (elf32_mn10300_link_hash_table_create): Likewise.
2054 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
2055 * elf.c (make_mapping, copy_elf_program_header): Likewise.
2056 * elf32-arm.c (elf32_arm_link_hash_table_create),
2057 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
2058 (elf32_arm_new_section_hook): Likewise.
2059 * elf32-avr.c (elf_avr_new_section_hook),
2060 (elf32_avr_link_hash_table_create, get_local_syms),
2061 (elf32_avr_setup_section_lists): Likewise.
2062 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
2063 (bfin_link_hash_table_create): Likewise.
2064 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
2065 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
2066 * elf32-csky.c (csky_elf_link_hash_table_create),
2067 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
2068 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
2069 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
2070 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
2071 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2072 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
2073 * elf32-m32r.c (m32r_elf_link_hash_table_create),
2074 (m32r_elf_check_relocs): Likewise.
2075 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
2076 (elf32_m68hc11_setup_section_lists),
2077 (elf32_m68hc11_size_stubs): Likewise.
2078 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
2079 * elf32-metag.c (elf_metag_link_hash_table_create),
2080 (elf_metag_setup_section_lists): Likewise.
2081 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
2082 (microblaze_elf_check_relocs): Likewise.
2083 * elf32-nds32.c (nds32_elf_link_hash_table_create),
2084 (nds32_elf_check_relocs): Likewise.
2085 * elf32-nios2.c (nios2_elf32_setup_section_lists),
2086 (get_local_syms, nios2_elf32_check_relocs),
2087 (nios2_elf32_link_hash_table_create): Likewise.
2088 * elf32-or1k.c (or1k_elf_link_hash_table_create),
2089 (or1k_elf_check_relocs): Likewise.
2090 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
2091 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
2092 * elf32-s390.c (elf_s390_link_hash_table_create),
2093 (elf_s390_check_relocs): Likewise.
2094 * elf32-score.c (score_elf_create_got_section),
2095 (s3_elf32_score_new_section_hook),
2096 (elf32_score_link_hash_table_create): Likewise.
2097 * elf32-score7.c (score_elf_create_got_section),
2098 (s7_elf32_score_new_section_hook): Likewise.
2099 * elf32-sh.c (sh_elf_link_hash_table_create),
2100 (sh_elf_check_relocs): Likewise.
2101 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
2102 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
2103 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
2104 (tilepro_elf_check_relocs): Likewise.
2105 * elf32-v850.c (remember_hi16s_reloc): Likewise.
2106 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
2107 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
2108 (elf_xtensa_new_section_hook): Likewise.
2109 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
2110 (get_got_entry, elf64_alpha_check_relocs): Likewise.
2111 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
2112 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
2113 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
2114 * elf64-ppc.c (ppc64_elf_new_section_hook),
2115 (ppc64_elf_link_hash_table_create, update_local_sym_info),
2116 (update_plt_info, ppc64_elf_check_relocs): Likewise.
2117 * elf64-s390.c (elf_s390_link_hash_table_create),
2118 (elf_s390_check_relocs): Likewise.
2119 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2120 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
2121 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
2122 (elf_link_add_archive_symbols, compute_bucket_count),
2123 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
2124 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
2125 (bfd_elf_final_link): Likewise.
2126 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
2127 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
2128 (elfNN_aarch64_new_section_hook): Likewise.
2129 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
2130 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
2131 (riscv_elf_check_relocs): Likewise.
2132 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
2133 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
2134 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
2135 (_bfd_mips_elf_link_hash_table_create): Likewise.
2136 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
2137 (_bfd_sparc_elf_check_relocs),
2138 (_bfd_sparc_elf_new_section_hook): Likewise.
2139 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
2140 (tilegx_elf_check_relocs): Likewise.
2141 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
2142 * format.c (bfd_check_format_matches): Likewise.
2143 * hash.c (_bfd_stringtab_init): Likewise.
2144 * ihex.c (ihex_scan): Likewise.
2145 * irix-core.c (irix_core_core_file_p): Likewise.
2146 * linker.c (bfd_wrapped_link_hash_lookup),
2147 (_bfd_generic_link_hash_table_create),
2148 (_bfd_generic_reloc_link_order): Likewise.
2149 * lynx-core.c (lynx_core_file_p): Likewise.
2150 * netbsd-core.c (netbsd_core_file_p): Likewise.
2151 * osf-core.c (osf_core_core_file_p): Likewise.
2152 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
2153 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
2154 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
2155 * peicode.h (pe_mkobject): Likewise.
2156 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
2157 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2158 * sco5-core.c (read_uarea): Likewise.
2159 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
2160 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
2161 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
2162 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
2163 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
2164 * srec.c (srec_scan): Likewise.
2165 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
2166 * targets.c (bfd_target_list): Likewise.
2167 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
2168 * trad-core.c (trad_unix_core_file_p): Likewise.
2169 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
2170 (vms_new_section_hook): Likewise.
2171 * wasm-module.c (wasm_make_empty_symbol): Likewise.
2172 * xcofflink.c (xcoff_get_section_contents),
2173 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
2174 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
2175 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
2176
2177 2020-02-19 Alan Modra <amodra@gmail.com>
2178
2179 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
2180
2181 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
2182
2183 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
2184 and use it if it isn't NULL. Remove has_plugin_p argument. Add
2185 a build_list_p argument. Don't search plugin_list. Short circuit
2186 when building the plugin list.
2187 (has_plugin): Renamed to has_plugin_list.
2188 (bfd_plugin_set_plugin): Don't set has_plugin.
2189 (bfd_plugin_specified_p): Check plugin_list instead.
2190 (build_plugin_list): New function.
2191 (load_plugin): Call build_plugin_list and use plugin_list.
2192
2193 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2194
2195 PR binutils/25355
2196 * plugin.c (try_claim): Always clean up for LTO wrapper.
2197 (try_load_plugin): Treat each object as independent. Create a
2198 copy for plugin name.
2199
2200 2020-02-11 Nick Clifton <nickc@redhat.com>
2201
2202 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
2203 for addresses in print statements.
2204 (msp430_elf_relax_delete_bytes): Likewise.
2205 (msp430_elf_relax_add_words): Likewise.
2206 (msp430_elf_relax_section): Likewise.
2207
2208 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2209
2210 * plugin.c (add_symbols): Clear plugin_data memory.
2211
2212 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
2213
2214 PR binutils/25355
2215 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
2216 (EXECUTABLE_SUFFIX): Likewise.
2217 * config.in: Regenerated.
2218 * configure: Likewise.
2219 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
2220 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
2221 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
2222 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
2223 (get_lto_wrapper): New.
2224 (setup_lto_wrapper_env): Likewise.
2225 (current_plugin): Likewise.
2226 (register_all_symbols_read): Likewise.
2227 (register_cleanup): Likewise.
2228 (get_symbols): Likewise.
2229 (add_input_file): Likewise.
2230 (bfd_plugin_close_and_cleanup): Likewise.
2231 (claim_file): Removed.
2232 (register_claim_file): Set current_plugin->claim_file.
2233 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
2234 lto_syms in current_plugin.
2235 (try_claim): Use current_plugin->claim_file. Call LTO plugin
2236 all_symbols_read handler. Copy real symbols to plugin_data.
2237 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
2238 (try_load_plugin): Don't reuse the previous plugin for LTO
2239 wrapper. Set up GCC LTO wrapper if possible. Don't set
2240 plugin_list_iter->claim_file.
2241 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
2242 possible.
2243 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
2244 real_syms.
2245
2246 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2247
2248 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
2249 check if previous instruction matches a conditional jump inserted
2250 earlier. Invert conditional jump and delete branch in this case.
2251
2252 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2253
2254 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
2255 msp430_elf_relax_add_words. Support insertion of either one or two
2256 words.
2257 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
2258 needs to be grown. Handle insertion of branch instruction to replace
2259 jump.
2260
2261 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2262
2263 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
2264 debugging relocations.
2265 (msp430_elf_relax_delete_bytes): Likewise.
2266 (msp430_elf_relax_add_two_words): Likewise.
2267 (msp430_elf_relax_section): Likewise.
2268
2269 2020-02-10 Alan Modra <amodra@gmail.com>
2270
2271 * archures.c: Wrap overlong z80 comments.
2272 * bfd-in2.h: Regenerate.
2273
2274 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
2275
2276 PR 25469
2277 * archures.c: Add GBZ80 and Z80N machine values.
2278 * reloc.c: Add BFD_RELOC_Z80_16_BE.
2279 * coff-z80.c: Add support for new reloc.
2280 * coffcode.h: Add support for new machine values.
2281 * cpu-z80.c: Add support for new machine names.
2282 * elf32-z80.c: Add support for new reloc.
2283 * bfd-in2.h: Regenerate.
2284 * libbfd.h: Regenerate.
2285
2286 2020-02-07 Nick Clifton <nickc@redhat.com>
2287
2288 PR 23932
2289 * elf.c (rewrite_elf_program_header): Do not complain if no
2290 sections are mapped to a segment.
2291
2292 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2293
2294 PR ld/25490
2295 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
2296 for garbage collection on __patchable_function_entries section
2297 without linked-to section.
2298
2299 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2300
2301 PR gas/25381
2302 * bfd-in2.h: Regenerated.
2303 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
2304 on section if gc_mark of any of its linked-to sections is set
2305 and don't set gc_mark again.
2306 * section.c (asection): Add linked_to_symbol_name to map_head
2307 union.
2308
2309 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
2310
2311 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
2312 reporting an unrecognized instruction with R_V850_LONGJUMP.
2313
2314 2020-02-05 Alan Modra <amodra@gmail.com>
2315
2316 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
2317
2318 2020-02-04 Alan Modra <amodra@gmail.com>
2319
2320 * elf32-ppc.c (ppc_elf_relocate_section): After applying
2321 R_PPC_VLE_ADDR20, goto copy_reloc.
2322
2323 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2324
2325 * bfd-in2.h: Regenerated.
2326 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
2327
2328 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2329
2330 PR gas/25380
2331 * bfd-in2.h: Regenerated.
2332 * ecoff.c (bfd_debug_section): Add section_id.
2333 * section.c (bfd_section): Add section_id.
2334 (SEC_ASSEMBLER_SECTION_ID): New.
2335 (BFD_FAKE_SECTION): Add section_id.
2336
2337 2020-02-01 Nick Clifton <nickc@redhat.com>
2338
2339 * config.bfd: Move the c30-aout and tic30-aout targets onto the
2340 obsolete list.
2341
2342 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
2343
2344 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
2345 encodings are relative to the GOT on nios2, too.
2346
2347 2020-01-31 Alan Modra <amodra@gmail.com>
2348
2349 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
2350 file. Use $< and $@ in rules.
2351 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
2352 (elf32-ia64.c, elf64-ia64.c): Likewise.
2353 (elf32-riscv.c, elf64-riscv.c): Likewise.
2354 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2355 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
2356 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
2357 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
2358 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2359 * Makefile.in: Regenerate.
2360
2361 2020-01-31 Alan Modra <amodra@gmail.com>
2362
2363 PR 4110
2364 * elf.c (setup_group): Don't clear entire section contents,
2365 just the padding after group flags. Release alloc'd memory
2366 after a seek or read failure.
2367
2368 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2369
2370 * peXXigen.c (pe_is_repro): New function.
2371 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
2372 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
2373
2374 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2375
2376 * peXXigen.c (debug_type_names): Add names for new debug data type
2377 values.
2378
2379 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2380
2381 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
2382 inner loop. Fix a memory leak.
2383
2384 2020-01-30 Alan Modra <amodra@gmail.com>
2385
2386 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
2387 or obj_coff_keep_strings here.
2388 (coff_get_normalized_symtab): Free external syms directly.
2389 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
2390 on error exit path.
2391
2392 2020-01-27 Jim Wilson <jimw@sifive.com>
2393
2394 * cpu-riscv.c (riscv_scan): New.
2395 (N): Change bfd_default_scan to riscv_scan.
2396
2397 2020-01-27 Andreas Schwab <schwab@suse.de>
2398
2399 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
2400 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
2401 * Makefile.in: Regenerate.
2402 * cpu-plugin.c: Remove.
2403 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
2404 (bfd_plugin_arch): Remove declaration.
2405 * bfd-in2.h: Regenerate.
2406 * po/SRC-POTFILES.in: Regenerate.
2407
2408 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
2409 Alan Modra <amodra@gmail.com>
2410
2411 PR ld/25458
2412 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
2413
2414 2020-01-24 Jim Wilson <jimw@sifive.com>
2415
2416 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
2417 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
2418 avoid over long line.
2419
2420 2020-01-24 Nick Clifton <nickc@redhat.com>
2421
2422 PR 25447
2423 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
2424 syms and keep strings flags as these may have been set in order to
2425 prevent a bogus call to free.
2426
2427 2020-01-23 Nick Clifton <nickc@redhat.com>
2428
2429 * po/fr.po: Updated French translation.
2430
2431 2020-01-23 Alan Modra <amodra@gmail.com>
2432
2433 PR 25444
2434 * elf.c (assign_file_positions_for_load_sections): Avoid divide
2435 by zero when p_align is zero.
2436
2437 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
2438
2439 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
2440 (riscv_prefix_cmp): Likewise.
2441 (riscv_non_std_ext_p): Deleted.
2442 (riscv_std_sv_ext_p): Likewise.
2443 (riscv_non_std_sv_ext_p): Likewise.
2444 (riscv_merge_non_std_and_sv_ext): Rename to...
2445 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
2446 (riscv_merge_arch_attr_info): Replace 3 calls to
2447 riscv_merge_non_std_and_sv_ext with single call to
2448 riscv_merge_multi_letter_ext.
2449 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
2450 encounter a 'z' prefix.
2451 (riscv_get_prefix_class): New function, return prefix class based
2452 on first few characters of input string.
2453 (riscv_parse_config): New structure to factor out minor differences
2454 in extension class parsing behaviour.
2455 (riscv_parse_sv_or_non_std_ext): Rename to...
2456 (riscv_parse_prefixed_ext): and parameterise with
2457 riscv_parse_config.
2458 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
2459 (riscv_multi_letter_ext_valid_p): New.
2460 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
2461 (riscv_parse_subset): Delegate all non-single-letter parsing work
2462 to riscv_parse_prefixed_ext.
2463 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
2464 (riscv_get_prefix_class): Declare.
2465
2466 2020-01-22 Alan Modra <amodra@gmail.com>
2467
2468 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
2469 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
2470 __tls_get_addr_desc.
2471 (ppc64_elf_size_stubs): Add section for linker generated
2472 __tls_get_addr_desc wrapper function. Loop at least once if
2473 generating this function.
2474 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
2475 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
2476
2477 2020-01-22 Alan Modra <amodra@gmail.com>
2478
2479 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
2480 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
2481 tga_desc_fd.
2482 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
2483 (STDU_R1_0R1, ADDI_R1_R1): Define.
2484 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
2485 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
2486 tga_desc_fd to opt_fd, and tga_desc to opt. Set
2487 no_tls_get_addr_regsave.
2488 (branch_reloc_hash_match): Add hash3 and hash4.
2489 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
2490 (ppc64_elf_size_dynamic_sections): Likewise.
2491 (ppc64_elf_relocate_section): Likewise.
2492 (plt_stub_size, build_plt_stub): Likewise. Size regsave
2493 __tls_get_addr stub.
2494 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
2495 eh_frame.
2496 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
2497 eh_frame for regsave __tls_get_addr.
2498
2499 2020-01-22 Alan Modra <amodra@gmail.com>
2500
2501 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
2502 which __tls_get_addr calls will be eliminated.
2503
2504 2020-01-20 Nick Clifton <nickc@redhat.com>
2505
2506 * po/pt.po: Updates Portuguese translation.
2507 * po/ru.po: Updated Russian translation.
2508 * po/uk.po: Updated Ukranian translation.
2509
2510 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
2511
2512 PR ld/25416
2513 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
2514 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
2515 X32 mode.
2516 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
2517 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
2518 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
2519 "rex leal x@tlsdesc(%rip), %reg" to
2520 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
2521 "call *(%eax)" to "nopl (%rax)".
2522
2523 2020-01-20 Alan Modra <amodra@gmail.com>
2524
2525 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
2526 (MTLR_R11): Don't define.
2527 (LD_R0_0R3, CMPDI_R0_0): Define.
2528 (build_tls_get_addr_stub): Don't use r11 in stub.
2529
2530 2020-01-20 Alan Modra <amodra@gmail.com>
2531
2532 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
2533 (defined_sym_val, is_tls_get_addr): Likewise.
2534
2535 2020-01-18 Nick Clifton <nickc@redhat.com>
2536
2537 * version.m4 (BFD_VERSION): Set to 2.34.50.
2538 * configure: Regenerate.
2539 * po/bfd.pot: Regenerate.
2540
2541 2020-01-18 Nick Clifton <nickc@redhat.com>
2542
2543 Binutils 2.34 branch created.
2544
2545 2020-01-17 Christian Biesinger <cbiesinger@google.com>
2546
2547 * coff-arm.c: Fix spelling error (seperate).
2548 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
2549 error (seperate).
2550 * sysdep.h (strnlen): Fix spelling error (seperate).
2551
2552 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
2553
2554 PR 20694
2555 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
2556
2557 2020-01-15 Alan Modra <amodra@gmail.com>
2558
2559 PR 25384
2560 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
2561 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
2562 of function symbols unless dot symbols are present. Do warn
2563 whenever one is created, regardles of whether a PLT entry is
2564 also emitted for the function symbol.
2565
2566 2020-01-14 Alan Modra <amodra@gmail.com>
2567
2568 * som.c (som_bfd_count_ar_symbols): Error when file position
2569 of symbols on chains is not strictly increasing.
2570
2571 2020-01-14 Alan Modra <amodra@gmail.com>
2572
2573 * vms.h (VMS_DEBUG): Define as 0.
2574 * vms-alpha.c (image_write): Move debug output after bounds check.
2575 Tidy bounds check.
2576 (_bfd_vms_slurp_eihd): Warning fix.
2577 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
2578
2579 2020-01-13 Alan Modra <amodra@gmail.com>
2580
2581 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
2582 for "ignored" records.
2583
2584 2020-01-13 Alan Modra <amodra@gmail.com>
2585
2586 * wasm-module.c (wasm_scan_name_function_section): Formatting.
2587 Delete asect name check. Move asect NULL check to wasm_object_p.
2588 Correct bounds check of sizes against end. Replace uses of
2589 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
2590 just one bfd_release.
2591 (wasm_scan): Don't use malloc/strdup for section names,
2592 bfd_alloc instead. Simplify code prefixing section name.
2593 Formatting. Don't attempt to free memory here..
2594 (wasm_object_p): ..do so here.
2595
2596 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
2597
2598 PR ld/22269
2599 * elf32-arm.c (elf32_arm_final_link_relocate): Use
2600 UNDEFWEAK_NO_DYNAMIC_RELOC.
2601 (allocate_dynrelocs_for_symbol): Likewise.
2602
2603 2020-01-10 Tamar Christina <tamar.christina@arm.com>
2604
2605 PR 25210
2606 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
2607
2608 2020-01-10 Alan Modra <amodra@gmail.com>
2609
2610 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
2611
2612 2020-01-09 Nick Clifton <nickc@redhat.com>
2613
2614 PR 25221
2615 * bfd.c (bfd_convert_section_contents): Check for a compress
2616 header size that is larger than the actual section size.
2617
2618 2020-01-08 Alan Modra <amodra@gmail.com>
2619
2620 PR 25351
2621 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
2622 after removing sections.
2623
2624 2020-01-06 Jim Wilson <jimw@sifive.com>
2625
2626 PR 25205
2627 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
2628 check for !bfd_link_pic (info).
2629 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
2630 <R_RISCV_JAL>: Add comment.
2631 (_bfd_riscv_relax_section): For plt.offset check, add check for
2632 bfd_link_pic (info). Add comment.
2633
2634 2020-01-06 Alan Modra <amodra@gmail.com>
2635
2636 * format.c (bfd_check_format_matches): Ignore bfd_error on target
2637 match failures. Don't init to bfd_error_wrong_format before
2638 calling _bfd_check_format.
2639
2640 2020-01-06 Alan Modra <amodra@gmail.com>
2641
2642 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
2643 status rather than exiting on stack overflow or underflow.
2644 (_bfd_vms_slurp_etir): Adjust to suit.
2645
2646 2020-01-06 Alan Modra <amodra@gmail.com>
2647
2648 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
2649
2650 2020-01-06 Alan Modra <amodra@gmail.com>
2651
2652 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
2653 command. Check name offset is within command.
2654 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
2655 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
2656 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
2657 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
2658 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
2659 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
2660 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
2661 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
2662 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
2663 (bfd_mach_o_read_segment): Similarly.
2664 (bfd_mach_o_read_thread): Properly bound check thread struct.
2665 Don't repeat checks on second loop.
2666 (bfd_mach_o_read_command): Fail on invalid command length.
2667
2668 2020-01-04 Alan Modra <amodra@gmail.com>
2669
2670 * format.c (bfd_check_format_matches): Add preserve_match.
2671 Save initial bfd state in "preserve", matched bfd state in
2672 "preserve_match". Save just the first match. Release
2673 bfd_alloc memory. Restore and finish preserved state as
2674 appropriate on all function exit paths.
2675
2676 2020-01-04 Alan Modra <amodra@gmail.com>
2677
2678 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
2679
2680 2020-01-04 Alan Modra <amodra@gmail.com>
2681
2682 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
2683 match too.
2684
2685 2020-01-03 Nick Clifton <nickc@redhat.com>
2686
2687 PR 25307
2688 (bfd_pef_parse_function_stubs): Correct the test that ensures that
2689 there is enough data remaining in the code buffer before
2690 attempting to read a function stub.
2691
2692 2020-01-03 Nick Clifton <nickc@redhat.com>
2693
2694 PR 25308
2695 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
2696 return value from bfd_malloc.
2697 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
2698 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
2699 (elf32_arm_filter_cmse_symbols): Likewise.
2700 (elf32_arm_write_section): Likewise.
2701 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
2702 (bfd_mach_o_follow_dsym): Likewise.
2703 * pef.c (bfd_pef_print_loader_section): Likewise.
2704 (bfd_pef_scan_start_address): Likewise.
2705 (bfd_pef_parse_function_stubs): Likewise.
2706 (bfd_pef_parse_symbols): Likewise.
2707
2708 2020-01-03 Sergei Trofimovich <siarheit@google.com>
2709
2710 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
2711 on binary inputs ld/PR25316.
2712 (is_ia64_elf): new helper to filter on ia64 objects.
2713
2714 2020-01-03 Jan Beulich <jbeulich@suse.com>
2715
2716 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
2717 in parameter names.
2718 (bfd_mach_o_scan): Insert underscore in two variable names.
2719
2720 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
2721
2722 * Makefile.am: Add z80-elf target support.
2723 * configure.ac: Likewise.
2724 * targets.c: Likewise.
2725 * Makefile.in: Regenerate.
2726 * configure: Regenerate.
2727 * config.bfd: Add z80-elf target support and new arches: ez80 and
2728 z180.
2729 * elf32-z80.c: New file.
2730 * archures.c: Add new z80 architectures: eZ80 and Z180.
2731 * coffcode.h: Likewise.
2732 * cpu-z80.c: Likewise.
2733 * coff-z80.c: Add new relocations for Z80 target and local label
2734 check.
2735 * reloc.c: Add new relocs.
2736 * bfd-in2.h: Regenerate.
2737 * libbfd.h: Regenerate.
2738
2739 2020-01-02 Tamar Christina <tamar.christina@arm.com>
2740
2741 PR 25210
2742 PR 24753
2743 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
2744
2745 2020-01-01 Alan Modra <amodra@gmail.com>
2746
2747 Update year range in copyright notice of all files.
2748
2749 For older changes see ChangeLog-2019
2750 \f
2751 Copyright (C) 2020 Free Software Foundation, Inc.
2752
2753 Copying and distribution of this file, with or without modification,
2754 are permitted in any medium without royalty provided the copyright
2755 notice and this notice are preserved.
2756
2757 Local Variables:
2758 mode: change-log
2759 left-margin: 8
2760 fill-column: 74
2761 version-control: never
2762 End:
This page took 0.096726 seconds and 4 git commands to generate.