C++-ify varobj iteration
[deliverable/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
729a5353
NC
12020-12-10 Nelson Chu <nelson.chu@sifive.com>
2
3 * elfxx-riscv.c (riscv_ext_dont_care_version): New function. Return
4 TRUE if we don't care the versions of the extensions. These extensions
5 are added to the subset list for special purposes, with the explicit
6 versions or the RISCV_UNKNOWN_VERSION versions.
7 (riscv_parse_add_subset): If we do care the versions of the extension,
8 and the versions are unknown, then report errors for the non-implicit
9 extensions, and return directly for the implicit one.
10 (riscv_arch_str1): Do not output i extension after e, and the extensions
11 which versions are unknown.
12
365f5fb6
SP
132020-12-07 Siddhesh Poyarekar <siddhesh@sourceware.org>
14
15 PR 26945
16 * opncls.c (bfd_fdopenw): New function.
17 * bfd-in2.h: Regenerate.
18
fde0214a
AM
192020-12-07 Alan Modra <amodra@gmail.com>
20
21 * elf32-csky.c (csky_relocate_contents): Correct negate test.
22 * cpu-ns32k.c (_bfd_do_ns32k_reloc_contents): Likewise.
23 * elf32-nds32.c (nds32_relocate_contents): Likewise.
24
0fcf331b
MR
252020-12-05 Maciej W. Rozycki <macro@linux-mips.org>
26
27 * elf32-vax.c (elf_vax_check_relocs) <R_VAX_GOT32>: Use
28 SYMBOL_REFERENCES_LOCAL rather than `h->forced_local' to check
29 whether the symbol referred is local or not.
30
7e45e7a9
L
312020-12-04 H.J. Lu <hongjiu.lu@intel.com>
32
33 PR ld/27016
34 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Convert load
35 to mov only for GOTPCRELX relocations.
36
726d7d1e
AM
372020-12-04 Alan Modra <amodra@gmail.com>
38
39 PR 26978
40 * elflink.c (_bfd_elf_add_default_symbol): Handle the case where
41 a new weak sym@@ver should be overridden by an existing sym@ver.
42 (elf_link_add_object_symbols): Don't _bfd_elf_add_default_symbol
43 for a new weak sym@ver when sym@@ver already exists.
44 * linker.c (link_action): Choose MIND for previous indirect,
45 current def, rather than MDEF.
46 (_bfd_generic_link_add_one_symbol <MIND>): Handle redefinition of
47 weak indirect symbol.
48
6729e2c2
NC
492020-12-01 Nelson Chu <nelson.chu@sifive.com>
50
51 * elfxx-riscv.c (riscv_parse_prefixed_ext): Use riscv_compare_subsets
52 to check the Z* extensions' order.
53
00d4d1b0
NC
542020-12-01 Nelson Chu <nelson.chu@sifive.com>
55
56 * elfxx-riscv.c (riscv_parse_add_subset): Allow to add g with
57 RISCV_UNKNOWN_VERSION versions.
58 (riscv_parse_std_ext): Add g to the subset list, we only use it
59 to add the implicit extensions, but won't output it to arch string.
60 (riscv_parse_add_implicit_subsets): Add implicit zicsr and zifencei
61 for g extension.
62 (riscv_arch_str1): Do not output g to the arch string.
63 * elfxx-riscv.h (RISCV_UNKNOWN_VERSION): Moved to include/opcode/riscv.h.
64
dfe92496
NC
652020-12-01 Nelson Chu <nelson.chu@sifive.com>
66
67 * elfnn-riscv.c (riscv_merge_std_ext): Updated since
68 riscv_lookup_subset is changed.
69 * elfxx-riscv.c (riscv_ext_order): New Array used to compare the
70 extensions' order quickly.
71 (riscv_init_ext_order): New function. Init the riscv_ext_order
72 according to the riscv_supported_std_ext and parse_config[i].class
73 automatically.
74 (riscv_compare_subsets): New function. Similar to the strcmp, but
75 compare the subsets with the specific order.
76 (riscv_lookup_subset): Return TRUE and set `current` to the subset
77 if it is found. Otherwise, return FALSE and set `current` to the
78 place where we should insert the subset.
79 (riscv_add_implicit_subset): New function. Search the list first,
80 and then find the right place to add the implicit_subset.
81 (riscv_parse_add_subset): Since We have to add all arch string
82 extensions first, and then start to add their implicit extensions.
83 We can add arch string extensions in order by the original
84 riscv_add_subset, and then add the implicit subsets by the
85 riscv_add_implicit_subset. Besides, do not add the implicit
86 extensions if we failed to find their default versions.
87 (riscv_parse_std_ext): Updated.
88 (riscv_parse_add_implicit_subsets): New function. Add all implicit
89 extensions according to the arch string extensions.
90 (riscv_parse_subset): Call riscv_init_ext_order and
91 riscv_parse_add_implicit_subsets, before and after parsing the
92 arch string. Remove parts of the ISA conflict checking since
93 the implicit extensions are added.
94 * elfxx-riscv.h (riscv_lookup_subset): Updated.
95
7ef19aa6
NC
962020-12-01 Nelson Chu <nelson.chu@sifive.com>
97
98 * elfxx-riscv.c (riscv_lookup_subset): Moved to front.
99 (riscv_add_subset): Likewise.
100 (riscv_release_subset_list): Likewise.
101 (riscv_parse_add_subset): New function. Find and check the
102 versions before adding them by riscv_add_subset.
103 (riscv_parsing_subset_version): Remove use_default_version
104 and change the version type from unsigned to int. Set the
105 versions to RISCV_UNKNOWN_VERSION if we can not find them
106 in the arch string.
107 (riscv_parse_std_ext): Updated.
108 (riscv_parse_prefixed_ext): Updated. Since we use as_bad
109 rather than as_fatal to report more errors, return NULL
110 string if the parsed end_of_version is NULL, too.
111 (riscv_parse_subset): Use a new boolean, no_conflict, to
112 report more errors when we have more than one ISA conflicts.
113 * elfxx-riscv.h (RISCV_DONT_CARE_VERSION): Changed to
114 RISCV_UNKNOWN_VERSION.
115 (riscv_lookup_subset_version): Removed.
116 (riscv_parse_subset_t): Updated.
117
5a1b31e1
NC
1182020-12-01 Nelson Chu <nelson.chu@sifive.com>
119
120 * elfxx-riscv.c (riscv_parse_std_ext): Stop parsing standard
121 extensions when parsed h keyword.
122 (riscv_get_prefix_class): Support prefixed h class.
123 (riscv_std_h_ext_strtab): Likewise.
124 (riscv_ext_h_valid_p): Likewise.
125 (parse_config): Likewise.
126 (riscv_std_z_ext_strtab): Add zifencei.
127 * elfxx-riscv.h (riscv_isa_ext_class): Add RV_ISA_CLASS_H.
128
e8d4709e
NC
1292020-12-01 Nelson Chu <nelson.chu@sifive.com>
130
131 * elfxx-riscv.c (riscv_parse_subset): ISA string cannot contain
132 any uppercase letter.
133
d541518b
NC
1342020-12-01 Nelson Chu <nelson.chu@sifive.com>
135
136 * elfxx-riscv.c: Re-indent codes, unify and improve the error
137 messages and comments.
138 (riscv_parse_prefixed_ext): Stop parsing the prefixed class
139 extensions if the class is RV_ISA_CLASS_UNKNOWN, I get internal
140 errors before adding this check for march-fail-porder* testcases.
141 (riscv_parse_subset): Move the rv32 with q checking in front.
142 * elfxx-riscv.h: Likewise.
143
5160d0f3
AM
1442020-12-01 Alan Modra <amodra@gmail.com>
145
146 PR 26979
147 * elf-bfd.h (elf_backend_merge_symbol_attribute): Update prototype.
148 * elf32-m68hc1x.h (elf32_m68hc11_merge_symbol_attribute): Likewise.
149 * elfxx-mips.h (_bfd_mips_elf_merge_symbol_attribute): Likewise.
150 * elfxx-x86.h (_bfd_x86_elf_merge_symbol_attribute): Likewise.
151 * elf32-m68hc1x.c (elf32_m68hc11_merge_symbol_attribute): Replace
152 isym parameter with st_other. Adjust code.
153 * elf64-alpha.c (elf64_alpha_merge_symbol_attribute): Likewise.
154 * elf64-ppc.c (ppc64_elf_merge_symbol_attribute): Likewise.
155 * elfnn-aarch64.c (elfNN_aarch64_merge_symbol_attribute): Likewise.
156 * elfxx-mips.c (_bfd_mips_elf_merge_symbol_attribute): Likewise.
157 * elfxx-x86.c (_bfd_x86_elf_merge_symbol_attribute): Likewise.
158 * elflink.c (elf_merge_st_other): Likewise.
159 (_bfd_elf_merge_symbol, elf_link_add_object_symbols): Adjust to suit.
160 (_bfd_elf_copy_link_hash_symbol_type): Likewise.
161 (_bfd_elf_add_default_symbol): Merge st_other from undecorated
162 symbol and @VER symbol to @@VER symbol.
163
8d748d1d
AM
1642020-11-28 Alan Modra <amodra@gmail.com>
165
166 PR 26907
167 * elf.c (elf_sort_sections): Don't sort zero size !load sections
168 after load sections.
169
2c6f3e56
JL
1702020-11-27 Jozef Lawrynowicz <jozef.l@mittosystems.com>
171
172 * elf.c (special_sections_g): Add .gnu.linkonce.n and .gnu.linkonce.p.
173 (special_sections_n): Add .noinit.
174 (special_sections_p): Add .persistent.
175
647cebce
NC
1762020-11-26 Nick Clifton <nickc@redhat.com>
177
178 PR 26946
179 * dwarf2.c (read_section): Check for debug sections with excessive
180 sizes.
181
58349d00
L
1822020-11-25 H.J. Lu <hongjiu.lu@intel.com>
183
184 PR ld/26936
185 * elflink.c (_bfd_elf_check_kept_section): Get the real kept
186 section.
187
f60742b2
NC
1882020-11-23 Nick Clifton <nickc@redhat.com>
189
190 PR 26931
191 * elf-bfd.h (struct elf_backend_data): Add bfd_boolean field to
192 slurp_secondary_relocs field.
193 (_bfd_elf_slurp_secondary_reloc_section): Update prototype.
194 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Add new
195 parameter. Compute number of symbols based upon the new
196 parameter.
197 * elfcode.h (elf_slurp_reloc_table): Pass dynamic as new
198 parameter.
199
cbf097d7
L
2002020-11-23 H.J. Lu <hongjiu.lu@intel.com>
201
202 PR ld/26918
203 * elf64-s390.c (elf_s390_finish_dynamic_sections): Set .got
204 sh_entsize only if .got size > 0.
205
abd20cb6
NC
2062020-11-21 Nelson Chu <nelson.chu@sifive.com>
207
208 * elfnn-riscv.c (_bfd_riscv_relax_section): Add a new relax pass
209 to do the pcgp relaxation later, after the lui and call relaxations,
210 but before the delete and alignment relaxations.
211
3d16b64e
NA
2122020-11-20 Nick Alcock <nick.alcock@oracle.com>
213
214 * elflink.c (elf_finalize_dynstr): Call examine_strtab after
215 dynstr finalization.
216 (elf_link_swap_symbols_out): Don't call it here. Call
217 ctf_new_symbol before swap_symbol_out.
218 (elf_link_output_extsym): Call ctf_new_dynsym before
219 swap_symbol_out.
220 (bfd_elf_final_link): Likewise.
221 * elf.c (swap_out_syms): Pass in bfd_link_info. Call
222 ctf_new_symbol before swap_symbol_out.
223 (_bfd_elf_compute_section_file_positions): Adjust.
224
a4eba608
NC
2252020-11-19 Nick Clifton <nickc@redhat.com>
226
227 PR 26918
228 * elf64-s390.c (elf_s390_finish_dynamic_sections): Check for the
229 existance of an sgot output section before setting the
230 sh_entsize.
231
99fabbc9
JL
2322020-11-18 Jozef Lawrynowicz <jozef.l@mittosystems.com>
233 H.J. Lu <hongjiu.lu@intel.com>
234
235 * elf-bfd.h (enum elf_gnu_osabi): Add elf_gnu_osabi_retain.
236 (struct elf_obj_tdata): Increase has_gnu_osabi to 4 bits.
237 * elf.c (_bfd_elf_make_section_from_shdr): Set elf_gnu_osabi_retain
238 for SHF_GNU_RETAIN.
239 (_bfd_elf_final_write_processing): Report if SHF_GNU_RETAIN is
240 not supported by the OSABI.
241 Adjust error messages.
242 * elflink.c (elf_link_input_bfd): Copy enabled has_gnu_osabi bits from
243 input BFD to output BFD.
244 (bfd_elf_gc_sections): gc_mark the section if SHF_GNU_RETAIN is set.
245
1bbda94f
PW
2462020-11-16 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
247
248 * cpu-arm.c (processors): Add Cortex-A78C.
249
0dd7428d
TT
2502020-11-11 Tom Tromey <tromey@adacore.com>
251
252 * archive.c (getuid, getgid): Move...
253 * sysdep.h (getuid, getgid): ...here.
254
5cbc0eb0
AM
2552020-11-09 Alan Modra <amodra@gmail.com>
256
257 * vms-alpha.c (alpha_vms_write_exec): Write 16 bits to eihd.alias.
258
904790e2
AM
2592020-11-09 Alan Modra <amodra@gmail.com>
260
261 * archive.c (bfd_ar_hdr_from_filesystem): Use bfd_set_input_error
262 when stat of archive member fails.
263 * coff-rs6000.c (xcoff_write_archive_contents_old),
264 (xcoff_write_archive_contents_big): Likewise, and handle in-memory
265 bfd.
266
706d7ce9
AM
2672020-11-03 Alan Modra <amodra@gmail.com>
268
269 * elf.c (bfd_section_from_shdr): Free sections_being_created.
270 Use bfd_zmalloc.
271
b1a92c63
AM
2722020-11-02 Alan Modra <amodra@gmail.com>
273
274 PR 15146
275 PR 26314
276 PR 26530
277 PR 26806
278 * elflink.c (elf_link_add_object_symbols): Don't set def/ref flags
279 for plugin syms. Do allow plugin syms to mark as-needed libs.
280
b0ab0693
L
2812020-10-30 H.J. Lu <hongjiu.lu@intel.com>
282
283 PR gas/26703
284 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Generate
285 GNU_PROPERTY_X86_ISA_1_BASELINE for -z x86-64-baseline.
286
8ee54925
NC
2872020-10-29 Nick Clifton <nickc@redhat.com>
288
289 PR 26809
290 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Use the correct
291 sized reloc reading function.
292 (_bfd_elf_write_secondary_reloc_section): Use the correct sized
293 reloc writing function.
294
2aec1123
NC
2952020-10-28 Nick Clifton <nickc@redhat.com>
296
297 PR 26774
298 * srec.c (srec_write_symbols): Do not emit symbols in sections
299 that have been removed from the output.
300
27e5e547
NC
3012020-10-27 Nick Clifton <nickc@redhat.com>
302
303 * elf64-hppa.c (elf_hppa_final_link_relocate): Check that the
304 symbol's section is being output before adding its offset to the
305 addend when processing R_PARISC_SECREL32.
306
0c70050a
AM
3072020-10-25 Alan Modra <amodra@gmail.com>
308
309 * vms-misc.c (_bfd_vms_save_counted_string): Count length byte
310 towards maxlen.
311
777cd7ab
DDAG
3122020-10-20 Dr. David Alan Gilbert <dgilbert@redhat.com>
313
314 * po/es.po: Fix printf format.
315
51a8a7c2
NC
3162020-10-16 Nelson Chu <nelson.chu@sifive.com>
317
318 * elfnn-riscv.c (riscv_elf_link_hash_table): Add last_iplt_index.
319 (riscv_elf_size_dynamic_sections): Initialize the last_iplt_index.
320 (riscv_elf_relocate_section): Use riscv_elf_append_rela.
321 (riscv_elf_finish_dynamic_symbol): If the use_elf_append_rela is
322 false, then we should add the dynamic relocs from the last of
323 the .rela.iplt, and don't use the riscv_elf_append_rela to add.
324
02dd9d25
NC
3252020-10-16 Nelson Chu <nelson.chu@sifive.com>
326
327 * elfnn-riscv.c: Include "objalloc.h" since we need objalloc_alloc.
328 (riscv_elf_link_hash_table): Add loc_hash_table and loc_hash_memory
329 for local STT_GNU_IFUNC symbols.
330 (riscv_elf_got_plt_val): Removed.
331 (riscv_elf_local_htab_hash, riscv_elf_local_htab_eq): New functions.
332 Use to compare local hash entries.
333 (riscv_elf_get_local_sym_hash): New function. Find a hash entry for
334 local symbol, and create a new one if needed.
335 (riscv_elf_link_hash_table_free): New function. Destroy an riscv
336 elf linker hash table.
337 (riscv_elf_link_hash_table_create): Create hash table for local ifunc.
338 (riscv_elf_check_relocs): Create a fake global symbol to track the
339 local ifunc symbol. Add support to check and handle the relocations
340 reference to ifunc symbols.
341 (allocate_dynrelocs): Let allocate_ifunc_dynrelocs and
342 allocate_local_ifunc_dynrelocs to handle the ifunc symbols if they
343 are defined and referenced in a non-shared object.
344 (allocate_ifunc_dynrelocs): New function. Allocate space in .plt,
345 .got and associated reloc sections for ifunc dynamic relocs.
346 (allocate_local_ifunc_dynrelocs): Likewise, but for local ifunc
347 dynamic relocs.
348 (riscv_elf_relocate_section): Add support to handle the relocation
349 referenced to ifunc symbols.
350 (riscv_elf_size_dynamic_sections): Updated.
351 (riscv_elf_adjust_dynamic_symbol): Updated.
352 (riscv_elf_finish_dynamic_symbol): Finish up the ifunc handling,
353 including fill the PLT and GOT entries for ifunc symbols.
354 (riscv_elf_finish_local_dynamic_symbol): New function. Called by
355 riscv_elf_finish_dynamic_symbol to handle the local ifunc symbols.
356 (_bfd_riscv_relax_section): Don't do the relaxation for ifunc.
357 * elfxx-riscv.c: Add R_RISCV_IRELATIVE.
358 * configure.ac: Link elf-ifunc.lo to use the generic ifunc support.
359 * configure: Regenerated.
360
e7f2f959
AM
3612020-10-16 Alan Modra <amodra@gmail.com>
362
363 * elf32-arc.c (replace_func): Correct return type.
364 (get_replace_function): Use a replace_func function pointer rather
365 than void*. Update associated ARC_RELOC_HOWTO define.
366
db75b8f7
AM
3672020-10-16 Alan Modra <amodra@gmail.com>
368
369 * elf32-cr16.c: Formatting.
370 (cr16_elf_final_link_relocate): Sign extend rather than clumsy
371 "add or subtract" of offset value. Simplify range checks. Move
372 common code out of "if" branches. Don't refetch insn fields
373 needlessly.
374
fba8689a
AM
3752020-10-16 Alan Modra <amodra@gmail.com>
376
377 * elf64-ppc.c (ppc64_elf_relocate_section): Tighten sanity check
378 on R_PPC64_GOT_LO_DS and R_PPC64_GOT_HA instructions.
379
fa40fbe4
AM
3802020-10-09 Alan Modra <amodra@gmail.com>
381
382 * elf64-ppc.c (write_plt_relocs_for_local_syms): Don't do local
383 entry offset optimisation.
384
32930e4e
L
3852020-10-09 H.J. Lu <hongjiu.lu@intel.com>
386
387 PR gas/26703
388 * elf-linker-x86.h (elf_linker_x86_params): Add isa_level.
389 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Merge
390 GNU_PROPERTY_X86_ISA_1_V[234].
391 (_bfd_x86_elf_link_setup_gnu_properties): Generate
392 GNU_PROPERTY_X86_ISA_1_V[234] for -z x86-64-v[234].
393
574df58f
L
3942020-10-06 H.J. Lu <hongjiu.lu@intel.com>
395
396 PR ld/26711
397 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Merge -z ibt
398 and -z shstk only with GNU_PROPERTY_X86_FEATURE_1_AND.
399
6afcdeb3
BB
4002020-10-06 Brandon Bergren <bdragon@FreeBSD.org>
401
402 * config.bfd: Add powerpc64le-*-freebsd*.
403 * configure.ac: Add powerpc_elf64_fbsd_le_vec.
404 * elf64-ppc.c (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Define for
405 freebsd.
406 * targets.c (powerpc_elf64_fbsd_le_vec): Declare.
407 (_bfd_target_vector): Add it.
408 * configure: Regenerate.
409
c0b31344
NC
4102020-10-05 Kamil Rytarowski <n54@gmx.com>
411
412 * config.bfd (aarch64-*-netbsd*, aarch64_be-*-netbsd*): Add target.
413
b71702f1
NC
4142020-10-05 Nick Clifton <nickc@redhat.com>
415
416 PR 26253
417 * elf.c (_bfd_elf_setup_sections): Do not complain about an
418 sh_link value of zero when the SLF_LINK_ORDER flag is set.
419 (assign_section_numbers): Likewise.
420
7026832e
L
4212020-10-02 H.J. Lu <hongjiu.lu@intel.com>
422
423 PR 26681
424 * elflink.c (bfd_elf_gc_sections): Do not arbitrarily keep note
425 sections which are linked to another section.
426
3a959875
PW
4272020-09-30 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
428
429 * cpu-arm.c: Add cortex-a78 and cortex-a78ae.
430
394e9bf6
PW
4312020-09-28 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
432
433 * cpu-arm.c: (processors) Add Cortex-X1.
434
12cf8b93
AM
4352020-09-28 Alan Modra <amodra@gmail.com>
436
437 PR 26656
438 * elf64-ppc.c (ppc_build_one_stub, ppc_size_one_stub): Check for
439 NULL stub_entry->h before calling is_tls_get_addr.
440
3cd7c7d7
AM
4412020-09-26 Alan Modra <amodra@gmail.com>
442
443 * elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Depend on has_plt_localentry0.
444 (LD_R0_0R11, ADD_R11_R0_R11): Define.
445 (ppc64_elf_tls_setup): Disable params->plt_localentry0 when power10
446 code detected.
447 (ppc64_elf_size_stubs): Update __glink_PLTresolve eh_frame.
448 (ppc64_elf_build_stubs): Move r2 save to start of __glink_PLTresolve,
449 and only emit for has_plt_localentry0. Don't use r2 in the stub.
450
29433886
AM
4512020-09-24 Alan Modra <amodra@gmail.com>
452
453 PR 26656
454 * elf64-ppc.c (plt_stub_size): Add "odd" param. Use it with
455 size_power10_offset rather than calculating from start of stub.
456 Add size for notoc tls_get_addr_opt stub.
457 (plt_stub_pad): Add "odd" param, pass to plt_stub_size.
458 (build_tls_get_addr_head, build_tls_get_addr_tail): New functions.
459 (build_tls_get_addr_stub): Delete.
460 (ppc_build_one_stub): Use a temp for htab->params->stub_bfd.
461 Emit notoc tls_get_addr_opt stub. Move eh_frame code to
462 suit. Adjust code to use bfd_tls_get_addr_head/tail in place
463 of build_tls_get_addr_stub.
464 (ppc_size_one_stub): Size notoc tls_get_addr_opt stub.
465 Adjust plt_stub_size and plt_stub_pad calls. Correct "odd"
466 when padding stub. Size eh_frame for notoc stub too.
467 Correct lr_restore value.
468 (ppc64_elf_relocate_section): Don't skip over first insn of
469 notoc tls_get_addr_opt stub.
470
c9405344
AM
4712020-09-24 Alan Modra <amodra@gmail.com>
472
473 PR 26655
474 * elf64-ppc.c (ppc64_elf_func_desc_adjust): Rename to..
475 (ppc64_elf_edit): Call params->edit.
476 (ppc64_elf_tls_setup): Don't call _bfd_elf_tls_setup. Return a
477 bfd_boolean.
478 * elf64-ppc.h (struct ppc64_elf_params): Add "edit".
479 (ppc64_elf_tls_setup): Update declaration.
480
b1b11e92
AM
4812020-09-21 Alan Modra <amodra@gmail.com>
482
483 PR 26569
484 * elfxx-riscv.c (howto_table): Correct size and bitsize of
485 R_RISCV_RVC_BRANCH, R_RISCV_RVC_JUMP, and R_RISCV_RVC_LUI.
486 Correct size for R_RISCV_TLS_DTPMOD32, R_RISCV_TLS_DTPREL32,
487 R_RISCV_CALL, and R_RISCV_CALL_PLT. Make R_RISCV_TPREL_ADD and
488 R_RISCV_ALIGN like R_RISCV_NONE. Correct dst_mask many relocs.
489
dd80eb2c
MP
4902020-09-17 Mikael Pettersson <mikpelinux@gmail.com>
491
492 PR ld/18808
493 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Skip IFUNC
494 relocations in debug sections, change abort to _bfd_error_handler.
495
36068e2f
L
4962020-09-16 H.J. Lu <hongjiu.lu@intel.com>
497
498 PR ld/26583
499 * config.bfd (targ64_selvecs, targ_selvecs): Add x86_64_pe_vec
500 to x86_64_pei_vec.
501 * reloc.c: Include "coff/internal.h".
502 (bfd_perform_relocation): Adjust relocation for PE/x86-64 inputs.
503
c1229f84
AM
5042020-09-16 Alan Modra <amodra@gmail.com>
505
506 * elf-bfd.h (elf_symbol_from): Remove unused ABFD parameter.
507 * elf.c (ignore_section_sym, _bfd_elf_copy_private_symbol_data),
508 (swap_out_syms): Adjust elf_symbol_from invocation.
509
ec74481d
AM
5102020-09-16 Alan Modra <amodra@gmail.com>
511
512 PR 26623
513 * elf-bfd.h (elf_symbol_from): Exclude synthetic symbols.
514
ec6653d8
L
5152020-09-15 H.J. Lu <hongjiu.lu@intel.com>
516
517 * coff-x86_64.c (howto_table): Display PE relocation names.
518
4a8f181d
HPN
5192020-09-15 Hans-Peter Nilsson <hp@axis.com>
520
521 PR ld/26589
522 * elf32-cris.c (cris_elf_check_relocs): Add missing NULL check
523 on argument before calling UNDEFWEAK_NO_DYNAMIC_RELOC.
524
496afd17
L
5252020-09-12 H.J. Lu <hongjiu.lu@intel.com>
526
527 PR ld/26391
528 * elflink.c (elf_final_link_info): Add local_hash_table.
529 (local_hash_entry): New.
530 (local_hash_newfunc): Likewise.
531 (elf_link_output_symstrtab): Append ".COUNT" to duplicated local
532 symbols.
533 (bfd_elf_final_link): Initialize and free local_hash_table for
534 "-z unique-symbol".
535
c7cd2917
SP
5362020-09-10 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
537
538 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Revert
539 changes in 7e05773767820b441b23a16628b55c98cb1aef46. Set
540 error for undefined symbol in BFD_RELOC_AARCH64_BRANCH19 and
541 BFD_RELOC_AARCH64_TSTBR14 relocations.
542
10556cdc
NC
5432020-09-09 Nick Clifton <nickc@redhat.com>
544
545 * cofflink.c (coff_link_check_archive_element): Move the check for
546 coff type input to the start of the function.
547
47485a31
AM
5482020-09-09 Alan Modra <amodra@gmail.com>
549
550 * libbfd-in.h (_bfd_write_unsigned_leb128): Declare.
551 * libbfd.h: Regenerate.
552
7d81bc93 5532020-09-08 Jozef Lawrynowicz <jozef.l@mittosystems.com>
47485a31 554 Kuan-Lin Chen <kuanlinchentw@gmail.com>
7d81bc93
JL
555
556 * bfd-in2.h (bfd_reloc_code_real): Add
557 BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
558 * elf32-msp430.c (msp430_elf_ignore_reloc): New.
559 (elf_msp430_howto_table): Add R_MSP430{,X}_GNU_{SET,SUB}_ULEB128.
560 (msp430_reloc_map): Add R_MSP430_GNU_{SET,SUB}_ULEB128.
561 (msp430x_reloc_map): Add R_MSP430X_GNU_{SET,SUB}_ULEB128.
562 (write_uleb128): New.
563 (msp430_final_link_relocate): Handle R_MSP430{,X}_GNU_{SET,SUB}_ULEB128.
564 * libbfd.c (_bfd_write_unsigned_leb128): New.
565 * libbfd.h (_bfd_write_unsigned_leb128): New prototype.
566 Add BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
567 * reloc.c: Document BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
568
95830c98
AC
5692020-09-08 Alex Coplan <alex.coplan@arm.com>
570
571 * archures.c (bfd_mach_aarch64_8R): New.
572 * bfd-in2.h: Regenerate.
573 * cpu-aarch64.c (bfd_aarch64_arch_v8_r): New.
574 (bfd_aarch64_arch_ilp32): Update tail pointer.
575
7ba11550
AM
5762020-09-08 Alan Modra <amodra@gmail.com>
577
578 PR 13250
579 PR 26580
580 * elflink.c (_bfd_elf_merge_symbol): Make "override" a bfd**.
581 Return oldbfd in override when old common should override new
582 common.
583 (_bfd_elf_add_default_symbol): Adjust to suit.
584 (elf_link_add_object_symbols): Likewise. Pass "override" to
585 _bfd_generic_link_add_one_symbol. Save and restore common u.c.p
586 field for --as-needed shared libraries. Revert pr13250 changes.
587
b5ffa918
NC
5882020-09-08 Nick Clifton <nickc@redhat.com>
589
590 * plugin.c (bfd_plugin_canonicalize_symtab): Handle the case of an
591 unrecognized symbol type in a weak definition.
592
8642dafa
AM
5932020-09-04 Alan Modra <amodra@gmail.com>
594
595 PR 26574
596 * elfcode.h (elf_object_p): Sanity check section header offset.
597 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Sanity check
598 sh_entsize.
599
1e3b96fd
AM
6002020-09-04 Alan Modra <amodra@gmail.com>
601
602 PR 15146
603 PR 26314
604 PR 26530
605 * elflink.c (elf_link_add_object_symbols): Do set def_regular
606 and ref_regular for IR symbols. Don't clear dynsym, allowing
607 IR symbols to load --as-needed shared libraries, but prevent
608 IR symbols from becoming dynamic.
609
ac267c75
NC
6102020-09-03 Nick Clifton <nickc@redhat.com>
611
612 PR 26521
613 * elf.c (_bfd_elf_write_secondary_reloc_section): Check for
614 secondary reloc sections with a zero sh_entsize field.
615
9184ef8a
NC
6162020-09-03 Nelson Chu <nelson.chu@sifive.com>
617
618 * elfnn-riscv.c (riscv_i_or_e_p): Minor cleanup for warnings/errors.
619 (riscv_merge_std_ext): Likewise.
620 (riscv_merge_arch_attr_info): Likewise.
621 (riscv_merge_attributes): Likewise and fix comment typos.
622
32f0ce4d
NC
6232020-09-03 Nelson Chu <nelson.chu@sifive.com>
624
625 * elfnn-riscv.c (riscv_version_mismatch): Change the return type
626 from void to bfd_boolean. Report warnings rather than errors
627 when the ISA versions are mis-matched. Afterwards, remember to
628 update the output ISA versions to the newest ones.
629 (riscv_merge_std_ext): Allow to link objects with different
630 standard ISA versions. Try to add output ISA versions to
631 merged_subsets first.
632 (riscv_merge_multi_letter_ext): Likewise. But for standard additional
633 ISA and non-standard ISA versions.
634
72bd6912
KC
6352020-09-03 Kito Cheng <kito.cheng@sifive.com>
636
637 * elfnn-riscv.c (riscv_merge_std_ext): Fix to report the correct
638 error message when the versions of extension are mis-matched.
639 * elfxx-riscv.c (riscv_parse_subset): Don't issue the error when
640 the string is empty.
641
d48b742b
AM
6422020-09-03 Alan Modra <amodra@gmail.com>
643
644 * xcofflink.c (xcoff_get_archive_info): Allocate xcoff_archive_info
645 on the output bfd objalloc memory.
646
26009aa7
AM
6472020-09-02 Alan Modra <amodra@gmail.com>
648
649 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Correct type
650 of constant shifted left.
651
2f26cc79
AM
6522020-09-02 Alan Modra <amodra@gmail.com>
653
654 * elf32-pru.c (pru_elf32_do_ldi32_relocate): Use an unsigned
655 type for "relocation".
656
821e059c
AM
6572020-09-01 Alan Modra <amodra@gmail.com>
658
659 * reloc.c (N_ONES): Handle N=0.
660 * elf32-arm.c (elf32_arm_howto_table_1): Set complain_overflow_dont
661 for R_ARM_TLS_DESCSEQ and R_ARM_THM_TLS_DESCSEQ.
662
f911bb22
AM
6632020-09-01 Alan Modra <amodra@gmail.com>
664
665 PR 26429
666 * elf32-arm.c (elf32_arm_allocate_local_sym_info): Allocate arrays
667 in descending order of alignment.
668
00c91124
AM
6692020-09-01 Alan Modra <amodra@gmail.com>
670
671 PR 26423
672 * elf32-arm.c (calculate_group_reloc_mask): Use 3u in shift.
673
1174d920
AM
6742020-08-31 Alan Modra <amodra@gmail.com>
675
676 PR 26493
677 * elfnn-riscv.c (riscv_make_plt_header): Cast PLT_HEADER_SIZE to
678 unsigned when using with RISCV_ITYPE.
679 (_bfd_riscv_relax_call): Use an unsigned foff.
680
227d539b
AM
6812020-08-31 Alan Modra <amodra@gmail.com>
682
683 PR 26476
684 PR 26477
685 * elfxx-mips.c (CRINFO_CTYPE, CRINFO_RTYPE, CRINFO_DIST2TO),
686 (CRINFO_RELVADDR): Make unsigned.
687 (mips_elf_nullify_got_load): Use unsigned constant when shifting
688 into sign bit.
689
1a211fc7
AM
6902020-08-31 Alan Modra <amodra@gmail.com>
691
692 PR 26466
693 * mep-relocs.pl (emit_apply): Handle HI16S adjustment. Use "u"
694 variable and rewrite signed overflow check.
695 * elf32-mep.c: Regenerate.
696 (mep_final_link_relocate): Delete "s".
697
108f6f97
AM
6982020-08-31 Alan Modra <amodra@gmail.com>
699
700 PR 26461
701 * elfxx-ia64.c (ia64_elf_install_value): Make expressions unsigned
702 that might shift values into sign bit.
703
f2173852
AM
7042020-08-31 Alan Modra <amodra@gmail.com>
705
706 PR 26445
707 * elf32-csky.c (csky_relocate_contents): Make relocation a bfd_vma,
708 and similarly for variables dealing with overflow.
709
c1f138f9
AM
7102020-08-31 Alan Modra <amodra@gmail.com>
711
712 PR 26442
713 * elf32-crx.c (crx_elf_final_link_relocate): Calculate reloc_bits
714 without undefined behaviour. Tidy excess casts.
715
8f383897
AM
7162020-08-31 Alan Modra <amodra@gmail.com>
717
718 * elf-m10300.c (mn10300_elf_relax_delete_bytes): Calculate
719 alignment from reloc addend after reloc type R_MN10300_ALIGN is
720 found.
721
34d8e6d0
AM
7222020-08-30 Alan Modra <amodra@gmail.com>
723
724 PR 26435
725 PR 26436
726 * elf32-cr16.c (cr16_elf_final_link_relocate): Calculate reloc_bits
727 without undefined behaviour.
728
e6f04d55
NC
7292020-08-29 Nick Clifton <nickc@redhat.com>
730
731 PR 26520
732 * dwarf2.c (scan_unit_for_symbols): Add member entries to the
733 variable table.
734
736c9875
AM
7352020-08-29 Alan Modra <amodra@gmail.com>
736
55b8e31a 737 PR 26459
736c9875
AM
738 * elfnn-ia64.c (get_dyn_sym_info): Don't bsearch or look at last
739 element when count is zero. bfd_realloc when shrinking.
740
07319acc
AM
7412020-08-28 Alan Modra <amodra@gmail.com>
742
743 PR 26418
744 * ecofflink.c (bfd_ecoff_write_accumulated_debug): Don't write
745 zero size buffers.
746
7ca371db
AM
7472020-08-28 Alan Modra <amodra@gmail.com>
748
749 PR 26418
750 * ecofflink.c (WRITE): Really don't write zero size chunks.
751
1e597a89
T
7522020-08-28 Tuckker <tuckkern+sourceware@gmail.com>
753
754 PR 26543
755 * linker.c (bfd_generic_define_common_symbol): Force the alignment
756 to 1 if the section has now alignment requirement.
757
0861f561
CQ
7582020-08-28 Cooper Qu <cooper.qu@linux.alibaba.com>
759
760 * elf32-csky.c (csky_archs): Fix arch names.
761 (csky_find_arch_with_name): New.
762 (elf32_csky_merge_attributes): New.
763 (csky_elf_merge_private_bfd_data): Add process of merge
764 attribute section.
765 (elf32_csky_obj_attrs_arg_type): New.
766 (elf32_csky_obj_attrs_handle_unknown): New.
767 (elf_backend_obj_attrs_vendor): Define.
768 (elf_backend_obj_attrs_section): Define.
769 (elf_backend_obj_attrs_arg_type): Define.
770 (elf_backend_obj_attrs_section_type): Define.
771
6194b866
NC
7722020-08-28 Nick Clifton <nickc@redhat.com>
773
774 PR19011
775 * cofflink.c (_bfd_coff_generic_relocate_section): Provide a value
776 for undefined symbols which will not generate extra warning
777 messages about truncated relocs.
778
3b1450b3
NC
7792020-08-28 Nelson Chu <nelson.chu@sifive.com>
780
781 * elfnn-riscv.c (riscv_elf_check_relocs): Treat R_RISCV_CALL
782 and R_RISCV_CALL_PLT as the same in the riscv_elf_check_relocs.
783 (riscv_elf_relocate_section): Remove the R_RISCV_CALL for the
784 unresolved reloc checks.
785
9e7ed8b0
JDA
7862020-08-27 John David Anglin <danglin@gcc.gnu.org>
787
788 PR 26356
789 * som.c (som_bfd_copy_private_section_data): Issue error when a
790 subspace is specified without its containing space.
791
4b69ce9b
AM
7922020-08-27 Alan Modra <amodra@gmail.com>
793
794 PR 26469
795 * elflink.c: Include limits.h.
796 (CHAR_BIT): Provide fallback define.
797 (set_symbol_value): Correct complex reloc comment.
798 (undefined_reference): Set bfd_error.
799 (BINARY_OP_HEAD, BINARY_OP_TAIL): Split out from..
800 (BINARY_OP): ..this.
801 (eval_symbol): Limit shifts. Force unsigned for left shift.
802 Catch divide by zero.
803 * configure.ac (AC_CHECK_HEADERS): Combine, sort and add limits.h.
804 * configure: Regenerate.
805 * config.in: Regenerate.
806
cd570d49
AM
8072020-08-27 Alan Modra <amodra@gmail.com>
808
809 PR 26462
810 * reloc.c (bfd_check_overflow): Return early if zero bitsize.
811
2ac865ac
AM
8122020-08-27 Alan Modra <amodra@gmail.com>
813
814 * elf32-arm.c (elf32_arm_final_link_relocate): Don't segfault
815 on sym_sec not being output.
816
c415c83b
AM
8172020-08-27 Alan Modra <amodra@gmail.com>
818
819 PR 26416
820 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Correct "dynamic".
821
b74a6c60
NC
8222020-08-26 Nick Clifton <nickc@redhat.com>
823
8c51f2f2
NC
824 PR 26433
825 * elf32-avr.c (avr_final_link_relocate): Fix undefined shift
826 behaviour.
827 (avr_elf32_load_records_from_section): Use bfd_get_16 and
828 bfd_get_32 to load values from potentially unaligned pointers.
829
eae0b5c3
NC
830 PR 26416
831 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Test for and
832 ignore local symbols.
833 (elf64_alpha_relax_got_load): Do not check for local dynamic
834 symbols.
835 (OP_LDA, OP_LDAH, OP_LDQ, OP_BR, OP_BSR): Use unsigned constant
836 values.
837 (INSN_A) Cast the A parameter to unsigned.
838 (INSN_AB): Define in terms of INSN_A.
839 (INSN_ABC): Likewise.
840 (INSN_ABO): Likewise.
841 (INSN_AD): Likewise.
842
b74a6c60
NC
843 PR 26411
844 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Use an
845 unsigned long constant when creating a mask to test for alignment
846 issues.
847
4d430725
AM
8482020-08-26 Alan Modra <amodra@gmail.com>
849
850 PR 26507
851 * elf32-xtensa.c (find_removed_literal): Don't bsearch empty map.
852
252e57fd
AM
8532020-08-26 Alan Modra <amodra@gmail.com>
854
855 PR 26506
856 * elf32-xtensa.c (elf_xtensa_combine_prop_entries): Return early
857 when section is empty.
858
2d0ce677
AM
8592020-08-26 Alan Modra <amodra@gmail.com>
860
861 PR 26498
862 * elf32-spu.c (find_function_stack_adjust): Use unsigned vars to
863 avoid UB left shift.
864
9e51d549
AM
8652020-08-26 Alan Modra <amodra@gmail.com>
866
867 PR 26484
868 PR 26485
869 PR 26486
870 PR 26487
871 PR 26488
872 PR 26490
873 * elf64-ppc.c (is_tls_get_addr): Avoid UB &h->elf when h is NULL.
874 (ppc64_elf_tls_setup): Likewise.
875 (branch_reloc_hash_match): Likewise.
876 (build_plt_stub): Likewise.
877 (ppc64_elf_relocate_section): Likewise.
878
00bc5e68
AM
8792020-08-26 Alan Modra <amodra@gmail.com>
880
881 PR 26478
882 * mmo.c (mmo_write_symbols_and_terminator): Don't memcpy empty table.
883
55e61b8a
AM
8842020-08-26 Alan Modra <amodra@gmail.com>
885
886 PR 26475
887 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Check
888 sstubs->contents != NULL.
889
66ad6b44
AM
8902020-08-26 Alan Modra <amodra@gmail.com>
891
892 PR 26453
893 * som.c (som_prep_for_fixups): Return early when no symbols.
894
9863cbb7
AM
8952020-08-26 Alan Modra <amodra@gmail.com>
896
897 PR 26418
898 * ecofflink.c (WRITE): Don't write size 0 chunks.
899
c01de193
AM
9002020-08-26 Alan Modra <amodra@gmail.com>
901
902 * bfdio.c (bfd_get_file_size): Don't segv on NULL adata.
903
b4e125d9
AM
9042020-08-26 Alan Modra <amodra@gmail.com>
905
906 PR 26415
907 * vms-misc.c (vms_time_t_to_vms_time): Don't use unsigned short vars.
908
4449c81a
DF
9092020-08-26 David Faust <david.faust@oracle.com>
910
911 * archures.c (bfd_mach_xbpf): Define.
912 * bfd-in2.h: Regenerate.
913 * cpu-bpf.c (bfd_xbpf_arch) New.
914 (bfd_bpf_arch) Update next in list field to point to xbpf arch.
915
13f8a246
AM
9162020-08-26 Alan Modra <amodra@gmail.com>
917
918 * archures.c (bfd_mach_ck860): Define.
919
c3757b58
MW
9202020-08-25 Mark Wielaard <mark@klomp.org>
921
922 * dwarf2.c (struct dwarf2_debug_file): Add dwarf_rnglists_buffer
923 and dwarf_rnglists_size fields.
924 (dwarf_debug_sections): Add debug_rnglists.
925 (dwarf_debug_section_enum): Likewise.
926 (read_debug_rnglists): New function.
927 (read_rangelist): New function to call either read_ranges or
928 read_rnglists. Rename original function to...
929 (read_ranges): ...this.
930 (read_rnglists): New function.
931
1ab8d928
AM
9322020-08-25 Alan Modra <amodra@gmail.com>
933
934 PR 26505
935 * elf32-xstormy16.c (xstormy16_elf_relax_section): Check
936 is_elf_hash_table before accessing elf fields.
937
a93ba4c0
AM
9382020-08-25 Alan Modra <amodra@gmail.com>
939
940 PR 26482
941 * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Ignore sections that
942 won't be output.
943
1438dd86
AM
9442020-08-25 Alan Modra <amodra@gmail.com>
945
946 PR 26463
947 * elf32-m32c.c (m32c_elf_relax_section): Check is_elf_hash_table
948 before accessing elf fields.
949
2186273a
AM
9502020-08-25 Alan Modra <amodra@gmail.com>
951
952 PR 26452
953 * som.c (som_compute_checksum): XOR 32-bit words in header,
954 not unsigned long sized words.
955
0c1438eb
AM
9562020-08-25 Alan Modra <amodra@gmail.com>
957
958 PR 26430
959 * elf-nacl.c (nacl_modify_segment_map): Correct alloc size and
960 amount copied for elf_segment_map defined with one element
961 sections array.
962
d2327e47
AM
9632020-08-25 Alan Modra <amodra@gmail.com>
964
965 PR 26422
966 * elf32-arm.c (elf32_arm_final_link_relocate): Use the appropriate
967 bfd_get_x size function to read addends out of fields. Apply
968 rightshift adjustment too. Don't apply the now unnecessary
969 howto->size shift to branch REL addends. Don't refetch R_ARM_ABS8
970 and R_ARM_ABS16 addends. Don't refetch thumb branch addends.
971 Correct R_ARM_THM_JUMP6 addend.
972
b8ff233b
AM
9732020-08-25 Alan Modra <amodra@gmail.com>
974
975 PR 26419
976 * elf-m10300.c (mn10300_elf_relax_section): Don't attempt access
977 before start of section.
978
0f55320b
AM
9792020-08-25 Alan Modra <amodra@gmail.com>
980
981 * elf-m10300.c (elf32_mn10300_hash_table): Test is_elf_hash_table
982 before accessing elf_hash_table_id.
983 * elf32-arc.c (elf_arc_hash_table): Likewise.
984 * elf32-arm.c (elf32_arm_hash_table): Likewise.
985 * elf32-avr.c (avr_link_hash_table): Likewise.
986 * elf32-bfin.c (bfinfdpic_hash_table): Likewise.
987 * elf32-cris.c (elf_cris_hash_table): Likewise.
988 * elf32-csky.c (csky_elf_hash_table): Likewise.
989 * elf32-frv.c (frvfdpic_hash_table): Likewise.
990 * elf32-hppa.c (hppa_link_hash_table): Likewise.
991 * elf32-lm32.c (lm32_elf_hash_table): Likewise.
992 * elf32-m32r.c (m32r_elf_hash_table): Likewise.
993 * elf32-m68hc1x.h (m68hc11_elf_hash_table): Likewise.
994 * elf32-m68k.c (elf_m68k_hash_table): Likewise.
995 * elf32-metag.c (metag_link_hash_table): Likewise.
996 * elf32-microblaze.c (elf32_mb_hash_table): Likewise.
997 * elf32-nds32.h (nds32_elf_hash_table): Likewise.
998 * elf32-or1k.c (or1k_elf_hash_table): Likewise.
999 * elf32-s390.c (elf_s390_hash_table): Likewise.
1000 * elf32-sh.c (sh_elf_hash_table): Likewise.
1001 * elf32-spu.c (spu_hash_table): Likewise.
1002 * elf32-tilepro.c (tilepro_elf_hash_table): Likewise.
1003 * elf32-xtensa.c (elf_xtensa_hash_table): Likewise.
1004 * elf64-alpha.c (alpha_elf_hash_table): Likewise.
1005 * elf64-hppa.c (hppa_link_hash_table): Likewise.
1006 * elf64-ia64-vms.c (elf64_ia64_hash_table): Likewise.
1007 * elf64-s390.c (elf_s390_hash_table): Likewise.
1008 * elfnn-ia64.c (elfNN_ia64_hash_table): Likewise.
1009 * elfnn-riscv.c (riscv_elf_hash_table): Likewise.
1010 * elfxx-mips.c (mips_elf_hash_table): Likewise.
1011 * elfxx-sparc.h (_bfd_sparc_elf_hash_table): Likewise.
1012 * elfxx-tilegx.c (tilegx_elf_hash_table): Likewise.
1013
3cdad084
JT
10142020-08-21 Jon Turney <jon.turney@dronecode.org.uk>
1015
1016 * elf.c (elfcore_grok_win32pstatus): Change name_size to unsigned
1017 int. Use '%u' format with _bfd_error_handler to render it.
1018
918dc783
AM
10192020-08-25 Alan Modra <amodra@gmail.com>
1020
1021 PR 26489
1022 * elf64-ppc.c (ppc64_elf_size_stubs): Test code_sec->has_toc_reloc
1023 and code_sec->makes_toc_func_call before sec_info[code_sec->id].
1024
573eb292
AM
10252020-08-25 Alan Modra <amodra@gmail.com>
1026
1027 PR 26492
1028 * elf64-ppc.c (ppc_hash_table): Test is_elf_hash_table before
1029 accessing elf_hash_table_id.
1030
a8d549c0
AM
10312020-08-25 Alan Modra <amodra@gmail.com>
1032
1033 PR 26483
1034 * elf32-ppc.c (ppc_elf_hash_table): Test is_elf_hash_table before
1035 accessing elf_hash_table_id.
1036
19d80e5f
MW
10372020-08-24 Mark Wielaard <mark@klomp.org>
1038
1039 * dwarf2.c (read_attribute_value): Handle DW_FORM_data16.
1040 (read_formatted_entries): Likewise. And skip zero entry.
1041
531c73a3
CQ
10422020-08-24 Cooper Qu <cooper.qu@linux.alibaba.com>
1043
1044 * bfd-in2.h (bfd_mach_ck860): New.
1045 * cpu-csky.c (arch_info_struct): Add item for CK860.
1046
252dcdf4
AM
10472020-08-24 Alan Modra <amodra@gmail.com>
1048
1049 * elf32-ppc.c (ppc_elf_check_relocs): Set has_tls_reloc for
1050 high part tprel16 relocs.
1051 (ppc_elf_tls_optimize): Sanity check high part tprel16 relocs.
1052 Clear do_tls_opt on odd instructions.
1053 (ppc_elf_relocate_section): Move TPREL16_HA/LO optimisation later.
1054 Don't sanity check them here.
1055 * elf64-ppc.c (ppc64_elf_check_relocs): Set has_tls_reloc for
1056 high part tprel16 relocs.
1057 (ppc64_elf_tls_optimize): Sanity check high part tprel16 relocs.
1058 Clear do_tls_opt on odd instructions.
1059 (ppc64_elf_relocate_section): Don't sanity check TPREL16_HA.
1060
c40e6650
JDA
10612020-08-23 John David Anglin <danglin@gcc.gnu.org>
1062
1063 PR binutils/26357
1064 * configure.ac: Disable plugins by default on 32-bit hppa*-*-hpux*.
1065 * configure: Regenerate.
1066
3f2e9699
L
10672020-08-22 H.J. Lu <hongjiu.lu@intel.com>
1068
1069 PR ld/26382
1070 * elflink.c (elf_link_output_symstrtab): Keep only one '@' for
1071 versioned symbols, which are defined in shared objects, in
1072 symbol string table.
1073
ccf61261
NC
10742020-08-21 Nick Clifton <nickc@redhat.com>
1075
1076 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan): Only sort
1077 the data map if there are entries in it.
1078 (_bfd_aarch64_erratum_843419_scan): Likewise.
1079
610ed3e0
JB
10802020-08-21 Jan Beulich <jbeulich@suse.com>
1081
1082 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check
1083 last byte of debug dir, not first.
1084
01147b20
NC
10852020-08-20 Nick Clifton <nickc@redhat.com>
1086
1087 PR 26428
1088 * bfd.c (bfd_update_compression_header): Also set the sh_addralign
1089 field in the ELF header of the compressed sections.
1090
44466e45
NC
10912020-08-20 Nick Clifton <nickc@redhat.com>
1092
1093 PR 26406
1094 * elf-bfd.h (struct bfd_elf_section_data): Add
1095 has_secondary_relocs field.
1096 * elf.c (_bfd_elf_copy_special_section_fields): Set the
1097 has_secondary_relocs field for sections which have associated
1098 secondary relocs.
1099 * elfcode.h (elf_write_relocs): Only call write_secondary_relocs
1100 on sections which have associated secondary relocs.
1101
10885e24
AM
11022020-08-15 Alan Modra <amodra@gmail.com>
1103
1104 * elf32-frv.c (elf32_frv_add_symbol_hook): Set SEC_SMALL_DATA on
1105 small common section.
1106 * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
1107 * elf32-microblaze.c (microblaze_elf_add_symbol_hook): Likewise.
1108 * elf32-nds32.c (nds32_elf_add_symbol_hook): Likewise.
1109 * elf32-nios2.c (nios2_elf_add_symbol_hook): Likewise.
1110 * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
1111 * elf32-score.c (s3_bfd_score_elf_add_symbol_hook): Likewise.
1112 * elf32-score7.c (s7_bfd_score_elf_add_symbol_hook): Likewise.
1113 * elf32-tic6x.c (elf32_tic6x_add_symbol_hook): Likewise.
1114 * elf32-v850.c (v850_elf_check_relocs): Likewise.
1115 (v850_elf_add_symbol_hook): Likewise.
1116 * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
1117 * elf64-ia64-vms.c (elf64_ia64_add_symbol_hook): Likewise.
1118 * elfnn-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
1119 * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise.
1120
4d182367
AM
11212020-08-15 Alan Modra <amodra@gmail.com>
1122
1123 PR 26389
1124 * syms.c (bfd_decode_symclass): Choose 'c' for commons only when
1125 SEC_SMALL_DATA.
1126 * elf32-m32r.c (_bfd_m32r_elf_symbol_processing): Set SEC_SMALL_DATA
1127 on small common section.
1128 * elf32-score.c (s3_bfd_score_elf_symbol_processing): Likewise.
1129 * elf32-score7.c (s7_bfd_score_elf_symbol_processing): Likewise.
1130 * elf32-tic6x.c (elf32_tic6x_symbol_processing): Likewise.
1131 * elf32-v850.c (v850_elf_symbol_processing): Likewise.
1132 * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Likewise.
1133 * ecoff.c (ecoff_set_symbol_info, ecoff_link_add_externals): Likewise.
1134
19bddbe9
AM
11352020-08-14 Alan Modra <amodra@gmail.com>
1136
1137 * hash.c (bfd_hash_set_default_size): Use higher_prime_number
1138 rather than another copy of primes. Increase maximum default
1139 size allowed.
1140
2b6ba032
AM
11412020-08-13 Alan Modra <amodra@gmail.com>
1142
73d0dc16 1143 * config.bfd: Obsolete arm*-*-symbianelf*, and ia64*-*-*.
2b6ba032 1144
6738c8a7
AM
11452020-08-13 Alan Modra <amodra@gmail.com>
1146
1147 * elf64-ppc.h (struct ppc64_elf_params): Add no_pcrel_opt.
1148 * elf64-ppc.c (ppc64_elf_relocate_section): Disable GOT reloc
1149 optimizations when --no-toc-optimize. Disable R_PPC64_PCREL_OPT
1150 optimization when --no-pcrel-optimize.
1151
75e100a3
AM
11522020-08-13 Alan Modra <amodra@gmail.com>
1153
1154 PR 26348
1155 * bfd.c (struct bfd): Add read_only.
1156 * elfcode.h (elf_swap_shdr_in): Test both sh_offset and sh_size.
1157 Set read_only on warning.
1158 (elf_object_p): Sanity check program header alignment. Set
1159 read_only on warning.
1160 * bfd-in2.h: Regenerate.
1161
2fef9373
JT
11622020-08-12 Jon Turney <jon.turney@dronecode.org.uk>
1163
1164 * elf.c (elfcore_grok_win32pstatus): Use unsigned int for
1165 win32pstatus note type to avoid signedness comparison warning.
1166
404ec933
JT
11672020-07-21 Jon Turney <jon.turney@dronecode.org.uk>
1168
1169 * elf.c (elfcore_grok_win32pstatus): Warn on malformed
1170 win32pstatus notes, and return TRUE so we continue rather than
1171 stopping as if it was an error.
1172
d61f3d03
JT
11732020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
1174
1175 * elf.c (elfcore_grok_win32pstatus): Handle NOTE_INFO_MODULE64.
1176
04ec0fa2
JT
11772020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
1178
1179 * elf.c (elfcore_grok_win32pstatus): Don't apply size constraint
1180 for NOTE_INFO_THREAD to all win32pstatus ELF notes, instead apply
1181 appropriate size constraint for each win32pstatus note type.
1182
03c29a6f
JT
11832020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
1184
1185 * elf.c (elfcore_grok_win32pstatus): Don't hardcode the size of
1186 the Win32 API thread CONTEXT type read from a NOTE_INFO_THREAD
1187 win32pstatus note.
1188
8fbac78b
JT
11892020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
1190
1191 * elf.c (NOTE_INFO{_PROCESS,_THREAD,_MODULE}): Define.
1192 (elfcore_grok_win32pstatus): Use.
1193
ff2084b9
JT
11942020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
1195
1196 * elf.c (elfcore_grok_win32pstatus): Fix the offset used to read
1197 the tid from a win32pstatus NOTE_INFO_THREAD ELF note. Fix
1198 offsets used to read NOTE_INFO_PROCESS.
1199
79ddc884
NC
12002020-08-12 Nick Clifton <nickc@redhat.com>
1201
1202 * po/ru.po: Updated Russian translation.
1203 * po/sr.po: Updated Serbian translation.
1204
d844f10a
DF
12052020-08-07 David Faust <david.faust@oracle.com>
1206
1207 * elf64-bpf.c (bpf_elf_relocate_section): Ensure signed division for
1208 DISP16 and DISP32 relocations.
1209
3ee9565c
DF
12102020-08-05 David Faust <david.faust@oracle.com>
1211
1212 * elf64-bpf.c (bpf_elf_generic_reloc): New function.
1213 (bpf_elf_howto_table): Use it here.
1214 (bpf_elf_relocate_section): Use addends recorded in input_bfd for
1215 instruction and data relocations.
1216
e44a1d7b
AM
12172020-08-03 Alan Modra <amodra@gmail.com>
1218
1219 * vms-lib.c (vms_traverse_index): Sanity check size remaining
1220 before accessing vms_idx or vms_elfidx.
1221
b5f386d5
AM
12222020-08-03 Alan Modra <amodra@gmail.com>
1223
1224 PR 26330
1225 * elf.c (_bfd_elf_get_symtab_upper_bound): Sanity check symbol table
1226 size against file size. Correct LONG_MAX limit check.
1227 (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
1228 (_bfd_elf_get_reloc_upper_bound): Don't check file size if writing.
1229 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
1230 * elf64-x86-64-.c (elf_x86_64_get_synthetic_symtab): Use
1231 bfd_malloc_and_get_section.
1232
a896df97
AM
12332020-07-31 Alan Modra <amodra@gmail.com>
1234
1235 PR 26314
1236 * elflink.c (bfd_elf_link_record_dynamic_symbol): Don't allow
1237 IR symbols to become dynamic.
1238 (elf_link_add_object_symbols): Don't exclude IR symbols when
1239 deciding whether an as-needed shared library is needed.
1240
4d3bb356
SN
12412020-07-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
1242
1243 PR ld/26312
1244 * elfnn-aarch64.c (elfNN_aarch64_init_small_plt0_entry): Set sh_entsize
1245 to 0.
1246 (elfNN_aarch64_finish_dynamic_sections): Remove sh_entsize setting.
1247
c8693053
RO
12482020-07-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1249
1250 * bfd.m4 (BFD_SYS_PROCFS_H): New macro.
1251 (BFD_HAVE_SYS_PROCFS_TYPE): Require BFD_SYS_PROCFS_H.
1252 Don't define _STRUCTURED_PROC.
1253 (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
1254 * elf.c [HAVE_SYS_PROCFS_H] (_STRUCTURED_PROC): Don't define.
1255 * configure.ac: Use BFD_SYS_PROCFS_H to check for <sys/procfs.h>.
1256 * configure, config.in: Regenerate.
1257 * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS.
1258 * Makefile.in, doc/Makefile.in: Regenerate.
1259
f1dfbfdb
L
12602020-07-30 H.J. Lu <hongjiu.lu@intel.com>
1261
1262 * elf-bfd.h (sym_cache): Moved before elf_link_hash_table.
1263 (elf_link_hash_table): Add sym_cache.
1264 * elf32-arm.c (elf32_arm_link_hash_table): Remove sym_cache.
1265 (elf32_arm_check_relocs): Updated.
1266 (elf32_arm_size_dynamic_sections): Likewise.
1267 * elf32-bfin.c (bfin_link_hash_table): Removed.
1268 (bfin_link_hash_newfunc): Updated.
1269 (bfin_hash_table): Removed.
1270 * elf32-csky.c (csky_elf_link_hash_table): Remove sym_cache.
1271 (csky_elf_check_relocs): Updated.
1272 * elf32-hppa.c (elf32_hppa_link_hash_table): Remove sym_cache.
1273 (elf32_hppa_check_relocs): Updated.
1274 * elf32-i386.c (elf_i386_tls_transition): Updated.
1275 (elf_i386_convert_load_reloc): Likewise.
1276 (elf_i386_check_relocs): Likewise.
1277 * elf32-m32r.c (elf_m32r_link_hash_table): Removed.
1278 (m32r_elf_hash_table): Updated.
1279 (m32r_elf_link_hash_table_create): Likewise.
1280 (m32r_elf_create_dynamic_sections): Likewise.
1281 (m32r_elf_adjust_dynamic_symbol): Likewise.
1282 (allocate_dynrelocs): Likewise.
1283 (m32r_elf_size_dynamic_sections): Likewise.
1284 (m32r_elf_relocate_section): Likewise.
1285 (m32r_elf_finish_dynamic_symbol): Likewise.
1286 (m32r_elf_check_relocs): Likewise.
1287 * elf32-m68hc1x.h (m68hc11_elf_link_hash_table): Remove
1288 sym_cache.
1289 * elf32-m68k.c (elf_m68k_link_hash_table): Likewise.
1290 (elf_m68k_check_relocs): Updated.
1291 * elf32-metag.c (elf_metag_link_hash_table): Remove sym_cache.
1292 (elf_metag_check_relocs): Updated.
1293 * elf32-microblaze.c (elf32_mb_link_hash_table): Remove sym_sec.
1294 (microblaze_elf_check_relocs): Updated.
1295 * elf32-nds32.c (nds32_elf_link_hash_table_create): Likewise.
1296 (nds32_elf_create_dynamic_sections): Likewise.
1297 (nds32_elf_adjust_dynamic_symbol): Likewise.
1298 (nds32_elf_check_relocs): Likewise.
1299 * elf32-nds32.h (elf_nds32_link_hash_table): Remove sdynbss,
1300 srelbss and aym_cache.
1301 * elf32-nios2.c (elf32_nios2_link_hash_table): Remove sym_cache.
1302 (nios2_elf32_check_relocs): Updated.
1303 * elf32-or1k.c (elf_or1k_link_hash_table): Remove sym_sec.
1304 (or1k_elf_check_relocs): Updated.
1305 * elf32-ppc.c (ppc_elf_check_relocs): Remove sym_cache.
1306 (ppc_elf_check_relocs): Updated.
1307 * elf32-s390.c (elf_s390_link_hash_table): Remove sym_cache.
1308 (elf_s390_check_relocs): Updated.
1309 (elf_s390_finish_dynamic_sections): Likewise.
1310 * elf32-sh.c (elf_sh_link_hash_table): Remove sdynbss, srelbss
1311 and aym_cache.
1312 (sh_elf_create_dynamic_sections): Updated.
1313 (sh_elf_adjust_dynamic_symbol): Likewise.
1314 (sh_elf_size_dynamic_sections): Likewise.
1315 (sh_elf_check_relocs): Likewise.
1316 * elf32-tic6x.c (elf32_tic6x_link_hash_table): Remove sym_cache.
1317 (elf32_tic6x_check_relocs): Updated.
1318 * elf32-tilepro.c (tilepro_elf_link_hash_table): Removed.
1319 (tilepro_elf_hash_table): Updated.
1320 (tilepro_elf_link_hash_table_create): Likewise.
1321 (tilepro_elf_check_relocs): Likewise.
1322 (tilepro_elf_adjust_dynamic_symbol): Likewise.
1323 (allocate_dynrelocs): Likewise.
1324 (tilepro_elf_size_dynamic_sections): Likewise.
1325 (tilepro_elf_relocate_section): Likewise.
1326 (tilepro_elf_finish_dynamic_symbol): Likewise.
1327 (tilepro_finish_dyn): Likewise.
1328 (tilepro_elf_finish_dynamic_sections): Likewise.
1329 * elf64-ppc.c (ppc_link_hash_table): Remove sym_cache.
1330 (ppc64_elf_before_check_relocs): Updated.
1331 (ppc64_elf_check_relocs): Likewise.
1332 * elf64-s390.c (elf_s390_link_hash_table): Remove sym_cache.
1333 (elf_s390_check_relocs): Updated.
1334 (elf_s390_relocate_section): Likewise.
1335 (elf_s390_finish_dynamic_sections): Likewise.
1336 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1337 (elf_x86_64_check_relocs): Likewise.
1338 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
1339 sym_cache.
1340 (elfNN_aarch64_check_relocs): Updated.
1341 * elfnn-riscv.c (riscv_elf_link_hash_table): Remove sym_cache.
1342 (riscv_elf_check_relocs): Updated.
1343 * elfxx-mips.c (mips_elf_link_hash_table): Remove sym_cache.
1344 (mips_elf_resolve_got_page_ref): Updated.
1345 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1346 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
1347 sym_cache.
1348 * elfxx-tilegx.c (tilegx_elf_link_hash_table): Likewise.
1349 (tilegx_elf_check_relocs): Updated.
1350 * elfxx-x86.h (elf_x86_link_hash_table): Remove sym_cache.
1351
c77cb2a0
MR
13522020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
1353
1354 * elflink.c (bfd_elf_final_link): Give local symbols a name if
1355 so requested.
1356 * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): Only
1357 return TRUE if making ET_REL output.
1358
3f1b17bb
MR
13592020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
1360
1361 * elf-bfd.h (elf_backend_data): Add
1362 `elf_backend_elfsym_local_is_section' member.
1363 * elfxx-target.h (elf_backend_elfsym_local_is_section): New
1364 macro.
1365 (elfNN_bed): Add `elf_backend_elfsym_local_is_section' member.
1366 * elflink.c (bfd_elf_final_link): Use it to determine whether
1367 set the `.symtab' section's `sh_info' value to the index of the
1368 first non-local or non-section symbol.
1369 * elf32-mips.c (mips_elf32_elfsym_local_is_section): New
1370 function.
1371 (elf_backend_elfsym_local_is_section): New macro.
1372 * elfn32-mips.c (mips_elf_n32_elfsym_local_is_section): New
1373 function.
1374 (elf_backend_elfsym_local_is_section): New macro.
1375
4d68fd75
AM
13762020-07-29 Alan Modra <amodra@gmail.com>
1377
1378 * elflink.c (bfd_elf_final_link): Don't segfault on local dynsyms
1379 defined in excluded sections.
1380
67411cbf
AM
13812020-07-28 Alan Modra <amodra@gmail.com>
1382
1383 * elf.c (assign_section_numbers): Comment. Don't segfault on
1384 discarded sections when setting linked-to section for generic
1385 ELF linker.
1386 * elflink.c (bfd_elf_match_symbols_in_sections): Allow NULL info.
1387
93fd13c7
AM
13882020-07-27 Alan Modra <amodra@gmail.com>
1389
1390 * xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
1391 similar as absolute.
1392 (bfd_xcoff_import_symbol): Don't fuss over absolute symbol
1393 redefinitions here.
1394
04f096fb
NC
13952020-07-24 Nick Clifton <nickc@redhat.com>
1396
1397 * config.bfd: Move xc16x target to the obsolete list.
1398
5efb6779
KB
13992020-07-22 Kevin Buettner <kevinb@redhat.com>
1400
1401 * binary.c (binary_get_section_contents): Seek using offset
1402 from section's file position.
1403
ea57e509
KB
14042020-07-22 Kevin Buettner <kevinb@redhat.com>
1405
1406 * elf.c (_bfd_elf_make_section_from_phdr): Remove hack for GDB.
04f096fb 1407
1ad2776d
MF
14082020-07-22 Max Filippov <jcmvbkbc@gmail.com>
1409
1410 PR 26246
1411 * elf32-xtensa.c (removed_literal_compare): Use correct pointer
1412 type for the first function argument. Rename pointers to reflect
1413 that they have distinct types.
1414
2f5541f3
AM
14152020-07-20 Alan Modra <amodra@gmail.com>
1416
1417 * elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section.
1418
e10a07b3
AM
14192020-07-19 Alan Modra <amodra@gmail.com>
1420
1421 * elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
1422 (select_alt_stub): New function.
1423 (ppc_get_stub_entry): Use it here.
1424 (ppc64_elf_check_relocs): Set had_power10_relocs rather than
1425 power10_stubs.
1426 (ppc64_elf_size_stubs): Clear power10_stubs here instead. Don't
1427 merge notoc stubs with other varieties when power10_stubs is "auto".
1428 Instead dup the stub hash table entry.
1429 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
1430 tests of power10_stubs.
1431
28b80303
AM
14322020-07-15 Alan Modra <amodra@gmail.com>
1433
1434 PR 26239
1435 * coffgen.c (_bfd_coff_close_and_cleanup): Free dwarf2 info.
1436
4fd8d585
NC
14372020-07-15 Nick Clifton <nickc@redhat.com>
1438
1439 PR26240
1440 * coffgen.c (coff_get_normalized_symtab): Fix off-by-one error in
1441 check for aux entries that overflow the buufer.
1442
a8a48c75
HPN
14432020-07-15 Hans-Peter Nilsson <hp@bitrange.com>
1444
1445 * elf64-mmix.c (mmix_elf_relax_section): Improve accounting for
1446 R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols.
1447
e8a83e93
MB
14482020-07-15 Markus Böck <markus.boeck02@gmail.com>
1449 Alan Modra <amodra@gmail.com>
1450
1451 PR 26198
1452 * coffgen.c (_bfd_coff_section_already_linked): Allow for plugin
1453 objects both before and after normal object files.
1454 * elflink.c (_bfd_elf_section_already_linked): Likewise.
1455
d3b10ee7
AM
14562020-07-10 Alan Modra <amodra@gmail.com>
1457
1458 * elf64-ppc.h (struct ppc64_elf_params): Add power10_stubs.
1459 * elf64-ppc.c (struct ppc_link_hash_table): Delete
1460 power10_stubs.
1461 (ppc64_elf_check_relocs): Adjust setting of power10_stubs.
1462 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
1463 uses of power10_stubs.
1464
fe49679d
AM
14652020-07-09 Alan Modra <amodra@gmail.com>
1466
1467 * coff-ppc.c: Delete.
1468 * pe-ppc.c: Delete.
1469 * pei-ppc.c: Delete.
1470 * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC.
1471 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove
1472 PPCMAGIC code.
1473 (coff_write_object_contents): Remove PPC_PE code.
1474 * config.bfd: Move powerpcle-pe to removed targets.
1475 * configure.ac: Remove powerpc PE entries.
1476 * libcoff-in.h (ppc_allocate_toc_section): Delete.
1477 (ppc_process_before_allocation): Delete.
1478 * peXXigen.c: Remove POWERPC_LE_PE code and comments.
1479 * targets.c: Remove powerpc PE vectors.
1480 * po/SRC-POTFILES.in: Regenerate.
1481 * libcoff.h: Regenerate.
1482 * Makefile.in: Regenerate.
1483 * configure: Regenerate.
1484
7646efdf
NC
14852020-07-09 Nick Clifton <nickc@redhat.com>
1486
1487 * po/fr.po: Updated French translation.
1488
23f5e55e
AM
14892020-07-07 Alan Modra <amodra@gmail.com>
1490
1491 * xcofflink.c (xcoff_mark): Don't mark const sections.
1492 (bfd_xcoff_record_link_assignment): Add FIXME.
1493 (_bfd_xcoff_bfd_final_link): Don't segfault on assorted magic
1494 sections being discarded by linker script.
1495
c8001886
AM
14962020-07-07 Alan Modra <amodra@gmail.com>
1497
1498 * coff-rs6000.c (xcoff_write_archive_contents_old): Set default
1499 time, uid, gid and mode for deterministic archive.
1500 (xcoff_write_archive_contents_big): Likewise.
1501
8af7926f
AM
15022020-07-07 Alan Modra <amodra@gmail.com>
1503
1504 * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
1505 C_AIX_WEAKEXT.
1506
17550be7
NC
15072020-07-06 Nick Clifton <nickc@redhat.com>
1508
1509 * po/pt.po: Updated Portuguese translation.
1510 * po/uk.po: Updated Ukranian translation.
1511
b4396c5e
NC
15122020-07-04 Nick Clifton <nickc@redhat.com>
1513
1514 * version.m4: Set version to 2.35.50.
1515 * configure: Regenerate.
1516 * po/bbfd.pot: Regenerate.
1517
b115b9fd
NC
15182020-07-04 Nick Clifton <nickc@redhat.com>
1519
1520 Binutils 2.35 branch created.
1521
33d1369f
AM
15222020-07-01 Alan Modra <amodra@gmail.com>
1523
1524 PR 26188
1525 * coffgen.c (coff_find_nearest_line_with_names): Sanity check
1526 raw syment index before dereferencing.
1527
cc574a35
AM
15282020-07-01 Alan Modra <amodra@gmail.com>
1529
1530 * elf32-i386.c (elf_backend_object_p): Undef for vxworks.
1531
3443489c
AM
15322020-07-01 Alan Modra <amodra@gmail.com>
1533
1534 * config.bfd: Obsolete xc16x.
1535
bbd19b19
L
15362020-06-30 H.J. Lu <hongjiu.lu@intel.com>
1537
1538 * archures.c (bfd_mach_i386_nacl): Removed.
1539 (bfd_mach_i386_i386_nacl): Likewise.
1540 (bfd_mach_x86_64_nacl): Likewise.
1541 (bfd_mach_x64_32_nacl): Likewise.
1542 * config.bfd: Remove *-*-nacl* targets.
1543 * configure.ac: Remove x86 NaCl target vectors.
1544 * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed.
1545 (bfd_x64_32_nacl_arch): Likewise.
1546 (bfd_x86_64_nacl_arch): Likewise.
1547 (bfd_i386_nacl_arch): Likewise.
1548 (bfd_x64_32_arch_intel_syntax): Updated.
1549 * elf32-i386.c: Don't include "elf-nacl.h".
1550 (elf_i386_nacl_plt): Removed.
1551 (elf_i386_nacl_plt0_entry): Likewise.
1552 (elf_i386_nacl_plt_entry): Likewise.
1553 (elf_i386_nacl_pic_plt0_entry): Likewise.
1554 (elf_i386_nacl_pic_plt_entry): Likewise.
1555 (elf_i386_nacl_eh_frame_plt): Likewise.
1556 (elf_i386_nacl_plt): Likewise.
1557 (elf32_i386_nacl_elf_object_p): Likewise.
1558 (elf_i386_get_synthetic_symtab): Updated.
1559 (elf_i386_link_setup_gnu_properties): Likewise.
1560 * elf64-x86-64.c: Don't include "elf-nacl.h".
1561 (elf_x86_64_nacl_plt): Removed.
1562 (elf64_x86_64_nacl_elf_object_p): Likewise.
1563 (elf_x86_64_nacl_plt0_entry): Likewise.
1564 (elf_x86_64_nacl_plt_entry): Likewise.
1565 (elf_x86_64_nacl_eh_frame_plt): Likewise.
1566 (elf_x86_64_nacl_plt): Likewise.
1567 (elf32_x86_64_nacl_elf_object_p): Likewise.
1568 (elf_x86_64_get_synthetic_symtab): Updated.
1569 (elf_x86_64_link_setup_gnu_properties): Likewise.
1570 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1571 * targets.c: Remove x86 NaCl target vectors.
1572 * bfd-in2.h: Regenerated.
1573 * configure: Likewise.
1574
a57f74bb
L
15752020-06-29 H.J. Lu <hongjiu.lu@intel.com>
1576
1577 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call
1578 _bfd_elf_add_dynamic_tags.
1579
07d22f64
AM
15802020-06-29 Alan Modra <amodra@gmail.com>
1581
1582 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
1583 return value of bfd_bread. Don't read more than requested length.
1584 Sanity check length. Properly terminate file name.
1585
279edac5
AM
15862020-06-29 Alan Modra <amodra@gmail.com>
1587
1588 * arc-got.h: Use C style comments.
1589 * coff-z80.c: Likewise.
1590 * elf32-csky.c: Likewise.
1591 * peXXigen.c: Likewise.
1592 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
1593 code.
1594
85f7484a
PB
15952020-06-26 Pat Bernardi <bernardi@adacore.com>
1596
1597 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
1598 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
1599
ba9b3ef5
AM
16002020-06-26 Alan Modra <amodra@gmail.com>
1601
1602 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
1603 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
1604 (riscv_get_priv_spec_name): Move to..
1605 * cpu-riscv.c: ..here.
1606 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
1607 Use %u to print unsigned numbers.
1608
069057bf
AB
16092020-06-24 Andrew Burgess <andrew.burgess@embecosm.com>
1610
1611 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
1612 default architecture.
1613
2c8e3708
L
16142020-06-24 H.J. Lu <hongjiu.lu@intel.com>
1615
1616 PR ld/26083
1617 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
1618 _bfd_elf_add_dynamic_tags.
1619
c679ec98
L
16202020-06-24 H.J. Lu <hongjiu.lu@intel.com>
1621
1622 PR ld/26083
1623 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
1624 _bfd_elf_add_dynamic_tags.
1625
f8b1e5f6
AM
16262020-06-24 Alan Modra <amodra@gmail.com>
1627
1628 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
1629 shifts without undefined behaviour.
1630
3084d7a2
L
16312020-06-23 H.J. Lu <hongjiu.lu@intel.com>
1632
1633 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
1634 dt_jmprel_required.
1635 (_bfd_elf_add_dynamic_tags): New.
1636 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
1637 _bfd_elf_add_dynamic_tags.
1638 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
1639 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
1640 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
1641 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
1642 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
1643 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
1644 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
1645 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
1646 Likewise.
1647 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
1648 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
1649 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
1650 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
1651 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
1652 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
1653 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
1654 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
1655 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
1656 Likewise.
1657 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
1658 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
1659 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
1660 _bfd_elf_maybe_vxworks_add_dynamic_tags.
1661 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
1662 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
1663 Likewise.
1664 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1665 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1666 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
1667 dt_reloc_sz and dt_reloc_ent.
1668 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
1669 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
1670 Likewise.
1671 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
1672 etab.dt_pltgot_required.
1673 (elf32_hppa_size_dynamic_sections): Call
1674 _bfd_elf_add_dynamic_tags.
1675 * elf32-metag.c (elf_metag_link_hash_table_create): Set
1676 etab.dt_pltgot_required.
1677 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
1678 * elf32-sh.c (sh_elf_link_hash_table_create): Set
1679 root.dt_pltgot_required for FDPIC output.
1680 (sh_elf_size_dynamic_sections): Call
1681 _bfd_elf_maybe_vxworks_add_dynamic_tags.
1682 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
1683 elf.dt_pltgot_required.
1684 (elf_xtensa_size_dynamic_sections): Call
1685 _bfd_elf_add_dynamic_tags.
1686 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
1687 root.dt_pltgot_required.
1688 (elf64_hppa_size_dynamic_sections): Call
1689 _bfd_elf_add_dynamic_tags.
1690 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
1691 root.dt_pltgot_required.
1692 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
1693 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
1694 * elflink.c (_bfd_elf_add_dynamic_tags): New.
1695
d768f160
SJ
16962020-06-22 Saagar Jha <saagar@saagarjha.com>
1697
1698 * mach-o.c: Support the new load commands by reading a linkedit
1699 data command for them.
1700
39ff0b81
NC
17012020-06-22 Nelson Chu <nelson.chu@sifive.com>
1702
1703 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
1704 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
1705 (riscv_get_priv_spec_class): Likewise.
1706 (riscv_get_priv_spec_name): Likewise.
1707 (riscv_get_priv_spec_class_from_numbers): New function, convert
1708 the version numbers into string, then call riscv_get_priv_spec_class
1709 to get the priv spec class.
1710 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
1711 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
1712 (riscv_get_priv_spec_name): Likewise.
1713 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
1714 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
1715 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
1716 of input and output objects form their priv spec attributes by
1717 riscv_get_priv_spec_class_from_numbers. Report warning rather than
1718 errors when linking objects with differnet priv spec versions. We do
1719 know v1.9.1 may have conflicts to other versions, so report the
1720 warning, too. After that, update the output priv spec version to the
1721 newest one so far.
1722
cbd7581f
NC
17232020-06-22 Nelson Chu <nelson.chu@sifive.com>
1724
1725 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
1726 priv attributes, we will check the conflicts for all of them (major,
1727 minor and revision), and then set the priv_attrs_merged to TRUE to
1728 indicate that we have handled all of the priv attributes. Remove
1729 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
1730
1e927850
AM
17312020-06-21 Alan Modra <amodra@gmail.com>
1732
1733 PR 26132
1734 * configure.ac: Disable plugins by default for some targets.
1735 * plugin.c: Comment typo fix.
1736 * configure: Regenerate.
1737
13aa5ceb
NC
17382020-06-19 Nick Clifton <nickc@redhat.com>
1739
1740 * plugin.c (try_load_plugin): Suppress the error message about
1741 being unable to open a plugin if creating a list of viable
1742 plugins.
1743
a435742a
AM
17442020-06-16 Alan Modra <amodra@gmail.com>
1745
1746 * aout-tic30.c: Delete file.
1747 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
1748 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
1749 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
1750 (xc16x-*-elf): Sort properly.
1751 * configure.ac: Remove tic30_aout_vec.
1752 * targets.c: Likewise.
1753 * Makefile.in: Regenerate.
1754 * configure: Regenerate.
1755 * po/SRC-POTFILES.in: Regenerate.
1756
7a77f1ac
MF
17572020-06-15 Max Filippov <jcmvbkbc@gmail.com>
1758
1759 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
1760 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
1761 (elf32xtensa_abi): New global variable.
1762 (xtensa_abi_choice): New function.
1763 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
1764 XSHAL_ABI to select PLT code.
1765
cae64165
RM
17662020-06-15 Roland McGrath <mcgrathr@google.com>
1767
1768 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
1769 field of bfd_link_info.
1770
40be168c
AM
17712020-06-15 Alan Modra <amodra@gmail.com>
1772
1773 * config.bfd: Obsolete powerpcle-*-pe targets.
1774
75cfe082
AM
17752020-06-15 Alan Modra <amodra@gmail.com>
1776
1777 PR 26103
1778 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
1779 symbols that were defined in discarded sections.
1780 * cofflink.c (coff_link_check_archive_element): Likewise.
1781 (coff_link_add_symbols): Set indx to -3 for symbols defined in
1782 discarded sections.
1783 (_bfd_coff_write_global_sym): Don't emit such symbols.
1784 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
1785 libcoff.h: Regenerate.
1786
f0aa3025
AM
17872020-06-11 Alan Modra <amodra@gmail.com>
1788
1789 PR 26107
1790 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
1791
447f6d86
L
17922020-06-10 H.J. Lu <hongjiu.lu@intel.com>
1793
1794 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
1795 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
1796 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
1797 of reltext.
1798
e1b5d517
L
17992020-06-10 H.J. Lu <hongjiu.lu@intel.com>
1800
1801 PR ld/26094
1802 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
1803 Clear verinfo.verdef.
1804
cebd6b8a
L
18052020-06-09 H.J. Lu <hongjiu.lu@intel.com>
1806
1807 PR ld/18801
1808 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
1809 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
1810 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
1811 resolvers.
1812 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
1813 Set ifunc_resolvers if there are FUNC resolvers.
1814 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
1815 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
1816 with elf.ifunc_resolvers.
1817 (write_plt_relocs_for_local_syms): Likewise.
1818 (ppc64_elf_relocate_section): Likewise.
1819 (ppc64_elf_finish_dynamic_sections): Likewise.
1820 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
1821 Updated.
1822 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1823 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
1824 instead of readonly_dynrelocs_against_ifunc.
1825 * elfxx-x86.h (elf_x86_link_hash_table): Remove
1826 readonly_dynrelocs_against_ifunc.
1827
efb2a7b4
AM
18282020-06-09 Alan Modra <amodra@gmail.com>
1829
1830 * elf64-ppc.c (struct ppc_link_hash_table): Delete
1831 maybe_local_ifunc_resolver field.
1832 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
1833 cases where maybe_local_ifunc_resolver was set.
1834 (ppc64_elf_relocate_section): Likewise.
1835 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
1836 error to a warning.
1837
9bcc30e4
L
18382020-06-08 H.J. Lu <hongjiu.lu@intel.com>
1839
1840 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
1841 tlsdesc_got.
1842 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
1843 and dt_tlsdesc_got.
1844 (elf32_arm_size_dynamic_sections): Updated. Clear
1845 root.tlsdesc_plt for DF_BIND_NOW.
1846 (elf32_arm_finish_dynamic_sections): Updated.
1847 (elf32_arm_output_arch_local_syms): Likewise.
1848 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
1849 Clear root.tlsdesc_plt for DF_BIND_NOW.
1850 (nds32_elf_finish_dynamic_sections): Updated.
1851 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
1852 dt_tlsdesc_plt and dt_tlsdesc_got.
1853 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
1854 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
1855 tlsdesc_plt and dt_tlsdesc_got.
1856 (elfNN_aarch64_allocate_dynrelocs): Updated.
1857 (elfNN_aarch64_finish_dynamic_sections): Likewise.
1858 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
1859 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
1860 twice.
1861 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1862 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1863 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1864 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
1865 tlsdesc_got.
1866
845b83d7
L
18672020-06-07 H.J. Lu <hongjiu.lu@intel.com>
1868
1869 * elf32-tic6x.c (elf32_bed): Defined the default to
1870 elf32_tic6x_bed.
1871
9b8a8575
L
18722020-06-07 H.J. Lu <hongjiu.lu@intel.com>
1873
1874 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
1875 plt_rel_sec.
1876 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
1877 root.splt/root.srelplt.
1878 (elf64_hppa_create_dynamic_sections): Likewise.
1879 (elf64_hppa_size_dynamic_sections): Likewise.
1880 (elf64_hppa_finish_dynamic_symbol): Likewise.
1881 (elf_hppa_final_link): Likewise.
1882 (elf_hppa_final_link_relocate): Likewise.
1883
bcab203d
L
18842020-06-06 H.J. Lu <hongjiu.lu@intel.com>
1885
1886 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
1887 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
1888 is_vxworks.
1889
90c14f0c
L
18902020-06-06 H.J. Lu <hongjiu.lu@intel.com>
1891
1892 * elf-bfd.h (elf_target_os): New.
1893 (elf_link_hash_table): Add target_os.
1894 (elf_backend_data): Add target_os.
1895 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
1896 symbian_p and nacl_p.
1897 (create_got_section): Updated.
1898 (elf32_arm_create_dynamic_sections): Likewise.
1899 (arm_type_of_stub): Likewise.
1900 (elf32_arm_create_or_find_stub_sec): Likewise.
1901 (elf32_arm_allocate_plt_entry): Likewise.
1902 (elf32_arm_populate_plt_entry): Likewise.
1903 (elf32_arm_final_link_relocate): Likewise.
1904 (elf32_arm_check_relocs): Likewise.
1905 (allocate_dynrelocs_for_symbol): Likewise.
1906 (elf32_arm_finish_dynamic_symbol): Likewise.
1907 (elf32_arm_finish_dynamic_sections): Likewise.
1908 (elf32_arm_output_plt_map_1): Likewise.
1909 (elf32_arm_output_arch_local_syms): Likewise.
1910 (elf32_arm_add_symbol_hook): Likewise.
1911 (elf32_arm_nacl_link_hash_table_create): Likewise.
1912 (elf32_arm_vxworks_link_hash_table_create): Likewise.
1913 (elf32_arm_symbian_link_hash_table_create): Likewise.
1914 (ELF_TARGET_OS): New.
1915 * elf32-i386.c (elf_i386_arch_bed): Removed.
1916 (elf_backend_arch_data): Likewise.
1917 (elf_i386_solaris_arch_bed): Likewise.
1918 (elf_i386_nacl_arch_bed): Likewise.
1919 (elf_i386_vxworks_arch_bed): Likewise.
1920 (elf_i386_relocate_section): Updated.
1921 (elf_i386_finish_dynamic_sections): Likewise.
1922 (elf_i386_get_synthetic_symtab): Likewise.
1923 (elf_i386_link_setup_gnu_properties): Likewise.
1924 (ELF_TARGET_OS): New.
1925 * elf32-mips.c (ELF_TARGET_OS): New.
1926 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
1927 (ppc_elf_create_got): Updated.
1928 (ppc_elf_create_dynamic_sections): Likewise.
1929 (ppc_elf_check_relocs): Likewise.
1930 (ppc_elf_adjust_dynamic_symbol): Likewise.
1931 (ppc_elf_size_dynamic_sections): Likewise.
1932 (ppc_elf_relocate_section): Likewise.
1933 (ppc_elf_finish_dynamic_sections): Likewise.
1934 (ppc_elf_vxworks_link_hash_table_create): Likewise.
1935 (ELF_TARGET_OS): New.
1936 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
1937 (sh_elf_link_hash_table_create): Updated.
1938 (sh_elf_create_dynamic_sections): Likewise.
1939 (allocate_dynrelocs): Likewise.
1940 (sh_elf_size_dynamic_sections): Likewise.
1941 (sh_elf_relocate_section): Likewise.
1942 (sh_elf_finish_dynamic_symbol): Likewise.
1943 (sh_elf_finish_dynamic_sections): Likewise.
1944 (ELF_TARGET_OS): New.
1945 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
1946 Removed.
1947 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1948 (ELF_TARGET_OS): New.
1949 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
1950 (elf_x86_64_solaris_arch_bed): Likewise.
1951 (elf_x86_64_nacl_arch_bed): Likewise.
1952 (elf_x86_64_finish_dynamic_sections): Updated.
1953 (elf_x86_64_get_synthetic_symtab): Likewise.
1954 (elf_x86_64_link_setup_gnu_properties): Likewise.
1955 (ELF_TARGET_OS): New.
1956 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
1957 target_o.
1958 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
1959 (MIPS_ELF_REL_DYN_NAME): Updated.
1960 (ELF_MIPS_GP_OFFSET): Likewise.
1961 (mips_elf_create_local_got_entry): Likewise.
1962 (mips_elf_allocate_dynamic_relocations): Likewise.
1963 (mips_elf_count_got_symbols): Likewise.
1964 (is_gott_symbol): Likewise.
1965 (mips_elf_calculate_relocation): Likewise.
1966 (mips_elf_create_dynamic_relocation): Likewise.
1967 (_bfd_mips_elf_check_relocs): Likewise.
1968 (allocate_dynrelocs): Likewise.
1969 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
1970 (mips_elf_lay_out_got): Likewise.
1971 (mips_elf_set_plt_sym_value): Likewise.
1972 (_bfd_mips_elf_size_dynamic_sections): Likewise.
1973 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1974 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1975 (_bfd_mips_elf_final_link): Likewise.
1976 (_bfd_mips_init_file_header): Likewise.
1977 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
1978 Likewise.
1979 (allocate_dynrelocs): Likewise.
1980 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1981 (_bfd_sparc_elf_relocate_section): Likewise.
1982 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1983 (sparc_finish_dyn): Likewise.
1984 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
1985 * elfxx-target.h (ELF_TARGET_OS): New.
1986 (elfNN_bed): Add ELF_TARGET_OS.
1987 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1988 (_bfd_x86_elf_link_hash_table_create): Likewise.
1989 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1990 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1991 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1992 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1993 * elfxx-x86.h (elf_x86_target_os): Removed.
1994 (elf_x86_backend_data): Likewise.
1995 (get_elf_x86_backend_data): Likewise.
1996 (elf_x86_link_hash_table): Remove target_os.
1997
87c69f97
AM
19982020-06-06 Alan Modra <amodra@gmail.com>
1999
2000 * reloc.c: Rename
2001 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
2002 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
2003 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
2004 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
2005 * elf64-ppc.c: Update throughout for reloc renaming.
2006 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
2007 * libbfd.h: Regenerate.
2008 * bfd-in2.h: Regenerate.
2009
981f1518
L
20102020-06-05 H.J. Lu <hongjiu.lu@intel.com>
2011
8a4ba3a1 2012 PR ld/26080
981f1518
L
2013 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
2014 section.
2015
9c65eeac
NC
20162020-06-05 Nick Clifton <nickc@redhat.com>
2017
2018 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
2019 bug.
2020
41285764
NC
20212020-06-05 Nelson Chu <nelson.chu@sifive.com>
2022
2023 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
2024 priv_may_conflict, in_priv_zero and out_priv_zero to decide
2025 whether the object can be linked according to it's priv
2026 attributes. The object without any priv spec attributes can
2027 be linked with others. If the first input object doesn't contain
2028 any priv attributes, then we need to copy the setting from the
2029 next input one. Also report more detailed error messages to user.
2030
a975c88e
SC
20312020-06-04 Stephen Casner <casner@acm.org>
2032
2033 Extend pdp11-aout symbol table format to accommodate .stab
2034 symbols and implement correct handling of them.
2035
2036 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
2037 (N_STAB, is_stab): Needed new function is_stab to disambiguate
2038 normal vs. .stab symbol table type values, replacing N_STAB mask.
2039 (translate_from_native_sym_flags): Determine correct section for
2040 different .stab types.
2041 (translate_to_native_sym_flags): Leave .stab types intact.
2042 (translate_symbol_table): Error if symbol indicates overlay;
2043 store desc field from .stab symbols.
2044 (write_syms): Output desc field with symbol.
2045 (aout_link_check_ar_symbols): Skip .stab symbols.
2046 (aout_link_add_symbols): Correctly distinguish .stab symbols.
2047 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
2048 (aout_link_write_symbols): Write 0 for desk and ovly fields;
2049 correctly distinguish .stab symbols and select calculate their
2050 section and value; and copy desc and ovly fields from input symbol
2051 to output symbol.
2052
3b9313c4
SC
20532020-06-04 Stephen Casner <casner@acm.org>
2054
2055 * aoutx.h (translate_symbol_table): Comment had external and
2056 internal swapped.
2057 * pdp11.c (translate_symbol_table): Likewise.
2058
add5f777
L
20592020-06-04 H.J. Lu <hongjiu.lu@intel.com>
2060
2061 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
2062 (is_x86_elf): Check elf.hash_table_id instead of target_id.
2063 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
2064
c4b126b8
L
20652020-06-04 H.J. Lu <hongjiu.lu@intel.com>
2066
2067 PR ld/26080
2068 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
2069 in debug section against symbol defined in shared library to 0.
2070 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
2071 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
2072 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
2073 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
2074 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
2075 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
2076 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
2077 * elf32-sh.c (sh_elf_check_relocs): Likewise.
2078 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2079 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
2080 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
2081 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2082 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2083 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
2084 reference.
2085 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
2086 there is non-GOT reference.
2087 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
2088 non-alloced sections.
2089
31af1e68
SC
20902020-06-03 Stephen Casner <casner@acm.org>
2091
2092 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
2093
2094 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
2095 files with relocs.
2096 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
2097 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
2098 other size that doesn't qcover the header word.
2099 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
2100 string table, and zero it.
2101 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
2102 message and set bfd_error on finding an invalid name string offset.
2103 (add_to_stringtab): INLINE -> inline
2104 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
2105 bound check.
2106 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
2107 any relocs that could not be recognised.
2108 92744f05809 PR 20929 - Check for relocs without an associated symbol.
2109 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
2110 name exists and is long enough, before attempting to see if it is
2111 for a .o file.
2112 c3864421222 - Correct case for N_SO being the last symbol.
2113 50455f1ab29 PR 20891 - Handle the case where the main file name
2114 and the directory name are both empty.
2115 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
2116 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
2117 range string table offsets.
2118 531336e3a0b PR 20909 - Fix off-by-one error in check for an
cae64165 2119 illegal string offset.
31af1e68
SC
2120 (aout_link_includes_newfunc): Add comment.
2121 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
2122 on unexpected relocation type rather than ASSERT.
2123
d4d8aee3
L
21242020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2125
2126 PR ld/26066
2127 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
2128 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
2129
58ee44ef
L
21302020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2131
2132 PR ld/26066
2133 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
2134 non-alloced sections.
2135
9a689602
L
21362020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2137
2138 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
2139 dynamic relocations for non SEC_ALLOC sections.
2140
0bff7528
GN
21412020-06-03 Gunther Nikl <gnikl@justmail.de>
2142
2143 * aout64.c (BMAGIC, QMAGIC): Do not define.
2144 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
2145 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
2146 to check the file format.
2147 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
2148 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
2149 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
2150
50d03636
L
21512020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2152
2153 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
2154 relocations for non SEC_ALLOC sections.
2155
d49e5065
L
21562020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2157
2158 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
2159 * elf32-arm.c (maybe_set_textrel): Removed.
2160 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
2161 with _bfd_elf_maybe_set_textrel.
2162 * elf32-csky.c (maybe_set_textrel): Removed.
2163 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
2164 with _bfd_elf_maybe_set_textrel.
2165 * elf32-hppa.c (maybe_set_textrel): Removed.
2166 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
2167 with _bfd_elf_maybe_set_textrel.
2168 * elf32-lm32.c (maybe_set_textrel): Removed.
2169 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
2170 with _bfd_elf_maybe_set_textrel.
2171 * elf32-m32r.c (maybe_set_textrel): Removed.
2172 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
2173 with _bfd_elf_maybe_set_textrel.
2174 * elf32-metag.c (maybe_set_textrel): Removed.
2175 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
2176 with _bfd_elf_maybe_set_textrel.
2177 * elf32-nds32.c (maybe_set_textrel): Removed.
2178 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
2179 with _bfd_elf_maybe_set_textrel.
2180 * elf32-or1k.c (maybe_set_textrel): Removed.
2181 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
2182 with _bfd_elf_maybe_set_textrel.
2183 * elf32-ppc.c (maybe_set_textrel): Removed.
2184 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
2185 with _bfd_elf_maybe_set_textrel.
2186 * elf32-s390.c (maybe_set_textrel): Removed.
2187 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
2188 with _bfd_elf_maybe_set_textrel.
2189 * elf32-sh.c (maybe_set_textrel): Removed.
2190 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
2191 with _bfd_elf_maybe_set_textrel.
2192 * elf32-tic6x.c (maybe_set_textrel): Removed.
2193 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
2194 with _bfd_elf_maybe_set_textrel.
2195 * elf32-tilepro.c (maybe_set_textrel): Removed.
2196 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
2197 with _bfd_elf_maybe_set_textrel.
2198 * elf64-ppc.c (maybe_set_textrel): Removed.
2199 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
2200 with _bfd_elf_maybe_set_textrel.
2201 * elf64-s390.c (maybe_set_textrel): Removed.
2202 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
2203 with _bfd_elf_maybe_set_textrel.
2204 * elfnn-aarch64.c (maybe_set_textrel): Removed.
2205 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
2206 with _bfd_elf_maybe_set_textrel.
2207 * elfnn-riscv.c (maybe_set_textrel): Removed.
2208 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
2209 with _bfd_elf_maybe_set_textrel.
2210 * elfxx-sparc.c (maybe_set_textrel): Removed.
2211 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
2212 with _bfd_elf_maybe_set_textrel.
2213 * elfxx-tilegx.c (maybe_set_textrel): Removed.
2214 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
2215 with _bfd_elf_maybe_set_textrel.
2216 * elfxx-x86.c (maybe_set_textrel): Removed.
2217 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
2218 with _bfd_elf_maybe_set_textrel.
2219 * elflink.c (_bfd_elf_maybe_set_textrel): New.
2220
ad172eaa
L
22212020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2222
2223 PR ld/26067
2224 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
2225 dyn_relocs.
2226 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
2227 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
2228 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
2229 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
2230 Likewise.
2231 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
2232 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
2233 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
2234 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
2235 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
2236 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
2237 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
2238 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
2239 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
2240 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
2241 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
2242 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
2243 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
2244 (elf_backend_copy_indirect_symbol): Likewise.
2245 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
2246 (elf_backend_copy_indirect_symbol): Likewise.
2247 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
2248
5dbc8b37
L
22492020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2250
2251 PR ld/26067
2252 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
2253 * elf32-arm.c (readonly_dynrelocs): Removed.
2254 (maybe_set_textrel): Replace readonly_dynrelocs with
2255 _bfd_elf_readonly_dynrelocs.
2256 * elf32-csky.c (readonly_dynrelocs): Removed.
2257 (maybe_set_textrel): Replace readonly_dynrelocs with
2258 _bfd_elf_readonly_dynrelocs.
2259 * elf32-hppa.c(readonly_dynrelocs): Removed.
2260 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
2261 _bfd_elf_readonly_dynrelocs.
2262 (maybe_set_textrel): Likewise.
2263 * elf32-lm32.c (readonly_dynrelocs): Removed.
2264 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2265 with _bfd_elf_readonly_dynrelocs.
2266 (maybe_set_textrel): Likewise.
2267 * elf32-m32r.c (readonly_dynrelocs): Removed.
2268 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2269 with _bfd_elf_readonly_dynrelocs.
2270 (maybe_set_textrel): Likewise.
2271 * elf32-metag.c (readonly_dynrelocs): Removed.
2272 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
2273 with _bfd_elf_readonly_dynrelocs.
2274 (maybe_set_textrel): Likewise.
2275 * elf32-microblaze.c (readonly_dynrelocs): Removed.
2276 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2277 with _bfd_elf_readonly_dynrelocs.
2278 * elf32-nds32.c (readonly_dynrelocs): Removed.
2279 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2280 with _bfd_elf_readonly_dynrelocs.
2281 (maybe_set_textrel): Likewise.
2282 * elf32-or1k.c (readonly_dynrelocs): Removed.
2283 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2284 with _bfd_elf_readonly_dynrelocs.
2285 * elf32-ppc.c (readonly_dynrelocs): Removed.
2286 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
2287 _bfd_elf_readonly_dynrelocs.
2288 (ppc_elf_adjust_dynamic_symbol): Likewise.
2289 (maybe_set_textrel): Likewise.
2290 * elf32-s390.c (readonly_dynrelocs): Removed.
2291 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
2292 with _bfd_elf_readonly_dynrelocs.
2293 (maybe_set_textrel): Likewise.
2294 * elf32-sh.c (readonly_dynrelocs): Removed.
2295 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
2296 _bfd_elf_readonly_dynrelocs.
2297 (maybe_set_textrel): Likewise.
2298 * elf32-tic6x.c (readonly_dynrelocs): Removed.
2299 (maybe_set_textrel): Replace readonly_dynrelocs with
2300 _bfd_elf_readonly_dynrelocs.
2301 * elf32-tilepro.c (readonly_dynrelocs): Removed.
2302 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2303 with _bfd_elf_readonly_dynrelocs.
2304 (maybe_set_textrel): Likewise.
2305 * elf64-ppc.c (readonly_dynrelocs): Removed.
2306 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
2307 _bfd_elf_readonly_dynrelocs.
2308 (ppc64_elf_adjust_dynamic_symbol): Likewise.
2309 (maybe_set_textrel): Likewise.
2310 * elf64-s390.c (readonly_dynrelocs): Removed.
2311 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
2312 with _bfd_elf_readonly_dynrelocs.
2313 (maybe_set_textrel): Likewise.
2314 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
2315 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
2316 (maybe_set_textrel): Replace readonly_dynrelocs with
2317 _bfd_elf_readonly_dynrelocs.
2318 * elfnn-riscv.c (readonly_dynrelocs): Removed.
2319 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2320 with _bfd_elf_readonly_dynrelocs.
2321 (maybe_set_textrel): Likewise.
2322 * elfxx-sparc.c (readonly_dynrelocs): Removed.
2323 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
2324 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
2325 (maybe_set_textrel): Likewise.
2326 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
2327 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2328 with _bfd_elf_readonly_dynrelocs.
2329 (maybe_set_textrel): Likewise.
2330 * elfxx-x86.c (readonly_dynrelocs): Removed.
2331 (maybe_set_textrel): Replace readonly_dynrelocs with
2332 _bfd_elf_readonly_dynrelocs.
2333 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
2334
433953ff
L
23352020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2336
2337 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
2338 -fsanitize=undefined.
2339
67580036
AM
23402020-06-03 Alan Modra <amodra@gmail.com>
2341
2342 PR 26069
2343 PR 18758
2344 * peicode.h (pe_ILF_make_a_section): Align data for compilers
2345 other than gcc.
2346 (pe_ILF_build_a_bfd): Likewise.
2347
0ed18fa1
AM
23482020-06-03 Alan Modra <amodra@gmail.com>
2349
7eea15c5 2350 PR 26069
0ed18fa1
AM
2351 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
2352 core files as well as objects.
2353
190eb1dd
L
23542020-06-01 H.J. Lu <hongjiu.lu@intel.com>
2355
2356 PR ld/26067
2357 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
2358 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
2359 Updated.
2360 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
2361 (elf_arc_link_hash_newfunc): Updated.
2362 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
2363 (elf32_arm_link_hash_newfunc): Updated.
2364 (elf32_arm_copy_indirect_symbol): Likewise.
2365 (elf32_arm_check_relocs): Likewise.
2366 (readonly_dynrelocs): Likewise.
2367 (allocate_dynrelocs_for_symbol): Likewise.
2368 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
2369 (csky_elf_link_hash_newfunc): Updated.
2370 (csky_allocate_dynrelocs): Likewise.
2371 (readonly_dynrelocs): Likewise.
2372 (csky_elf_copy_indirect_symbol): Likewise.
2373 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
2374 (hppa_link_hash_newfunc): Updated.
2375 (elf32_hppa_copy_indirect_symbol): Likewise.
2376 (elf32_hppa_hide_symbol): Likewise.
2377 (elf32_hppa_adjust_dynamic_symbol): Likewise.
2378 (allocate_dynrelocs): Likewise.
2379 (elf32_hppa_relocate_section): Likewise.
2380 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2381 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
2382 (lm32_elf_link_hash_newfunc): Likewise.
2383 (lm32_elf_link_hash_table_create): Updated.
2384 (readonly_dynrelocs): Likewise.
2385 (allocate_dynrelocs): Likewise.
2386 (lm32_elf_copy_indirect_symbol): Likewise.
2387 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
2388 (m32r_elf_link_hash_newfunc): Likewise.
2389 (m32r_elf_link_hash_table_create): Updated.
2390 (m32r_elf_copy_indirect_symbol): Likewise.
2391 (allocate_dynrelocs): Likewise.
2392 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
2393 (metag_link_hash_newfunc): Updated.
2394 (elf_metag_copy_indirect_symbol): Likewise.
2395 (readonly_dynrelocs): Likewise.
2396 (allocate_dynrelocs): Likewise.
2397 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
2398 dyn_relocs.
2399 (link_hash_newfunc): Updated.
2400 (microblaze_elf_check_relocs): Likewise.
2401 (microblaze_elf_copy_indirect_symbol): Likewise.
2402 (readonly_dynrelocs): Likewise.
2403 (allocate_dynrelocs): Likewise.
2404 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
2405 (nds32_elf_link_hash_newfunc): Updated.
2406 (nds32_elf_copy_indirect_symbol): Likewise.
2407 (readonly_dynrelocs): Likewise.
2408 (allocate_dynrelocs): Likewise.
2409 (nds32_elf_check_relocs): Likewise.
2410 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
2411 (link_hash_newfunc): Updated.
2412 (nios2_elf32_copy_indirect_symbol): Likewise.
2413 (nios2_elf32_check_relocs): Likewise.
2414 (allocate_dynrelocs): Likewise.
2415 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
2416 (or1k_elf_link_hash_newfunc): Updated.
2417 (readonly_dynrelocs): Likewise.
2418 (allocate_dynrelocs): Likewise.
2419 (or1k_elf_copy_indirect_symbol): Likewise.
2420 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
2421 (ppc_elf_link_hash_newfunc): Updated.
2422 (ppc_elf_copy_indirect_symbol): Likewise.
2423 (ppc_elf_check_relocs): Likewise.
2424 (readonly_dynrelocs): Likewise.
2425 (ppc_elf_adjust_dynamic_symbol): Likewise.
2426 (allocate_dynrelocs): Likewise.
2427 (ppc_elf_relocate_section): Likewise.
2428 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
2429 (link_hash_newfunc): Updated.
2430 (elf_s390_copy_indirect_symbol): Likewise.
2431 (readonly_dynrelocs): Likewise.
2432 (elf_s390_adjust_dynamic_symbol): Likewise.
2433 (allocate_dynrelocs): Likewise.
2434 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
2435 (sh_elf_link_hash_newfunc): Updated.
2436 (readonly_dynrelocs): Likewise.
2437 (allocate_dynrelocs): Likewise.
2438 (sh_elf_copy_indirect_symbol): Likewise.
2439 (sh_elf_check_relocs): Likewise.
2440 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
2441 (elf32_tic6x_link_hash_newfunc): Likewise.
2442 (elf32_tic6x_link_hash_table_create): Updated.
2443 (readonly_dynrelocs): Likewise.
2444 (elf32_tic6x_check_relocs): Likewise.
2445 (elf32_tic6x_allocate_dynrelocs): Likewise.
2446 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
2447 dyn_relocs.
2448 (link_hash_newfunc): Updated.
2449 (tilepro_elf_copy_indirect_symbol): Likewise.
2450 (tilepro_elf_check_relocs): Likewise.
2451 (allocate_dynrelocs): Likewise.
2452 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
2453 (ppc64_elf_copy_indirect_symbol): Updated.
2454 (ppc64_elf_check_relocs): Likewise.
2455 (readonly_dynrelocs): Likewise.
2456 (ppc64_elf_adjust_dynamic_symbol): Likewise.
2457 (dec_dynrel_count): Likewise.
2458 (allocate_dynrelocs): Likewise.
2459 (ppc64_elf_relocate_section): Likewise.
2460 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
2461 (link_hash_newfunc): Updated.
2462 (elf_s390_copy_indirect_symbol): Likewise.
2463 (readonly_dynrelocs): Likewise.
2464 (allocate_dynrelocs): Likewise.
2465 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2466 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
2467 dyn_relocs.
2468 (elfNN_aarch64_link_hash_newfunc): Updated.
2469 (elfNN_aarch64_copy_indirect_symbol): Likewise.
2470 (readonly_dynrelocs): Likewise.
2471 (need_copy_relocation_p): Likewise.
2472 (elfNN_aarch64_allocate_dynrelocs): Likewise.
2473 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
2474 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
2475 (link_hash_newfunc): Updated.
2476 (riscv_elf_copy_indirect_symbol): Likewise.
2477 (riscv_elf_check_relocs): Likewise.
2478 (readonly_dynrelocs): Likewise.
2479 (allocate_dynrelocs): Likewise.
2480 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
2481 dyn_relocs.
2482 (link_hash_newfunc): Updated.
2483 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
2484 (_bfd_sparc_elf_check_relocs): Likewise.
2485 (readonly_dynrelocs): Likewise.
2486 (allocate_dynrelocs): Likewise.
2487 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
2488 (link_hash_newfunc): Updated.
2489 (tilegx_elf_copy_indirect_symbol): Likewise.
2490 (tilegx_elf_check_relocs): Likewise.
2491 (readonly_dynrelocs): Likewise.
2492 (allocate_dynrelocs): Likewise.
2493 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
2494 (readonly_dynrelocs): Likewise.
2495 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
2496 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
2497
2fdb65f2
AM
24982020-06-01 Alan Modra <amodra@gmail.com>
2499
2500 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
2501 command against cmd_length, not the end of record. For
2502 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
2503 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
2504 cmd_length test.
2505
12adf805
DF
25062020-05-28 David Faust <david.faust@oracle.com>
2507
2508 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
2509 R_BPF_INSN_{32,64} relocations.
2510
66e3eb08
SC
25112020-05-28 Stephen Casner <casner@acm.org>
2512
2513 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
2514 addreses in .long (used in testsuites) and .stab values.
2515
a6dbf402
L
25162020-05-27 H.J. Lu <hongjiu.lu@intel.com>
2517
2518 PR ld/22909
2519 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
2520 Check bfd_link_dll when issue a DT_TEXTREL warning.
2521 * elfxx-x86.c (maybe_set_textrel): Likewise.
2522 (_bfd_x86_elf_size_dynamic_sections): Likewise.
2523
9e7cb4c3
NC
25242020-05-26 Nick Clifton <nickc@redhat.com>
2525
2526 * plugin.c (try_load_plugin): Extend error message when a plugin
2527 fails to open.
2528
c892b447
AM
25292020-05-23 Alan Modra <amodra@gmail.com>
2530
2531 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
2532
6f3fe02b
AM
25332020-05-22 Alan Modra <amodra@gmail.com>
2534
2535 PR 25882
2536 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
2537 attributes from shared libraries, and do not return an error if
2538 they don't match.
2539
0490dd41
AM
25402020-05-21 Alan Modra <amodra@gmail.com>
2541
2542 PR 25993
2543 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
2544 filename.
2545 (_bfd_delete_bfd): Free the copy.
2546 (_bfd_new_bfd): Free nbfd->memory on error.
2547
c9594989
AM
25482020-05-21 Alan Modra <amodra@gmail.com>
2549
2550 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
2551 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
2552 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
2553 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
2554 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
2555 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
2556 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
2557 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
2558 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
2559 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
2560 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
2561 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
2562 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
2563 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
2564 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
2565 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
2566 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
2567 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
2568 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
2569 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
2570
8f595e9b
NC
25712020-05-20 Nelson Chu <nelson.chu@sifive.com>
2572
2573 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
2574 get_default_version. It is used to find the default version for
2575 the specific extension.
2576 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
2577 default_major_version and default_minor_version. Add new bfd_boolean
2578 parameter *use_default_version. Set it to TRUE if we need to call
2579 the callback rps->get_default_version to find the default version.
2580 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
2581 the default version in riscv_parsing_subset_version, and then call
2582 riscv_add_subset to add the subset into subset list.
2583 (riscv_parse_prefixed_ext): Likewise.
2584 (riscv_std_z_ext_strtab): Support Zicsr extensions.
2585 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
2586 strings rather than characters.
2587 riscv_merge_arch_attr_info): The callback function get_default_version
2588 is only needed for assembler, so set it to NULL int the linker.
2589 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
2590 * elfxx-riscv.h: Updated.
2591
7b958a48
AM
25922020-05-20 Alan Modra <amodra@gmail.com>
2593
2594 PR 25993
2595 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
2596 use bfd_set_filename.
2597 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
2598 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
2599 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
2600 (bfd_create): Likewise.
2601 (_bfd_delete_bfd): Don't free filename.
2602 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
2603 return pointer to the copy or NULL on alloc fail.
2604 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
2605 result of bfd_set_filename.
2606 * bfd-in2.h: Regenerate.
2607
3c568b8a
AM
26082020-05-20 Alan Modra <amodra@gmail.com>
2609
2610 PR 26011
2611 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
2612 section size against file size.
2613 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
2614
6fd1d259
GN
26152020-05-19 Gunther Nikl <gnikl@justmail.de>
2616
2617 PR 26005
11c0dd51
NC
2618 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
2619 and memset when allocating memory for the sections_being_created
2620 array.
6fd1d259 2621
7e94cf6c
SH
26222020-05-19 Stafford Horne <shorne@gmail.com>
2623
2624 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
2625 to relgot.
2626 (or1k_elf_relocate_section): Access srelgot via
2627 htab->root.srelgot. Add assertions for srelgot->contents.
2628 Introduce local variable for srelgot to not reuse global
2629 sreloc.
2630 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
2631 (or1k_set_got_and_rela_sizes): New function.
2632 (or1k_initial_exec_offset): New function.
2633 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
2634 (or1k_elf_relocate_section): Allow for TLS to handle multiple
2635 model access.
2636 (or1k_elf_check_relocs): Use OR to set TLS access.
2637 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
2638 sizes.
2639 (or1k_elf_size_dynamic_sections): Use
2640 or1k_set_got_and_rela_sizes to set sizes.
2641 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
2642 (TCB_SIZE): New macro.
2643 (tpoff): Use TCB_SIZE and alignment to calculate offset.
2644 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
2645 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
2646 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
2647 (tpoff): Add dynamic boolean argument.
2648 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
2649
7e057737
SP
26502020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
2651
2652 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
2653 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
2654 cases with BFD_RELOC_AARCH64_JUMP26.
2655 (elfNN_aarch64_check_relocs): Likewise.
2656
765cf5f6
AM
26572020-05-19 Alan Modra <amodra@gmail.com>
2658
2659 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
2660 bfd_get_filename rather than accessing bfd->filename directly.
2661 * aout-target.h (MY (object_p)): Likewise.
2662 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
2663 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
2664 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
2665 (_bfd_archive_bsd44_construct_extended_name_table),
2666 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
2667 (_bfd_bsd_write_armap): Likewise.
2668 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
2669 * cache.c (bfd_open_file): Likewise.
2670 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
2671 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
2672 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
2673 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
2674 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
2675 * elf32-nds32.c (nds32_elf_output_symbol_hook),
2676 (patch_tls_desc_to_ie): Likewise.
2677 * elf32-spu.c (sort_bfds, print_one_overlay_section),
2678 (spu_elf_auto_overlay): Likewise.
2679 * elf64-hppa.c (elf_hppa_final_link): Likewise.
2680 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
2681 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
2682 * elflink.c (bfd_elf_size_dynamic_sections),
2683 (elf_link_input_bfd): Likewise.
2684 * linker.c (_bfd_generic_link_output_symbols): Likewise.
2685 * mach-o.c (bfd_mach_o_follow_dsym),
2686 (bfd_mach_o_close_and_cleanup): Likewise.
2687 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
2688 (find_separate_debug_file, get_build_id_name): Likewise.
2689 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
2690 * plugin.c (bfd_plugin_open_input): Likewise.
2691 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
2692 * som.c (som_write_armap): Likewise.
2693 * srec.c (srec_write_record, srec_write_symbols): Likewise.
2694 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
2695 (_bfd_vms_lib_write_archive_contents): Likewise.
2696 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
2697
39a1432c
AM
26982020-05-19 Alan Modra <amodra@gmail.com>
2699
2700 PR 25713
2701 * bfdio.c (_bfd_real_fopen): Typo fix.
2702
ed02cdb5
NC
27032020-05-18 Nick Clifton <nickc@redhat.com>
2704
2705 PR 26005
2706 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
2707 for the sections_being_created array.
2708
7a87e9c8
AM
27092020-05-18 Alan Modra <amodra@gmail.com>
2710
2711 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
2712 they can be freed without also freeing internal_relocs.
2713
ca859a89
JC
27142020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
2715
2716 PR 25713
2717 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
2718 separators into DOS style when creating a WIN32 fullpath.
2719
fc46e8bd
NC
27202020-05-14 Nelson Chu <nelson.chu@sifive.com>
2721
2722 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
2723 to initialize RISC-V tdata.
2724
533f049e
GN
27252020-05-12 Gunther Nikl <gnikl@justmail.de>
2726
2727 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
2728 relocation size.
2729
94ba9882
AM
27302020-05-11 Alan Modra <amodra@gmail.com>
2731
2732 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
2733
7c1f4227
AM
27342020-05-11 Alan Modra <amodra@gmail.com>
2735
2736 * elf64-ppc.c: Rename powerxx to power10 throughout.
2737
4d5acb1e
AM
27382020-05-11 Alan Modra <amodra@gmail.com>
2739
2740 PR 25961
2741 * coffgen.c (coff_get_normalized_symtab): Check that buffer
2742 contains required number of auxents before processing any auxent.
2743 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
2744 file name from auxents for PE.
2745
7242fa8a
GN
27462020-05-04 Gunther Nikl <gnikl@justmail.de>
2747
2748 * aout-cris.c (DEFAULT_ARCH): Delete define.
2749 (MY_set_arch_mach): Likewise.
2750 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
2751 of bfd_arch_cris.
2752 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
2753 of r_type before the shift.
2754
27552020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
cff69cf4
WD
2756
2757 PR ld/25665
2758 * elfnn-aarch64.c (group_sections): Copy implementation from
2759 elf32-arm.c.
2760
a2714d6c
AM
27612020-05-01 Alan Modra <amodra@gmail.com>
2762
2763 PR 25900
2764 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
2765 accessing root.u.def of symbols. Also check root.u.def.section
2766 is non-NULL. Reverse tests so as to make the logic positive.
2767
a8acd6ee
AM
27682020-05-01 Alan Modra <amodra@gmail.com>
2769
2770 PR 25882
2771 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
2772 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
2773
6b728d32
AM
27742020-05-01 Alan Modra <amodra@gmail.com>
2775
2776 PR 25882
2777 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
2778 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2779 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2780 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
2781 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
2782 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
2783 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
2784 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
2785 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
2786 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
2787
91ed9b71
AM
27882020-05-01 Alan Modra <amodra@gmail.com>
2789
2790 PR 25882
2791 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
2792 from shared libraries.
2793
d548f47d
MF
27942020-04-29 Max Filippov <jcmvbkbc@gmail.com>
2795
2796 * elf32-xtensa.c (relax_section): Don't negate diff_value for
2797 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
2798 equals 0. Report overflow when the result has negative sign but
2799 all significant bits are zero.
2800
dfa85db1
GN
28012020-04-29 Gunther Nikl <gnikl@justmail.de>
2802
2803 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
2804 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
2805
48e5bada
AM
28062020-04-28 Alan Modra <amodra@gmail.com>
2807
2808 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
2809 Emit warning message.
2810
251dae91
TC
28112020-04-27 Tamar Christina <tamar.christina@arm.com>
2812
2813 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
2814 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
2815 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
2816 to x86_64_pe_big_vec as it not a big-endian format.
2817 (vec i386_pe_big_vec): New.
2818 * configure.ac: Likewise.
2819 * targets.c: Likewise.
2820 * configure: Regenerate.
2821 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
2822 COFF_WITH_PE_BIGOBJ): New.
2823 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
2824 New.
2825 (x86_64_pe_be_vec): Moved.
2826
27456742
AK
28272020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
2828
2829 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
2830 * elf.c (elfcore_grok_arc_v2): New function.
2831 (elfcore_grok_note): Call the new function to handle the corresponding
2832 note.
2833 (elfcore_write_arc_v2): New function.
2834 (elfcore_write_register_note): Call the new function to handle the
2835 corresponding pseudo-sections.
2836
30ce8e47
MF
28372020-04-22 Max Filippov <jcmvbkbc@gmail.com>
2838
2839 PR ld/25861
2840 * bfd-in2.h: Regenerated.
2841 * elf32-xtensa.c (elf_howto_table): New entries for
2842 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
2843 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
2844 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
2845 R_XTENSA_NDIFF{8,16,32}.
2846 * libbfd.h (bfd_reloc_code_real_names): Add names for
2847 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
2848 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2849 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
2850 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2851
c36876fe
TC
28522020-04-21 Tamar Christina <tamar.christina@arm.com>
2853
2854 PR binutils/24753
2855 * compress.c (bfd_get_full_section_contents): Exclude sections with no
2856 content.
2857
6f6fd151
L
28582020-04-21 H.J. Lu <hongjiu.lu@intel.com>
2859
2860 PR ld/25849
2861 * elf-bfd.h (elf_backend_data): Add
2862 elf_backend_strip_zero_sized_dynamic_sections.
2863 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
2864 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
2865 New macro.
2866 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
2867 function.
2868 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
2869 New macro.
2870 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
2871
1f7f2abb
L
28722020-04-21 H.J. Lu <hongjiu.lu@intel.com>
2873
2874 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
2875 sec.
2876 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
2877 DT_TEXTREL with -M.
2878 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
2879
e04f33c0
NC
28802020-04-21 Nick Clifton <nickc@redhat.com>
2881
2882 * po/sr.po: Updated Serbian translation.
2883
fad3d2c1
AM
28842020-04-21 Alan Modra <amodra@gmail.com>
2885
2886 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
2887 processing.
2888
23c8270e
SC
28892020-04-20 Stephen Casner <casner@acm.org>
2890
2891 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
2892 causing globals from linker script to be treated as debug symbols.
2893 (translate_symbol_table): Don't sign-extend symbol values from 16
2894 to 64 bits in nm output.
2895
2efec98b
AM
28962020-04-20 Alan Modra <amodra@gmail.com>
2897
2898 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
2899
18f97353
AM
29002020-04-18 Alan Modra <amodra@gmail.com>
2901
2902 * section.c (bfd_is_const_section): Correct test for special
2903 sections.
2904 * bfd-in2.h: Regenerate.
2905
8d55d10a
AM
29062020-04-17 Alan Modra <amodra@gmail.com>
2907
2908 PR 25842
2909 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
2910 NULL nodename.
2911
8e4979ac
NC
29122020-04-16 Nick Clifton <nickc@redhat.com>
2913
2914 PR 25803
2915 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
2916 abort with a more helpful error message.
2917
aec72fda
AM
29182020-04-16 Alan Modra <amodra@gmail.com>
2919
2920 PR 25827
2921 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
2922 strdup(0).
2923
95a51568
FS
29242020-04-15 Fangrui Song <maskray@google.com>
2925
2926 PR binutils/24613
2927 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
2928 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
2929 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
2930 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
2931 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2932 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
2933 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2934 * elf32-sh.c (sh_elf_relocate_section): Likewise.
2935 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2936 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
2937 * elflink.c (elf_link_output_extsym): Likewise.
2938 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
2939
7ecb5154
AM
29402020-04-15 Alan Modra <amodra@gmail.com>
2941
2942 PR 25823
2943 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
2944 pointer into strings that may be freed for section name, always
2945 allocate a new string.
2946
f717994f
JMG
29472020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2948 Jan W. Jagersma <jwjagersma@gmail.com>
2949
2950 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
2951 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2952 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
2953 (_bfd_go32_mkobject): New functions.
2954 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
2955 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2956 (go32exe_mkobject): Call _bfd_go32_mkobject.
2957 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
2958 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
2959 and COFF_GO32.
2960 (coff_write_relocs): Enable extended reloc counter code if
2961 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
2962 (coff_write_object_contents): Likewise. Pad section headers
2963 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
2964 instead of coff_swap_scnhdr_out.
2965 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
2966 enable extended reloc counter.
2967 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
2968 Declare with ATTRIBUTE_UNUSED.
2969 * libcoff-in.h: (struct coff_tdata): New field go32.
2970 (obj_go32): Define.
2971 * libcoff.h: Regenerate.
2972
34ca5531
FS
29732020-04-14 Fangrui Song <maskray@google.com>
2974
2975 PR gas/25768
2976 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
2977 12.
2978
fa1477dc
SC
29792020-04-14 Stephen Casner <casner@acm.org>
2980
2981 PR ld/25677
2982 * pdp11.c: Add implementation of --imagic option.
2983 (adjust_o_magic): Fix objcopy --extract-symbol test.
2984 * libaout.h (enum aout_magic): Add i_magic.
2985
a0543b0b
RO
29862020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2987 Nick Clifton <nickc@redhat.com>
2988
2989 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
2990 <0>: Ignore.
2991 <default>: Error rather than abort.
2992
3349112e
L
29932020-04-03 H.J. Lu <hongjiu.lu@intel.com>
2994
2995 PR ld/25767
2996 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
2997 relocation section from section group.
2998
4d095f5b
JJ
29992020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
3000
3001 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
3002 bfd->origin to file offset.
3003 * bfdwin.c (bfd_get_file_window): Likewise.
3004 * bfd.c: Clarify the use of the bfd->origin field.
3005 * bfd-in2.h: Regenerate.
3006 * coff-i386.c: Don't include go32exe.h. Allow overriding
3007 coff_write_object_contents via COFF_WRITE_CONTENTS.
3008 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
3009 (go32exe_write_object_contents): New functions.
3010 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
3011 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
3012 (create_go32_stub): Remove check for 2k size limit. Read stub
3013 from go32exe_temp_stub if present.
3014 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
3015 copy variable-length stub.
3016 (go32_check_format): Read stub to go32exe_temp_stub, set
3017 origin, return go32exe_cleanup.
3018 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
3019 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
3020 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
3021 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
3022 Remove functions and their associated #defines.
3023 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
3024 * libcoff-in.h: (struct coff_tdata): New field stub_size.
3025 Rename field go32stub to stub.
3026 * libcoff.h: Regenerate.
3027 * coff-stgo32.c (go32_check_format): Rename to...
3028 (go32exe_check_format): ...this.
3029 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
3030 (go32exe_copy_private_bfd_data): ...this.
3031 (stub_bytes): Rename to...
3032 (go32exe_default_stub): ...this.
3033 (create_go32_stub): Rename to...
3034 (go32exe_create_stub): ...this.
3035 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
3036 when possible.
3037
382aae06
L
30382020-04-01 H.J. Lu <hongjiu.lu@intel.com>
3039
3040 PR ld/25749
3041 PR ld/25754
3042 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
3043 relocation to R_386_32 for relocation against non-preemptible
3044 absolute symbol.
3045 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
3046 allocate dynamic relocation for non-preemptible absolute symbol.
3047 (elf_i386_relocate_section): Pass sec to
3048 GENERATE_DYNAMIC_RELOCATION_P.
3049 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
3050 (elf_x86_64_convert_load_reloc): Covert load relocation to
3051 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
3052 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
3053 for non-preemptible absolute symbol if they overflow.
3054 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
3055 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
3056 symbol. Don't allocate dynamic relocation for non-preemptible
3057 absolute symbol.
3058 (elf_x86_64_relocate_section): Don't generate relative relocation
3059 for GOTPCREL relocations aganst local absolute symbol. Pass sec
3060 to GENERATE_DYNAMIC_RELOCATION_P.
3061 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
3062 against non-preemptible absolute symbol.
3063 (_bfd_elf_x86_valid_reloc_p): New function.
3064 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
3065 GOT_ABS GOT slot.
3066 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
3067 argument. Don't generate dynamic relocation against
3068 non-preemptible absolute symbol.
3069 (ABS_SYMBOL_P): New.
3070 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
3071 against non-preemptible absolute symbol.
3072 (GOT_ABS): New.
3073 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
3074 (_bfd_elf_x86_valid_reloc_p): New.
3075
a7618269
TC
30762020-04-01 Tamar Christina <tamar.christina@arm.com>
3077
3078 PR ld/16017
3079 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
3080 address in the GOT if in thumb only mode.
3081
15ccbdd7
TC
30822020-04-01 Tamar Christina <tamar.christina@arm.com>
3083
3084 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
3085
7b948a25
HPN
30862020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
3087
3088 * mmo.c (mmo_scan): Create .text section only when needed, not
3089 from the start.
3090
89b599df
AM
30912020-03-31 Alan Modra <amodra@gmail.com>
3092
3093 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
3094 return value check.
3095
81699544
AM
30962020-03-31 Alan Modra <amodra@gmail.com>
3097
3098 * vms-alpha.c (image_write): Check bounds for sections without
3099 contents too. Error on non-zero write to section without
3100 contents.
3101 (_bfd_vms_slurp_etir): Check return of image_write* functions.
3102
b3b360de
AM
31032020-03-31 Alan Modra <amodra@gmail.com>
3104
3105 * tekhex.c (pass_over): Check is_eof before reading buffer.
3106
00386881
NC
31072020-03-30 Nick Clifton <nickc@redhat.com>
3108
3109 PR binutils/pr25662
3110 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
3111 field to timestamp and make it an integer.
3112 * libcoff.h: Regenerate.
3113 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
3114 field in the pe_data structure rather than the insert_timestamp
3115 field.
3116
988b7300
AM
31172020-03-30 Alan Modra <amodra@gmail.com>
3118
3119 PR 25745
3120 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
3121 statistics message.
3122
aa49fc22
NC
31232020-03-26 Nick Clifton <nickc@redhat.com>
3124
3125 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
3126 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
3127 prototype.
3128 * libbfd.h: Regenerate.
3129
ff768510
AM
31302020-03-26 Alan Modra <amodra@gmail.com>
3131
3132 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
3133
f75fbe8a
AM
31342020-03-26 Alan Modra <amodra@gmail.com>
3135
3136 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
3137 array.
3138 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
3139
aac88046
NC
31402020-03-25 Nick Clifton <nickc@redhat.com>
3141
3142 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
3143 function.
3144 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
3145 * libbfd.h: Regenerate.
3146
cf2611fe
SV
31472020-03-25 Shahab Vahedi <shahab@synopsys.com>
3148
3149 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
3150 correct field name in the output string.
3151
d16e3d2e
AM
31522020-03-25 Alan Modra <amodra@gmail.com>
3153
3154 PR 25662
3155 * elf.c (assign_file_positions_for_load_sections): Adjust offset
3156 for SHT_NOBITS section if first in segment.
3157
1081065c
L
31582020-03-24 H.J. Lu <hongjiu.lu@intel.com>
3159
3160 PR binutils/25708
3161 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
3162 (_bfd_elf_get_symbol_version_string): This.
3163 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
3164 (_bfd_elf_get_symbol_version_string): This.
3165 (bfd_elf_print_symbol): Pass TRUE to
3166 _bfd_elf_get_symbol_version_string.
3167 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
3168 bfd_boolean argument.
3169 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
3170 * targets.c (_bfd_get_symbol_version_string): Likewise.
3171 (bfd_get_symbol_version_string): Likewise.
3172 * bfd-in2.h: Regenerated.
3173
0b8448af 31742020-03-24 Nick Clifton <nickc@redhat.com>
e11cd7c4 3175 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
0b8448af
NC
3176
3177 PR 25713
3178 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
3179 Win32 systems.
3180
ec2e748a
NC
31812020-03-24 Nick Clifton <nickc@redhat.com>
3182
3183 PR 25681
3184 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
3185 segment to use for PT_GNU_RELRO, ignore empty sections in a
3186 segment's current list.
3187
cda7e560
L
31882020-03-24 H.J. Lu <hongjiu.lu@intel.com>
3189
3190 PR binutils/25717
3191 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
3192
7e6e972f
L
31932020-03-24 H.J. Lu <hongjiu.lu@intel.com>
3194
3195 PR binutils/25708
3196 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
3197 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
3198 on the previous _bfd_elf_get_symbol_version_string.
3199 (_bfd_elf_get_symbol_version_string): Use it.
3200
65109548
AM
32012020-03-24 Alan Modra <amodra@gmail.com>
3202
3203 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
3204 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
3205 struct areltdata.
3206
fdde2fb6
SH
32072020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
3208
3209 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
3210
cf28cfef
AM
32112020-03-23 Alan Modra <amodra@gmail.com>
3212
3213 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
3214 symbol count. Allocate an extra byte to ensure name strings
3215 are terminated. Sanity check name offsets. Release memory on
3216 error return.
3217
5e737279
AM
32182020-03-23 Alan Modra <amodra@gmail.com>
3219
3220 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
3221 field hasn't been read. Remove unnecessary casts.
3222
c15a8f17
AM
32232020-03-22 Alan Modra <amodra@gmail.com>
3224
3225 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
3226 enough to read number of symbols.
3227
3d98c460
L
32282020-03-20 H.J. Lu <hongjiu.lu@intel.com>
3229
3230 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
3231 (EXECUTABLE_SUFFIX): Likewise.
3232 * config.in: Regenerated.
3233 * configure: Likewise.
3234 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
3235 _bfd_generic_close_and_cleanup.
3236 (plugin_list_entry): Remove resolution_file, resolution_option,
3237 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
3238 lto_wrapper, gcc_env and initialized,
3239 (need_lto_wrapper_p): Removed.
3240 (get_lto_wrapper): Likewise.
3241 (setup_lto_wrapper_env): Likewise.
3242 (register_all_symbols_read): Likewise.
3243 (egister_cleanup): Likewise.
3244 (get_symbols): Likewise.
3245 (add_input_file): Likewise.
3246 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
3247 (add_symbols): Updated.
3248 (try_claim): Likewise.
3249 (try_load_plugin): Likewise.
3250 (bfd_plugin_canonicalize_symtab): Likewise.
3251 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
3252 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
3253
c3a1714c
L
32542020-03-19 H.J. Lu <hongjiu.lu@intel.com>
3255
3256 PR binutils/25640
3257 * plugin.c (plugin_list_entry): Add has_symbol_type.
3258 (add_symbols_v2): New function.
3259 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
3260 provides symbol type.
3261 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
3262 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
3263 available.
3264
67338173
AM
32652020-03-20 Alan Modra <amodra@gmail.com>
3266
3267 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
3268 enough to read number of symbols.
3269
a859124d
AM
32702020-03-20 Alan Modra <amodra@gmail.com>
3271
3272 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
3273 backend functions for NULL before calling.
3274 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
3275 (bfd_section_from_shdr, assign_section_numbers): Likewise.
3276 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
3277 * elfnn-ia64.c (ignore_errors): New function.
3278 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
3279
f3a08f77
NC
32802020-03-19 Nick Clifton <nickc@redhat.com>
3281
3282 PR 25676
3283 * dwarf2.c (struct varinfo): Add unit_offset field to record the
3284 location of the varinfo in the unit's debug info data. Change the
3285 type of the stack field to a boolean.
3286 (lookup_var_by_offset): New function. Returns the varinfo
3287 structure for the variable described at the given offset in the
3288 unit's debug info.
3289 (scan_unit_for_symbols): Add support for variables which have the
3290 DW_AT_specification attribute.
3291
6a541707
NC
32922020-03-19 Nick Clifton <nickc@redhat.com>
3293
3294 PR 25699
3295 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
3296 error return.
3297
effc14f5
SH
32982020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
3299
3300 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
3301
ac4bf06c
NC
33022020-03-18 Nick Clifton <nickc@redhat.com>
3303
3304 PR 25673
3305 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
3306 memory access when processing a corrupt secondary reloc section.
3307
53215f21
CL
33082020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
3309
3310 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
3311 instead of calling abort.
3312 * elf32-csky.c (csky_build_one_stub): Likewise.
3313 * elf32-hppa.c (hppa_build_one_stub): Likewise.
3314 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
3315 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
3316 * elf32-metag.c (metag_build_one_stub): Likewise.
3317 * elf32-nios2.c (nios2_build_one_stub): Likewise.
3318 * elf64-ppc.c (ppc_build_one_stub): Likewise.
3319 (ppc_size_one_stub): Likewise.
3320 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
3321
327ef784
NC
33222020-03-17 Nick Clifton <nickc@redhat.com>
3323
d3c3c542 3324 PR 25688
327ef784
NC
3325 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
3326 with error messages.
3327
ecbbbdba
NC
33282020-03-17 Nick Clifton <nickc@redhat.com>
3329
3330 PR 25687
3331 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
3332 free. Add free on another failure path.
3333
4b3ecb3b
AM
33342020-03-16 Alan Modra <amodra@gmail.com>
3335
3336 PR 25675
3337 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
3338 we have a non-zero section count. Do lma comparison in octets.
3339
7bac4137
AM
33402020-03-16 Alan Modra <amodra@gmail.com>
3341
3342 * vms-alpha.c (dst_restore_location): Validate index into
3343 dst_ptr_offsets array before accessing. Return status.
3344 (dst_retrieve_location): Similarly, making "loc" parameter a
3345 pointer to return value.
3346 (_bfd_vms_slurp_etir): Update calls to above functions.
3347
8b5d0a4f
KR
33482020-03-14 Kamil Rytarowski <n54@gmx.com>
3349
3350 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
3351 targets.
3352 * configure: Regenerated.
3353
48e81d7f
AM
33542020-03-14 Alan Modra <amodra@gmail.com>
3355
3356 * section.c (BFD_FAKE_SECTIONS): Formatting.
3357 * bfd-in2.h: Regenerate.
3358
06d949ec
KR
33592020-03-13 Kamil Rytarowski <n54@gmx.com>
3360
3361 * elf.c (elfcore_grok_netbsd_note): Add support for
3362 NT_NETBSDCORE_LWPSTATUS notes.
3363
abf874aa
CL
33642020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
3365
3366 * bfd-in2.h: Regenerate.
3367 * section.c (asection): Add already_assigned field.
3368 (BFD_FAKE_SECTION): Add default initializer for it.
3369 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
3370 * elf32-arm.c (arm_build_one_stub): Add support for
3371 non_contiguous_regions.
3372 * elf32-csky.c (csky_build_one_stub): Likewise.
3373 * elf32-hppa.c (hppa_build_one_stub): Likewise.
3374 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
3375 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
3376 * elf32-metag.c (metag_build_one_stub): Likewise.
3377 * elf32-nios2.c (nios2_build_one_stub): Likewise.
3378 * elf64-ppc.c (ppc_build_one_stub): Likewise.
3379 (ppc_size_one_stub): Likewise.
3380 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
3381 * elflink.c (elf_link_input_bfd): Likewise.
3382
74e10d17
L
33832020-03-13 H.J. Lu <hongjiu.lu@intel.com>
3384
3385 PR ld/24920
3386 * elf-linker-x86.h (elf_linker_x86_params): Add
3387 static_before_all_inputs and has_dynamic_linker.
3388 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
3389 dynamic input objects if -static is passed at command-line
3390 before all input files without --dynamic-linker unless
3391 --no-dynamic-linker is used.
3392
015ec493
KR
33932020-03-13 Kamil Rytarowski <n54@gmx.com>
3394
3395 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
3396
66631823
CE
33972020-03-13 Christian Eggers <ceggers@gmx.de>
3398
3399 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
3400 "p_paddr" from "at".
3401 * elfcode.h (bfd_from_remote_memory): Add units to several
3402 parameters. New local "opb". Fix usage of p_align. Fix
3403 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
3404 call of target_read_memory.
3405 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
3406 calculation of "offset" and "output_offset".
3407 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
3408 from "offset" and fix calculation of "end" from "vma+size". Fix
3409 comparison between "sh_addr" and "vma"/"output_offset".
3410 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
3411 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
3412 member.
3413 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
3414 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
3415 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
3416 assignment of p_paddr from phdr_lma. Fix comparison between
3417 "lma+size" and "next->lma".
3418 (elf_sort_segments): Fix assignment from p_paddr to lma.
3419 (assign_file_positions_for_load_sections): Add unit (bytes) to
3420 local "align". Fix calculation of local "off_adjust". Fix
3421 calculation of local "filehdr_vaddr".
3422 (assign_file_positions_for_non_load_sections): New local "opb".
3423 Fix calculation of "end" from "p_size". Fix comparison between
3424 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
3425 from "end" and "p_vaddr".
3426 (rewrite_elf_program_header): Fix comparison between p_vaddr and
3427 vma. Fix assignment to p_paddr from lma. Fix comparison between
3428 p_paddr and lma. Fix assignment to p_paddr from lma.
3429 * merge.c (sec_merge_emit): New local "opb". Convert
3430 "alignment_power" to octets.
3431 (_bfd_add_merge_section): New locals "alignment_power" and
3432 "opb". Fix comparison between "alignment_power" and
3433 "sizeof(align)".
3434 (_bfd_merge_sections): New local "opb". Divide size by opb
3435 before checking align mask.
3436
502794d4
CE
34372020-03-13 Christian Eggers <ceggers@gmx.de>
3438
3439 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
3440 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
3441 section LMA/VMA.
3442 (_bfd_elf_make_section_from_phdr): Similarly.
3443 (elf_fake_sections): Fix calculation of
3444 Elf_Internal_shdr::sh_addr from section VMA.
3445 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
3446 and bytes.
3447 (assign_file_positions_for_load_sections): Fix calculations of
3448 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
3449 comparison between program header address and section LMA.
3450 (assign_file_positions_for_non_load_sections): Likewise.
3451 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
3452 (IS_CONTAINED_BY_VMA): Add parameter opb.
3453 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
3454 INCLUDE_SECTION_IN_SEGMENT): Likewise.
3455 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
3456 Fix calculations of p_addr_valid and p_vaddr_offset.
3457 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
3458 with octets per byte when comparing against p_vaddr.
3459
8248d21a
AM
34602020-03-11 Alan Modra <amodra@gmail.com>
3461
3462 * som.c (setup_sections): Sanity check subspace.name.
3463
435edf0b
AM
34642020-03-11 Alan Modra <amodra@gmail.com>
3465
3466 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
3467
6b5e16ff
AM
34682020-03-10 Alan Modra <amodra@gmail.com>
3469
3470 PR 25648
3471 * ihex.c (ihex_write_object_contents): Don't assume ordering of
3472 addresses here.
3473
2f57795b
AM
34742020-03-09 Alan Modra <amodra@gmail.com>
3475
3476 * wasm-module.c (wasm_scan): Sanity check file name length
3477 before allocating memory. Move common section setup code. Do
3478 without bfd_tell to calculate section size.
3479
a0dcf297
NC
34802020-03-06 Nick Clifton <nickc@redhat.com>
3481
3482 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
3483 with error messages and failure return values.
3484
e15a8da9
MF
34852020-03-05 Max Filippov <jcmvbkbc@gmail.com>
3486
3487 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
3488 relocation sections for any removed reference to a dynamic symbol.
3489
a8e14f4c
NC
34902020-03-05 Nick Clifton <nickc@redhat.com>
3491
3492 * elf-bfd.h (struct elf_backend_data): Add new fields:
3493 init_secondary_reloc_section, slurp_secondary_reloc_section,
3494 write_secondary_reloc_section.
3495 (_bfd_elf_init_secondary_reloc_section): Prototype.
3496 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
3497 (_bfd_elf_write_secondary_reloc_section): Prototype.
3498 * elf.c ( bfd_section_from_shdr): Invoke the new
3499 init_secondary_reloc_section backend function, if defined, when a
3500 second reloc section is encountered.
3501 (swap_out_syms): Invoke the new symbol_section_index function, if
3502 defined, when computing the section index of an OS/PROC specific
3503 symbol.
3504 (_bfd_elf_init_secondary_reloc_section): New function.
3505 (_bfd_elf_slurp_secondary_reloc_section): New function.
3506 (_bfd_elf_write_secondary_reloc_section): New function.
3507 (_bfd_elf_copy_special_section_fields): New function.
3508 * elfcode.h (elf_write_relocs): Invoke the new
3509 write_secondary_relocs function, if defined, in order to emit
3510 secondary relocs.
3511 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
3512 function, if defined, in order to read in secondary relocs.
3513 * elfxx-target.h (elf_backend_copy_special_section_fields):
3514 Provide a non-NULL default definition.
3515 (elf_backend_init_secondary_reloc_section): Likewise.
3516 (elf_backend_slurp_secondary_reloc_section): Likewise.
3517 (elf_backend_write_secondary_reloc_section): Likewise.
3518 (struct elf_backend_data elfNN_bed): Add initialisers for the new
3519 fields.
3520 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
3521 * configure: Regenerate.
3522
6f8f95b4
AM
35232020-03-05 Alan Modra <amodra@gmail.com>
3524
3525 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
3526 against file size before allocating memory. Use bfd_alloc rather
3527 than bfd_zalloc for carsym/strings memory.
3528
233bf4f8
AM
35292020-03-04 Alan Modra <amodra@gmail.com>
3530
3531 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
3532 sh_addr mod sh_addalign is zero.
3533
1039fd9a
AM
35342020-03-04 Alan Modra <amodra@gmail.com>
3535
3536 * format.c (bfd_check_format_matches): Call cleanup on error exit.
3537
f5714099
AM
35382020-03-03 Alan Modra <amodra@gmail.com>
3539
3540 * format.c (struct bfd_preserve): Add cleanup field.
3541 (bfd_preserve_save): Add cleanup param and save.
3542 (bfd_preserve_restore): Return cleanup.
3543 (bfd_preserve_finish): Call the cleanup for the discarded match.
3544 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
3545 and clear when preserving a match. Restore cleanup too when
3546 restoring that match.
3547
40b35c78
AM
35482020-03-02 Alan Modra <amodra@gmail.com>
3549
3550 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
3551 * hpux-core.c (hpux_core_core_file_p): Update prototype.
3552 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
3553 (core_sco5_vec): Correct initialisers.
3554
601b73d5
AM
35552020-03-02 Alan Modra <amodra@gmail.com>
3556
3557 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
3558 * aix5ppc-core.c (xcoff64_core_p): Likewise.
3559 * cisco-core.c (cisco_core_file_validate): Likewise.
3560 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
3561 * hpux-core.c (hpux_core_core_file_p): Likewise.
3562 * irix-core.c (irix_core_core_file_p): Likewise.
3563 * lynx-core.c (lynx_core_file_p): Likewise.
3564 * netbsd-core.c (netbsd_core_file_p): Likewise.
3565 * osf-core.c (osf_core_core_file_p): Likewise.
3566 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
3567 * sco5-core.c (sco5_core_file_p): Likewise.
3568
728d32c4
L
35692020-03-02 H.J. Lu <hongjiu.lu@intel.com>
3570
3571 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
3572
cb001c0d
AM
35732020-03-02 Alan Modra <amodra@gmail.com>
3574
3575 * targets.c (bfd_cleanup): New typedef.
3576 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
3577 * libbfd-in.h (_bfd_no_cleanup): Define.
3578 * format.c (bfd_reinit): Add cleanup parameter, call it.
3579 (bfd_check_format_matches): Set cleanup from _bfd_check_format
3580 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
3581 * aout-target.h (callback, object_p): Return bfd_cleanup.
3582 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
3583 * archive.c (bfd_generic_archive_p): Likewise.
3584 * binary.c (binary_object_p): Likewise.
3585 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
3586 * coff-ia64.c (ia64coff_object_p): Likewise.
3587 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
3588 * coff-sh.c (coff_small_object_p): Likewise.
3589 * coff-stgo32.c (go32_check_format): Likewise.
3590 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
3591 (xcoff64_core_p): Likewise.
3592 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
3593 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
3594 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
3595 * elfcode.h (elf_object_p): Likewise.
3596 * elfcore.h (elf_core_file_p): Likewise.
3597 * i386msdos.c (msdos_object_p): Likewise.
3598 * ihex.c (ihex_object_p): Likewise.
3599 * libaout.h (some_aout_object_p): Likewise.
3600 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
3601 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
3602 * libbfd.c (_bfd_dummy_target): Likewise.
3603 * libcoff-in.h (coff_object_p): Likewise.
3604 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
3605 (bfd_mach_o_arm64_core_p): Likewise.
3606 * mach-o-arm.c (bfd_mach_o_arm_object_p),
3607 (bfd_mach_o_arm_core_p): Likewise.
3608 * mach-o-i386.c (bfd_mach_o_i386_object_p),
3609 (bfd_mach_o_i386_core_p): Likewise.
3610 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
3611 (bfd_mach_o_x86_64_core_p): Likewise.
3612 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
3613 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
3614 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
3615 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
3616 * mmo.c (mmo_object_p): Likewise.
3617 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
3618 * peicode.h (coff_real_object_p, pe_ILF_object_p),
3619 (pe_bfd_object_p): Likewise.
3620 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
3621 * ppcboot.c (ppcboot_object_p): Likewise.
3622 * rs6000-core.c (rs6000coff_core_p): Likewise.
3623 * som.c (som_object_setup, som_object_p): Likewise.
3624 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
3625 * tekhex.c (tekhex_object_p): Likewise.
3626 * vms-alpha.c (alpha_vms_object_p): Likewise.
3627 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
3628 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
3629 * wasm-module.c (wasm_object_p): Likewise.
3630 * xsym.c (bfd_sym_object_p): Likewise.
3631 * xsym.h (bfd_sym_object_p): Likewise.
3632 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
3633 return type.
3634 * pdp11.c (some_aout_object_p): Likewise.
3635 * plugin.c (register_ld_plugin_object_p): Update object_p
3636 parameter type.
3637 * plugin.h (register_ld_plugin_object_p): Likewise.
3638 * bfd-in2.h: Regenerate.
3639 * libbfd.h: Regenerate.
3640 * libcoff.h: Regenerate.
3641
a4dd6c97
AM
36422020-03-02 Alan Modra <amodra@gmail.com>
3643
3644 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
3645 applicable section flags.
3646 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
3647 (mips_ecoff_bele_vec): Likewise.
3648 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
3649 and .sbss sections.
3650 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
3651 (_bfd_ecoff_styp_to_sec_flags): Likewise.
3652
bf577467
AM
36532020-03-02 Alan Modra <amodra@gmail.com>
3654
3655 * elf32-m32r.c (m32r_elf_section_flags): New function.
3656 (elf_backend_section_flags): Define.
3657 * elf32-nds32.c (nds32_elf_section_flags): New function.
3658 (elf_backend_section_flags): Define.
3659 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
3660 .sbss and .sdata sections.
3661 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
3662 for SHF_V850_GPREL sections.
3663 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
3664 FIXME.
3665 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
3666 for SHF_PARISC_SHORT sections.
3667 * elf64-ppc.c (ppc64_elf_section_flags): New function.
3668 (elf_backend_section_flags): Define.
3669 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
3670 for SHF_MIPS_GPREL sections. Delete FIXME.
3671
8c803a2d
AM
36722020-03-02 Alan Modra <amodra@gmail.com>
3673
3674 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
3675 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
3676 calling elf_backend_section_flags with adjusted params. Use
3677 newsect->flags past that point.
3678 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
3679 special sections.
3680 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
3681 to have their type overridden, and all sh_flags but processor and
3682 os specific.
3683 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
3684 * elf32-mep.c (mep_elf_section_flags): Likewise.
3685 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
3686 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
3687 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
3688 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
3689 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
3690 stub BFD and non-aarch64 input files when scanning for stubs.
3691
7d4b2d2d
AM
36922020-03-02 Alan Modra <amodra@gmail.com>
3693
3694 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
3695 limit to decompressed element size.
3696
26f60d59
AM
36972020-03-02 Alan Modra <amodra@gmail.com>
3698
3699 * vms-lib.c (vms_traverse_index): Add recur_count param and
3700 update calls. Fail on excessive recursion.
3701
9cb56943
AM
37022020-03-02 Alan Modra <amodra@gmail.com>
3703
3704 * vms-alpha.c (vms_get_remaining_object_record): Use
3705 bfd_realloc_or_free rather than bfd_realloc.
3706 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
3707 (dst_define_location, parse_module): Likewise, and check realloc
3708 return status before using memory. Return status from function
3709 adjusting all callers.
3710
182ec670
AM
37112020-02-28 Alan Modra <amodra@gmail.com>
3712
3713 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
3714
1b088c82
AM
37152020-02-28 Alan Modra <amodra@gmail.com>
3716
3717 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
3718 Remove duplicate undersize check.
3719
5f602802
AM
37202020-02-27 Alan Modra <amodra@gmail.com>
3721
3722 PR 24511
3723 * mmo.c (mmo_scan): Set SEC_DATA for .data.
3724
49d9fd42
AM
37252020-02-27 Alan Modra <amodra@gmail.com>
3726
3727 PR 24511
3728 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
3729 (coff_section_type): Adjust comment.
3730 (decode_section_type): Likewise. Call coff_section_type before
3731 decode_section_type.
3732 (bfd_decode_symclass): Use 'c' for common sections other than
3733 the standard one.
3734
05f52dc2
AM
37352020-02-27 Alan Modra <amodra@gmail.com>
3736
3737 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
3738 malloc'd block.
3739
ff69a894
AM
37402020-02-27 Alan Modra <amodra@gmail.com>
3741
3742 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
3743 if file is an archive element.
3744 * bfd-in2.h: Regenerate.
3745
02f7e7ee
AM
37462020-02-26 Alan Modra <amodra@gmail.com>
3747
3748 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
3749 bfd_set_error on failing test. Don't bother changing bfd_error on
3750 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
3751 Check sym name is within string buffer. Use size_t for some vars.
3752 (do_slurp_coff_armap): Use size_t for some variables, fix size of
3753 int_buf. Don't change bfd_error on file read error. Use
3754 _bfd_mul_overflow when calculating carsym buffer size. Reorder
3755 calculations to catch overflows before they occur. malloc and
3756 free raw armap rather than using bfd_alloc. Read raw armap before
3757 allocating carsym+strings buffer.
3758 (_bfd_slurp_extended_name_table): Localize variables. Check
3759 name size against file size.
3760
cc4c4f40
AM
37612020-02-26 Alan Modra <amodra@gmail.com>
3762
3763 * vms-lib.c (vms_lib_read_index): Release correct buffer.
3764
e0b317de
AM
37652020-02-26 Alan Modra <amodra@gmail.com>
3766
3767 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
3768 malloc. Check for NULL return from bfd_malloc.
3769 (rx_table_find, rx_table_map): Likewise.
3770 (rx_set_section_contents): Check bfd_alloc return.
3771 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
3772
dc1e8a47
AM
37732020-02-26 Alan Modra <amodra@gmail.com>
3774
3775 * aoutx.h: Indent labels correctly. Format error strings.
3776 * archive.c: Likewise.
3777 * archive64.c: Likewise.
3778 * coff-arm.c: Likewise.
3779 * coff-rs6000.c: Likewise.
3780 * coff-stgo32.c: Likewise.
3781 * cpu-arm.c: Likewise.
3782 * dwarf2.c: Likewise.
3783 * elf-ifunc.c: Likewise.
3784 * elf-properties.c: Likewise.
3785 * elf-s390-common.c: Likewise.
3786 * elf-strtab.c: Likewise.
3787 * elf.c: Likewise.
3788 * elf32-arm.c: Likewise.
3789 * elf32-bfin.c: Likewise.
3790 * elf32-cr16.c: Likewise.
3791 * elf32-csky.c: Likewise.
3792 * elf32-i386.c: Likewise.
3793 * elf32-m68k.c: Likewise.
3794 * elf32-msp430.c: Likewise.
3795 * elf32-nds32.c: Likewise.
3796 * elf32-nios2.c: Likewise.
3797 * elf32-pru.c: Likewise.
3798 * elf32-xtensa.c: Likewise.
3799 * elf64-ia64-vms.c: Likewise.
3800 * elf64-x86-64.c: Likewise.
3801 * elfcode.h: Likewise.
3802 * elfcore.h: Likewise.
3803 * elflink.c: Likewise.
3804 * elfnn-aarch64.c: Likewise.
3805 * elfnn-ia64.c: Likewise.
3806 * elfnn-riscv.c: Likewise.
3807 * elfxx-mips.c: Likewise.
3808 * elfxx-sparc.c: Likewise.
3809 * elfxx-x86.c: Likewise.
3810 * i386lynx.c: Likewise.
3811 * merge.c: Likewise.
3812 * pdp11.c: Likewise.
3813 * plugin.c: Likewise.
3814 * reloc.c: Likewise.
3815
e310298c
AM
38162020-02-26 Alan Modra <amodra@gmail.com>
3817
3818 PR 25593
3819 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
3820 "dyn_loaded".
3821 (bfd_elf_add_dt_needed_tag): Declare.
3822 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
3823 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
3824 from elf_add_dt_needed_tag. Remove soname and doit param.
3825 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
3826 to see whether as-needed lib is already loaded, use dyn_loaded
3827 list instead. When saving and restoring around as-needed lib
3828 handle possibility that dynstr has not been initialised. Don't
3829 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
3830 Mark libs loaded via DT_NEEDED entries of other libs with
3831 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
3832 the output.
3833 (elf_link_check_versioned_symbol): Remove now unneccesary
3834 DYNAMIC check when traversing dyn_loaded list.
3835
b570b954
AM
38362020-02-26 Alan Modra <amodra@gmail.com>
3837
3838 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
3839
ecda9016
L
38402020-02-25 H.J. Lu <hongjiu.lu@intel.com>
3841
3842 PR binutils/25584
3843 * plugin.c (need_lto_wrapper_p): New.
3844 (bfd_plugin_set_program_name): Add an int argument to set
3845 need_lto_wrapper_p.
3846 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
3847 set.
3848 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
3849
a98c743f
AM
38502020-02-24 Alan Modra <amodra@gmail.com>
3851
3852 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
3853
c893ce36
AM
38542020-02-24 Alan Modra <amodra@gmail.com>
3855
3856 * vms-lib.c (struct carsym_mem): Add limit.
3857 (vms_add_index): Heed limit.
3858 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
3859 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
3860 Always return actual number read.
3861 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
3862 assertion with error exit.
3863
7b3c2715
AM
38642020-02-22 Alan Modra <amodra@gmail.com>
3865
3866 PR 25585
3867 * elf.c (assign_file_positions_for_load_sections): Continue linking
3868 on "PHDR segment not covered by LOAD segment" errors.
3869
a4425a57
AM
38702020-02-21 Alan Modra <amodra@gmail.com>
3871
3872 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
3873 overflow check.
3874 (bfd_mach_o_canonicalize_reloc): Likewise.
3875 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
3876 counts and offsets against file size.
3877 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
3878 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
3879 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
3880 against file size. Delete symbol table error message.
3881 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
3882 against file size.
3883 (bfd_mach_o_read_symtab): Likewise.
3884 (bfd_mach_o_read_command): Pass file size.
3885 (bfd_mach_o_scan): Sanity check command count against file size.
3886
dda2980f
AM
38872020-02-21 Alan Modra <amodra@gmail.com>
3888
3889 PR 25569
3890 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
3891 "text", "data" and "bss" section pointer vars. Don't update
3892 section size, just exec header sizes.
3893 (adjust_sizes_and_vmas): Don't update text section size. Set
3894 initial exec header a_text. Print exec headers sizes.
3895 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
3896 (adjust_sizes_and_vmas): Similarly. Formatting.
3897 (final_link): Correct final file extension.
3898
00e49dff
NC
38992020-02-20 Nick Clifton <nickc@redhat.com>
3900
3901 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
3902 callback.
3903 * elfxx-target.h (elf_backend_symbol_section_index): Provide
3904 default definition.
3905 (elfNN_bed): Initialise the symbol_section_index field.
3906 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
3907 OS and PROC specific section indicies. Warn if converting other
3908 reserved incidies to SHN_ABS.
3909
fcaaac0a
SB
39102020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
3911
3912 PR 25537
3913 * cpu-z80.c: Add machine type compatibility checking.
3914
dcf06b89
L
39152020-02-19 H.J. Lu <hongjiu.lu@intel.com>
3916
3917 PR binutils/25355
3918 * plugin.c (plugin_list_entry): Remove handle.
3919 (try_load_plugin): Call dlclose before return.
3920
2c7c5554
AM
39212020-02-19 Alan Modra <amodra@gmail.com>
3922
3923 * libbfd-in.h (_bfd_constant_p): Define.
3924 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
3925 file size before allocating memory.
3926 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
3927 * elf.c (bfd_elf_get_str_section): Likewise.
3928 (_bfd_elf_slurp_version_tables): Likewise.
3929 * libbfd.h: Regenerate.
3930
2bb3687b
AM
39312020-02-19 Alan Modra <amodra@gmail.com>
3932
3933 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
3934 * aoutx.h (aout_get_external_symbols): Replace calls to
3935 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
3936 (slurp_reloc_table): Likewise.
3937 * archive.c (do_slurp_bsd_armap): Likewise.
3938 (do_slurp_coff_armap): Likewise.
3939 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
3940 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
3941 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
3942 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
3943 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
3944 (_bfd_coff_get_external_symbols): Likewise.
3945 * ecoff.c (ecoff_slurp_symbolic_header),
3946 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
3947 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
3948 (ecoff_indirect_link_order): Likewise.
3949 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
3950 (_bfd_elf_slurp_version_tables): Likewise.
3951 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
3952 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
3953 * elf32-rx.c (elf32_rx_relax_section): Likewise.
3954 * elf64-alpha.c (READ): Likewise.
3955 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
3956 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
3957 * elfcode.h (elf_slurp_symbol_table),
3958 (elf_slurp_reloc_table_from_section): Likewise.
3959 * elflink.c (elf_link_add_object_symbols),
3960 (elf_link_check_versioned_symbol): Likewise.
3961 * elfxx-mips.c (READ): Likewise.
3962 * i386lynx.c (slurp_reloc_table): Likewise.
3963 * lynx-core.c (lynx_core_file_p): Likewise.
3964 * mach-o.c (bfd_mach_o_canonicalize_relocs),
3965 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
3966 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
3967 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
3968 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
3969 (bfd_pef_parse_symbols): Likewise.
3970 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
3971 * som.c (setup_sections, som_slurp_string_table),
3972 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
3973 (som_bfd_fill_in_ar_symbols): Likewise.
3974 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
3975 (evax_bfd_print_image): Likewise.
3976 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
3977 * wasm-module.c (wasm_scan): Likewise.
3978 * xcofflink.c (xcoff_link_add_symbols): Likewise.
3979 * xsym.c (bfd_sym_read_name_table),
3980 (bfd_sym_print_type_information_table_entry): Likewise.
3981 * libbfd.h: Regenerate.
3982
806470a2
AM
39832020-02-19 Alan Modra <amodra@gmail.com>
3984
3985 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
3986 reading external relocs.
3987 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
3988 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
3989 after bfd_bread.
3990 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
3991 bfd_release.
3992 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
3993 (m32c_elf_relax_section): Likewise.
3994 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
3995 (rl78_elf_relax_section): Likewise.
3996 * elf32-rx.c (rx_offset_for_reloc): Likewise.
3997 (elf32_rx_relax_section): Likewise.
3998 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
3999 parameter types and use..
4000 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
4001 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
4002 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
4003 being read from file, just the extra.
4004 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
4005 after reading external syms. Free on failure.
4006
1f4361a7
AM
40072020-02-19 Alan Modra <amodra@gmail.com>
4008
4009 * coffcode.h (buy_and_read, coff_slurp_line_table),
4010 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
4011 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
4012 corresponding bfd_alloc call. Adjust variables to suit.
4013 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
4014 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
4015 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
4016 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
4017 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
4018 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
4019 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
4020 * elf32-rx.c (elf32_rx_relax_section): Likewise.
4021 * elf64-alpha.c (READ): Likewise.
4022 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
4023 (elf_slurp_symbol_table, elf_slurp_reloc_table),
4024 (bfd_from_remote_memory): Likewise.
4025 * elfcore.h (core_find_build_id): Likewise.
4026 * elfxx-mips.c (READ): Likewise.
4027 * mach-o.c (bfd_mach_o_mangle_sections),
4028 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
4029 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
4030 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
4031 * som.c (setup_sections, som_prep_for_fixups)
4032 (som_build_and_write_symbol_table, som_slurp_symbol_table),
4033 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
4034 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
4035 (som_bfd_ar_write_symbol_stuff): Likewise.
4036 * vms-alpha.c (vector_grow1): Likewise.
4037 * vms-lib.c (vms_add_index): Likewise.
4038 * wasm-module.c (wasm_scan_name_function_section): Likewise.
4039 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
4040 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
4041 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
4042 (bfd_alloc2, bfd_zalloc2): Delete.
4043 (_bfd_mul_overflow): Define.
4044 * libbfd.h: Regenerate.
4045
446f7ed5
AM
40462020-02-19 Alan Modra <amodra@gmail.com>
4047
4048 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
4049 bfd_zalloc2.
4050 (assign_section_numbers): Likewise.
4051 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
4052 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
4053 bfd_malloc2, size_t amt, and unsigned tls_count.
4054 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
4055 * elflink.c (elf_create_symbuf): Use bfd_malloc.
4056 (elf_output_implib): Use bfd_alloc.
4057
b03202e3
AM
40582020-02-19 Alan Modra <amodra@gmail.com>
4059
4060 * bfd.c (struct bfd): Move format and direction to other
4061 bitfields. Add "size".
4062 * bfdio.c (bfd_get_size): Cache size when not writing file.
4063 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
4064 returning zero, ie. unknown.
4065 (bfd_get_alt_debug_link_info): Likewise.
4066 * bfd-in2.h: Regenerate.
4067
7c5fa58e
AM
40682020-02-19 Alan Modra <amodra@gmail.com>
4069
4070 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
4071 bfd_get_file_size twice.
4072 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
4073 zero, ie. unknown, return.
4074 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
4075 * elfcode.h (elf_swap_shdr_in): Likewise.
4076 (elf_object_p): Don't call bfd_get_file_size twice and correct
4077 file size check.
4078
96d3b80f
AM
40792020-02-19 Alan Modra <amodra@gmail.com>
4080
4081 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
4082 FALSE if memory alloc fails. Adjust calls.
4083 * som.c (som_prep_for_fixups): Likewise.
4084 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
4085 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
4086 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
4087 * som.c (som_build_and_write_symbol_table): Return via error_return
4088 on seek failure.
4089 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
4090 (VEC_APPEND_EL): Delete.
4091 (vector_grow1): Return pointer to element. Catch overflow.
4092 Return NULL on memory allocation failure.
4093 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
4094 (alpha_vms_add_fixup_ca): Likewise.
4095 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
4096 before using.
4097 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
4098
986f0783
AM
40992020-02-19 Alan Modra <amodra@gmail.com>
4100
4101 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
4102 * aout-target.h (object_p): Likewise.
4103 * aout-tic30.c (tic30_aout_object_p): Likewise.
4104 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
4105 (emit_stringtab, write_syms, link_hash_table_create),
4106 (aout_link_write_other_symbol): Likewise.
4107 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
4108 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
4109 (_bfd_compute_and_write_armap): Likewise.
4110 * archures.c (bfd_arch_list): Likewise.
4111 * bfd.c (bfd_record_phdr): Likewise.
4112 * binary.c (binary_canonicalize_symtab): Likewise.
4113 * cisco-core.c (cisco_core_file_validate): Likewise.
4114 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
4115 (find_arm_glue, record_arm_to_thumb_glue),
4116 (record_thumb_to_arm_glue): Likewise.
4117 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
4118 (ppc_allocate_toc_section): Likewise.
4119 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
4120 * coff-sh.c (sh_relax_section): Likewise.
4121 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
4122 * coffcode.h (handle_COMDAT, coff_new_section_hook),
4123 (coff_set_alignment_hook, coff_mkobject),
4124 (coff_compute_section_file_positions): Likewise.
4125 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
4126 (coff_find_nearest_line_with_names),
4127 ( bfd_coff_set_symbol_class): Likewise.
4128 * cofflink.c (_bfd_coff_link_hash_table_create),
4129 (_bfd_coff_link_input_bfd): Likewise.
4130 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
4131 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
4132 (build_line_info_table, sort_line_sequences),
4133 (line_info_add_include_dir, line_info_add_file_name),
4134 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
4135 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
4136 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
4137 (_bfd_ecoff_find_nearest_line),
4138 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
4139 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
4140 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
4141 * elf-m10300.c (mn10300_elf_relax_section),
4142 (elf32_mn10300_link_hash_table_create): Likewise.
4143 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
4144 * elf.c (make_mapping, copy_elf_program_header): Likewise.
4145 * elf32-arm.c (elf32_arm_link_hash_table_create),
4146 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
4147 (elf32_arm_new_section_hook): Likewise.
4148 * elf32-avr.c (elf_avr_new_section_hook),
4149 (elf32_avr_link_hash_table_create, get_local_syms),
4150 (elf32_avr_setup_section_lists): Likewise.
4151 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
4152 (bfin_link_hash_table_create): Likewise.
4153 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
4154 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
4155 * elf32-csky.c (csky_elf_link_hash_table_create),
4156 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
4157 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
4158 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
4159 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
4160 * elf32-i386.c (elf_i386_check_relocs): Likewise.
4161 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
4162 * elf32-m32r.c (m32r_elf_link_hash_table_create),
4163 (m32r_elf_check_relocs): Likewise.
4164 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
4165 (elf32_m68hc11_setup_section_lists),
4166 (elf32_m68hc11_size_stubs): Likewise.
4167 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
4168 * elf32-metag.c (elf_metag_link_hash_table_create),
4169 (elf_metag_setup_section_lists): Likewise.
4170 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
4171 (microblaze_elf_check_relocs): Likewise.
4172 * elf32-nds32.c (nds32_elf_link_hash_table_create),
4173 (nds32_elf_check_relocs): Likewise.
4174 * elf32-nios2.c (nios2_elf32_setup_section_lists),
4175 (get_local_syms, nios2_elf32_check_relocs),
4176 (nios2_elf32_link_hash_table_create): Likewise.
4177 * elf32-or1k.c (or1k_elf_link_hash_table_create),
4178 (or1k_elf_check_relocs): Likewise.
4179 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
4180 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
4181 * elf32-s390.c (elf_s390_link_hash_table_create),
4182 (elf_s390_check_relocs): Likewise.
4183 * elf32-score.c (score_elf_create_got_section),
4184 (s3_elf32_score_new_section_hook),
4185 (elf32_score_link_hash_table_create): Likewise.
4186 * elf32-score7.c (score_elf_create_got_section),
4187 (s7_elf32_score_new_section_hook): Likewise.
4188 * elf32-sh.c (sh_elf_link_hash_table_create),
4189 (sh_elf_check_relocs): Likewise.
4190 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
4191 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
4192 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
4193 (tilepro_elf_check_relocs): Likewise.
4194 * elf32-v850.c (remember_hi16s_reloc): Likewise.
4195 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
4196 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
4197 (elf_xtensa_new_section_hook): Likewise.
4198 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
4199 (get_got_entry, elf64_alpha_check_relocs): Likewise.
4200 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
4201 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
4202 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
4203 * elf64-ppc.c (ppc64_elf_new_section_hook),
4204 (ppc64_elf_link_hash_table_create, update_local_sym_info),
4205 (update_plt_info, ppc64_elf_check_relocs): Likewise.
4206 * elf64-s390.c (elf_s390_link_hash_table_create),
4207 (elf_s390_check_relocs): Likewise.
4208 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
4209 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
4210 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
4211 (elf_link_add_archive_symbols, compute_bucket_count),
4212 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
4213 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
4214 (bfd_elf_final_link): Likewise.
4215 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
4216 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
4217 (elfNN_aarch64_new_section_hook): Likewise.
4218 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
4219 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
4220 (riscv_elf_check_relocs): Likewise.
4221 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
4222 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
4223 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
4224 (_bfd_mips_elf_link_hash_table_create): Likewise.
4225 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
4226 (_bfd_sparc_elf_check_relocs),
4227 (_bfd_sparc_elf_new_section_hook): Likewise.
4228 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
4229 (tilegx_elf_check_relocs): Likewise.
4230 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
4231 * format.c (bfd_check_format_matches): Likewise.
4232 * hash.c (_bfd_stringtab_init): Likewise.
4233 * ihex.c (ihex_scan): Likewise.
4234 * irix-core.c (irix_core_core_file_p): Likewise.
4235 * linker.c (bfd_wrapped_link_hash_lookup),
4236 (_bfd_generic_link_hash_table_create),
4237 (_bfd_generic_reloc_link_order): Likewise.
4238 * lynx-core.c (lynx_core_file_p): Likewise.
4239 * netbsd-core.c (netbsd_core_file_p): Likewise.
4240 * osf-core.c (osf_core_core_file_p): Likewise.
4241 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
4242 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
4243 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
4244 * peicode.h (pe_mkobject): Likewise.
4245 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
4246 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
4247 * sco5-core.c (read_uarea): Likewise.
4248 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
4249 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
4250 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
4251 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
4252 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
4253 * srec.c (srec_scan): Likewise.
4254 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
4255 * targets.c (bfd_target_list): Likewise.
4256 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
4257 * trad-core.c (trad_unix_core_file_p): Likewise.
4258 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
4259 (vms_new_section_hook): Likewise.
4260 * wasm-module.c (wasm_make_empty_symbol): Likewise.
4261 * xcofflink.c (xcoff_get_section_contents),
4262 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
4263 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
4264 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
4265
2d0e1217
AM
42662020-02-19 Alan Modra <amodra@gmail.com>
4267
4268 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
4269
99845b3b
L
42702020-02-13 H.J. Lu <hongjiu.lu@intel.com>
4271
4272 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
4273 and use it if it isn't NULL. Remove has_plugin_p argument. Add
4274 a build_list_p argument. Don't search plugin_list. Short circuit
4275 when building the plugin list.
4276 (has_plugin): Renamed to has_plugin_list.
4277 (bfd_plugin_set_plugin): Don't set has_plugin.
4278 (bfd_plugin_specified_p): Check plugin_list instead.
4279 (build_plugin_list): New function.
4280 (load_plugin): Call build_plugin_list and use plugin_list.
4281
22fe7df8
L
42822020-02-11 H.J. Lu <hongjiu.lu@intel.com>
4283
4284 PR binutils/25355
4285 * plugin.c (try_claim): Always clean up for LTO wrapper.
4286 (try_load_plugin): Treat each object as independent. Create a
4287 copy for plugin name.
4288
c675ec1e
NC
42892020-02-11 Nick Clifton <nickc@redhat.com>
4290
4291 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
4292 for addresses in print statements.
4293 (msp430_elf_relax_delete_bytes): Likewise.
4294 (msp430_elf_relax_add_words): Likewise.
4295 (msp430_elf_relax_section): Likewise.
4296
1d07a805
L
42972020-02-11 H.J. Lu <hongjiu.lu@intel.com>
4298
4299 * plugin.c (add_symbols): Clear plugin_data memory.
4300
0aa99dcd
L
43012020-02-10 H.J. Lu <hongjiu.lu@intel.com>
4302
4303 PR binutils/25355
4304 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
4305 (EXECUTABLE_SUFFIX): Likewise.
4306 * config.in: Regenerated.
4307 * configure: Likewise.
4308 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
4309 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
4310 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
4311 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
4312 (get_lto_wrapper): New.
4313 (setup_lto_wrapper_env): Likewise.
4314 (current_plugin): Likewise.
4315 (register_all_symbols_read): Likewise.
4316 (register_cleanup): Likewise.
4317 (get_symbols): Likewise.
4318 (add_input_file): Likewise.
4319 (bfd_plugin_close_and_cleanup): Likewise.
4320 (claim_file): Removed.
4321 (register_claim_file): Set current_plugin->claim_file.
4322 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
4323 lto_syms in current_plugin.
4324 (try_claim): Use current_plugin->claim_file. Call LTO plugin
4325 all_symbols_read handler. Copy real symbols to plugin_data.
4326 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
4327 (try_load_plugin): Don't reuse the previous plugin for LTO
4328 wrapper. Set up GCC LTO wrapper if possible. Don't set
4329 plugin_list_iter->claim_file.
4330 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
4331 possible.
4332 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
4333 real_syms.
4334
ac4280da
JL
43352020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
4336
4337 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
4338 check if previous instruction matches a conditional jump inserted
4339 earlier. Invert conditional jump and delete branch in this case.
4340
8d6cb116
JL
43412020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
4342
4343 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
4344 msp430_elf_relax_add_words. Support insertion of either one or two
4345 words.
4346 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
4347 needs to be grown. Handle insertion of branch instruction to replace
4348 jump.
4349
d60f5448
JL
43502020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
4351
4352 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
4353 debugging relocations.
4354 (msp430_elf_relax_delete_bytes): Likewise.
4355 (msp430_elf_relax_add_two_words): Likewise.
4356 (msp430_elf_relax_section): Likewise.
4357
e1f85e11
AM
43582020-02-10 Alan Modra <amodra@gmail.com>
4359
4360 * archures.c: Wrap overlong z80 comments.
4361 * bfd-in2.h: Regenerate.
4362
9fc0b501
SB
43632020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
4364
4365 PR 25469
4366 * archures.c: Add GBZ80 and Z80N machine values.
4367 * reloc.c: Add BFD_RELOC_Z80_16_BE.
4368 * coff-z80.c: Add support for new reloc.
4369 * coffcode.h: Add support for new machine values.
4370 * cpu-z80.c: Add support for new machine names.
4371 * elf32-z80.c: Add support for new reloc.
4372 * bfd-in2.h: Regenerate.
4373 * libbfd.h: Regenerate.
4374
9984857c
NC
43752020-02-07 Nick Clifton <nickc@redhat.com>
4376
4377 PR 23932
4378 * elf.c (rewrite_elf_program_header): Do not complain if no
4379 sections are mapped to a segment.
4380
5242a0a0
L
43812020-02-06 H.J. Lu <hongjiu.lu@intel.com>
4382
4383 PR ld/25490
4384 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
4385 for garbage collection on __patchable_function_entries section
4386 without linked-to section.
4387
b7d07216
L
43882020-02-06 H.J. Lu <hongjiu.lu@intel.com>
4389
4390 PR gas/25381
4391 * bfd-in2.h: Regenerated.
4392 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
4393 on section if gc_mark of any of its linked-to sections is set
4394 and don't set gc_mark again.
4395 * section.c (asection): Add linked_to_symbol_name to map_head
4396 union.
4397
b93a662b
MR
43982020-02-06 Maciej W. Rozycki <macro@wdc.com>
4399
4400 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
4401 reporting an unrecognized instruction with R_V850_LONGJUMP.
4402
6df4c9c2
AM
44032020-02-05 Alan Modra <amodra@gmail.com>
4404
4405 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
4406
24872cb3
AM
44072020-02-04 Alan Modra <amodra@gmail.com>
4408
4409 * elf32-ppc.c (ppc_elf_relocate_section): After applying
4410 R_PPC_VLE_ADDR20, goto copy_reloc.
4411
ef4627fa
L
44122020-02-02 H.J. Lu <hongjiu.lu@intel.com>
4413
4414 * bfd-in2.h: Regenerated.
4415 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
4416
a8c4d40b
L
44172020-02-02 H.J. Lu <hongjiu.lu@intel.com>
4418
4419 PR gas/25380
4420 * bfd-in2.h: Regenerated.
4421 * ecoff.c (bfd_debug_section): Add section_id.
4422 * section.c (bfd_section): Add section_id.
4423 (SEC_ASSEMBLER_SECTION_ID): New.
4424 (BFD_FAKE_SECTION): Add section_id.
4425
5a9212a1
NC
44262020-02-01 Nick Clifton <nickc@redhat.com>
4427
4428 * config.bfd: Move the c30-aout and tic30-aout targets onto the
4429 obsolete list.
4430
e7cbe0c4
SL
44312020-01-31 Sandra Loosemore <sandra@codesourcery.com>
4432
4433 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
4434 encodings are relative to the GOT on nios2, too.
4435
72ebe8c5
AM
44362020-01-31 Alan Modra <amodra@gmail.com>
4437
4438 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
4439 file. Use $< and $@ in rules.
4440 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
4441 (elf32-ia64.c, elf64-ia64.c): Likewise.
4442 (elf32-riscv.c, elf64-riscv.c): Likewise.
4443 (peigen.c, pepigen.c, pex64igen.c): Likewise.
4444 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
4445 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
4446 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
4447 (peigen.c, pepigen.c, pex64igen.c): Likewise.
4448 * Makefile.in: Regenerate.
4449
327301a4
AM
44502020-01-31 Alan Modra <amodra@gmail.com>
4451
4452 PR 4110
4453 * elf.c (setup_group): Don't clear entire section contents,
4454 just the padding after group flags. Release alloc'd memory
4455 after a seek or read failure.
4456
b5d36aaa
JT
44572020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
4458
4459 * peXXigen.c (pe_is_repro): New function.
4460 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
4461 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
4462
1957ab10
JT
44632020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
4464
4465 * peXXigen.c (debug_type_names): Add names for new debug data type
4466 values.
4467
87b2920f
JT
44682020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
4469
4470 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
4471 inner loop. Fix a memory leak.
4472
72913831
AM
44732020-01-30 Alan Modra <amodra@gmail.com>
4474
4475 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
4476 or obj_coff_keep_strings here.
4477 (coff_get_normalized_symtab): Free external syms directly.
4478 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
4479 on error exit path.
4480
c35d018b
JW
44812020-01-27 Jim Wilson <jimw@sifive.com>
4482
4483 * cpu-riscv.c (riscv_scan): New.
4484 (N): Change bfd_default_scan to riscv_scan.
4485
086b06f3
AS
44862020-01-27 Andreas Schwab <schwab@suse.de>
4487
4488 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
4489 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
4490 * Makefile.in: Regenerate.
4491 * cpu-plugin.c: Remove.
4492 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
4493 (bfd_plugin_arch): Remove declaration.
4494 * bfd-in2.h: Regenerate.
4495 * po/SRC-POTFILES.in: Regenerate.
4496
3024a17a
AM
44972020-01-27 H.J. Lu <hongjiu.lu@intel.com>
4498 Alan Modra <amodra@gmail.com>
4499
4500 PR ld/25458
4501 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
4502
b5f998b2
JW
45032020-01-24 Jim Wilson <jimw@sifive.com>
4504
4505 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
4506 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
4507 avoid over long line.
4508
caa31cfa
NC
45092020-01-24 Nick Clifton <nickc@redhat.com>
4510
4511 PR 25447
4512 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
4513 syms and keep strings flags as these may have been set in order to
4514 prevent a bogus call to free.
4515
24e648d4
NC
45162020-01-23 Nick Clifton <nickc@redhat.com>
4517
4518 * po/fr.po: Updated French translation.
4519
67641dd3
AM
45202020-01-23 Alan Modra <amodra@gmail.com>
4521
4522 PR 25444
4523 * elf.c (assign_file_positions_for_load_sections): Avoid divide
4524 by zero when p_align is zero.
4525
403d1bd9
JW
45262020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
4527
4528 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
4529 (riscv_prefix_cmp): Likewise.
4530 (riscv_non_std_ext_p): Deleted.
4531 (riscv_std_sv_ext_p): Likewise.
4532 (riscv_non_std_sv_ext_p): Likewise.
4533 (riscv_merge_non_std_and_sv_ext): Rename to...
4534 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
4535 (riscv_merge_arch_attr_info): Replace 3 calls to
4536 riscv_merge_non_std_and_sv_ext with single call to
4537 riscv_merge_multi_letter_ext.
4538 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
4539 encounter a 'z' prefix.
4540 (riscv_get_prefix_class): New function, return prefix class based
4541 on first few characters of input string.
4542 (riscv_parse_config): New structure to factor out minor differences
4543 in extension class parsing behaviour.
4544 (riscv_parse_sv_or_non_std_ext): Rename to...
4545 (riscv_parse_prefixed_ext): and parameterise with
4546 riscv_parse_config.
4547 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
4548 (riscv_multi_letter_ext_valid_p): New.
4549 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
4550 (riscv_parse_subset): Delegate all non-single-letter parsing work
4551 to riscv_parse_prefixed_ext.
4552 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
4553 (riscv_get_prefix_class): Declare.
4554
a804e476
AM
45552020-01-22 Alan Modra <amodra@gmail.com>
4556
4557 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
4558 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
4559 __tls_get_addr_desc.
4560 (ppc64_elf_size_stubs): Add section for linker generated
4561 __tls_get_addr_desc wrapper function. Loop at least once if
4562 generating this function.
4563 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
4564 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
4565
9e7028aa
AM
45662020-01-22 Alan Modra <amodra@gmail.com>
4567
4568 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
4569 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
4570 tga_desc_fd.
4571 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
4572 (STDU_R1_0R1, ADDI_R1_R1): Define.
4573 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
4574 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
4575 tga_desc_fd to opt_fd, and tga_desc to opt. Set
4576 no_tls_get_addr_regsave.
4577 (branch_reloc_hash_match): Add hash3 and hash4.
4578 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
4579 (ppc64_elf_size_dynamic_sections): Likewise.
4580 (ppc64_elf_relocate_section): Likewise.
4581 (plt_stub_size, build_plt_stub): Likewise. Size regsave
4582 __tls_get_addr stub.
4583 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
4584 eh_frame.
4585 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
4586 eh_frame for regsave __tls_get_addr.
4587
abc489c6
AM
45882020-01-22 Alan Modra <amodra@gmail.com>
4589
4590 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
4591 which __tls_get_addr calls will be eliminated.
4592
26916852
NC
45932020-01-20 Nick Clifton <nickc@redhat.com>
4594
4595 * po/pt.po: Updates Portuguese translation.
4596 * po/ru.po: Updated Russian translation.
4597 * po/uk.po: Updated Ukranian translation.
4598
14470f07
L
45992020-01-20 H.J. Lu <hongjiu.lu@intel.com>
4600
4601 PR ld/25416
4602 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
4603 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
4604 X32 mode.
4605 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
4606 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
4607 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
4608 "rex leal x@tlsdesc(%rip), %reg" to
4609 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
4610 "call *(%eax)" to "nopl (%rax)".
4611
b9ca1af6
AM
46122020-01-20 Alan Modra <amodra@gmail.com>
4613
4614 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
4615 (MTLR_R11): Don't define.
4616 (LD_R0_0R3, CMPDI_R0_0): Define.
4617 (build_tls_get_addr_stub): Don't use r11 in stub.
4618
ed7007c1
AM
46192020-01-20 Alan Modra <amodra@gmail.com>
4620
4621 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
4622 (defined_sym_val, is_tls_get_addr): Likewise.
4623
1b1bb2c6
NC
46242020-01-18 Nick Clifton <nickc@redhat.com>
4625
4626 * version.m4 (BFD_VERSION): Set to 2.34.50.
4627 * configure: Regenerate.
4628 * po/bfd.pot: Regenerate.
4629
ae774686
NC
46302020-01-18 Nick Clifton <nickc@redhat.com>
4631
4632 Binutils 2.34 branch created.
4633
07f1f3aa
CB
46342020-01-17 Christian Biesinger <cbiesinger@google.com>
4635
4636 * coff-arm.c: Fix spelling error (seperate).
4637 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
4638 error (seperate).
4639 * sysdep.h (strnlen): Fix spelling error (seperate).
4640
0d1cc75d
LB
46412020-01-15 Lars Brinkhoff <lars@nocrew.org>
4642
4643 PR 20694
4644 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
4645
e1c6cf61
AM
46462020-01-15 Alan Modra <amodra@gmail.com>
4647
4648 PR 25384
4649 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
4650 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
4651 of function symbols unless dot symbols are present. Do warn
4652 whenever one is created, regardles of whether a PLT entry is
4653 also emitted for the function symbol.
4654
ef4e5ba5
AM
46552020-01-14 Alan Modra <amodra@gmail.com>
4656
4657 * som.c (som_bfd_count_ar_symbols): Error when file position
4658 of symbols on chains is not strictly increasing.
4659
8ab484c2
AM
46602020-01-14 Alan Modra <amodra@gmail.com>
4661
4662 * vms.h (VMS_DEBUG): Define as 0.
4663 * vms-alpha.c (image_write): Move debug output after bounds check.
4664 Tidy bounds check.
4665 (_bfd_vms_slurp_eihd): Warning fix.
4666 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
4667
b50ef514
AM
46682020-01-13 Alan Modra <amodra@gmail.com>
4669
4670 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
4671 for "ignored" records.
4672
0c0adcc5
AM
46732020-01-13 Alan Modra <amodra@gmail.com>
4674
4675 * wasm-module.c (wasm_scan_name_function_section): Formatting.
4676 Delete asect name check. Move asect NULL check to wasm_object_p.
4677 Correct bounds check of sizes against end. Replace uses of
4678 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
4679 just one bfd_release.
4680 (wasm_scan): Don't use malloc/strdup for section names,
4681 bfd_alloc instead. Simplify code prefixing section name.
4682 Formatting. Don't attempt to free memory here..
4683 (wasm_object_p): ..do so here.
4684
7f026732
SN
46852020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
4686
4687 PR ld/22269
4688 * elf32-arm.c (elf32_arm_final_link_relocate): Use
4689 UNDEFWEAK_NO_DYNAMIC_RELOC.
4690 (allocate_dynrelocs_for_symbol): Likewise.
4691
8cd0e5e9
TC
46922020-01-10 Tamar Christina <tamar.christina@arm.com>
4693
4694 PR 25210
4695 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
4696
71780f45
AM
46972020-01-10 Alan Modra <amodra@gmail.com>
4698
4699 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
4700
b899eb3b
NC
47012020-01-09 Nick Clifton <nickc@redhat.com>
4702
4703 PR 25221
4704 * bfd.c (bfd_convert_section_contents): Check for a compress
4705 header size that is larger than the actual section size.
4706
4c6ee646
AM
47072020-01-08 Alan Modra <amodra@gmail.com>
4708
4709 PR 25351
4710 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
4711 after removing sections.
4712
85f78364
JW
47132020-01-06 Jim Wilson <jimw@sifive.com>
4714
4715 PR 25205
4716 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
4717 check for !bfd_link_pic (info).
4718 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
4719 <R_RISCV_JAL>: Add comment.
4720 (_bfd_riscv_relax_section): For plt.offset check, add check for
4721 bfd_link_pic (info). Add comment.
4722
49078ece
AM
47232020-01-06 Alan Modra <amodra@gmail.com>
4724
4725 * format.c (bfd_check_format_matches): Ignore bfd_error on target
4726 match failures. Don't init to bfd_error_wrong_format before
4727 calling _bfd_check_format.
4728
ab356be7
AM
47292020-01-06 Alan Modra <amodra@gmail.com>
4730
4731 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
4732 status rather than exiting on stack overflow or underflow.
4733 (_bfd_vms_slurp_etir): Adjust to suit.
4734
85d86817
AM
47352020-01-06 Alan Modra <amodra@gmail.com>
4736
4737 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
4738
3e6aa775
AM
47392020-01-06 Alan Modra <amodra@gmail.com>
4740
4741 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
4742 command. Check name offset is within command.
4743 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
4744 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
4745 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
4746 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
4747 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
4748 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
4749 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
4750 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
4751 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
4752 (bfd_mach_o_read_segment): Similarly.
4753 (bfd_mach_o_read_thread): Properly bound check thread struct.
4754 Don't repeat checks on second loop.
4755 (bfd_mach_o_read_command): Fail on invalid command length.
4756
ea933f17
AM
47572020-01-04 Alan Modra <amodra@gmail.com>
4758
4759 * format.c (bfd_check_format_matches): Add preserve_match.
4760 Save initial bfd state in "preserve", matched bfd state in
4761 "preserve_match". Save just the first match. Release
4762 bfd_alloc memory. Restore and finish preserved state as
4763 appropriate on all function exit paths.
4764
f24bdec4
AM
47652020-01-04 Alan Modra <amodra@gmail.com>
4766
4767 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
4768
991fb595
AM
47692020-01-04 Alan Modra <amodra@gmail.com>
4770
4771 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
4772 match too.
4773
f2a3559d
NC
47742020-01-03 Nick Clifton <nickc@redhat.com>
4775
4776 PR 25307
4777 (bfd_pef_parse_function_stubs): Correct the test that ensures that
4778 there is enough data remaining in the code buffer before
4779 attempting to read a function stub.
4780
7a0fb7be
NC
47812020-01-03 Nick Clifton <nickc@redhat.com>
4782
4783 PR 25308
4784 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
4785 return value from bfd_malloc.
4786 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
4787 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
4788 (elf32_arm_filter_cmse_symbols): Likewise.
4789 (elf32_arm_write_section): Likewise.
4790 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
4791 (bfd_mach_o_follow_dsym): Likewise.
4792 * pef.c (bfd_pef_print_loader_section): Likewise.
4793 (bfd_pef_scan_start_address): Likewise.
4794 (bfd_pef_parse_function_stubs): Likewise.
4795 (bfd_pef_parse_symbols): Likewise.
4796
b26a3d58
ST
47972020-01-03 Sergei Trofimovich <siarheit@google.com>
4798
4799 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
4800 on binary inputs ld/PR25316.
4801 (is_ia64_elf): new helper to filter on ia64 objects.
4802
4bb7a87e
JB
48032020-01-03 Jan Beulich <jbeulich@suse.com>
4804
4805 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
4806 in parameter names.
4807 (bfd_mach_o_scan): Insert underscore in two variable names.
4808
6655dba2
SB
48092020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
4810
4811 * Makefile.am: Add z80-elf target support.
4812 * configure.ac: Likewise.
4813 * targets.c: Likewise.
4814 * Makefile.in: Regenerate.
4815 * configure: Regenerate.
4816 * config.bfd: Add z80-elf target support and new arches: ez80 and
4817 z180.
4818 * elf32-z80.c: New file.
4819 * archures.c: Add new z80 architectures: eZ80 and Z180.
4820 * coffcode.h: Likewise.
4821 * cpu-z80.c: Likewise.
4822 * coff-z80.c: Add new relocations for Z80 target and local label
4823 check.
4824 * reloc.c: Add new relocs.
4825 * bfd-in2.h: Regenerate.
4826 * libbfd.h: Regenerate.
4827
0db131fb
TC
48282020-01-02 Tamar Christina <tamar.christina@arm.com>
4829
4830 PR 25210
4831 PR 24753
4832 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
4833
b14ce8bf
AM
48342020-01-01 Alan Modra <amodra@gmail.com>
4835
4836 Update year range in copyright notice of all files.
4837
0b114740 4838For older changes see ChangeLog-2019
3499769a 4839\f
0b114740 4840Copyright (C) 2020 Free Software Foundation, Inc.
3499769a
AM
4841
4842Copying and distribution of this file, with or without modification,
4843are permitted in any medium without royalty provided the copyright
4844notice and this notice are preserved.
4845
4846Local Variables:
4847mode: change-log
4848left-margin: 8
4849fill-column: 74
4850version-control: never
4851End:
This page took 0.501268 seconds and 4 git commands to generate.