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