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