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