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