Automatic date update in version.in
[deliverable/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
27456742
AK
12020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
2
3 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
4 * elf.c (elfcore_grok_arc_v2): New function.
5 (elfcore_grok_note): Call the new function to handle the corresponding
6 note.
7 (elfcore_write_arc_v2): New function.
8 (elfcore_write_register_note): Call the new function to handle the
9 corresponding pseudo-sections.
10
30ce8e47
MF
112020-04-22 Max Filippov <jcmvbkbc@gmail.com>
12
13 PR ld/25861
14 * bfd-in2.h: Regenerated.
15 * elf32-xtensa.c (elf_howto_table): New entries for
16 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
17 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
18 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
19 R_XTENSA_NDIFF{8,16,32}.
20 * libbfd.h (bfd_reloc_code_real_names): Add names for
21 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
22 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
23 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
24 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
25
c36876fe
TC
262020-04-21 Tamar Christina <tamar.christina@arm.com>
27
28 PR binutils/24753
29 * compress.c (bfd_get_full_section_contents): Exclude sections with no
30 content.
31
6f6fd151
L
322020-04-21 H.J. Lu <hongjiu.lu@intel.com>
33
34 PR ld/25849
35 * elf-bfd.h (elf_backend_data): Add
36 elf_backend_strip_zero_sized_dynamic_sections.
37 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
38 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
39 New macro.
40 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
41 function.
42 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
43 New macro.
44 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
45
1f7f2abb
L
462020-04-21 H.J. Lu <hongjiu.lu@intel.com>
47
48 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
49 sec.
50 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
51 DT_TEXTREL with -M.
52 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
53
e04f33c0
NC
542020-04-21 Nick Clifton <nickc@redhat.com>
55
56 * po/sr.po: Updated Serbian translation.
57
fad3d2c1
AM
582020-04-21 Alan Modra <amodra@gmail.com>
59
60 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
61 processing.
62
23c8270e
SC
632020-04-20 Stephen Casner <casner@acm.org>
64
65 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
66 causing globals from linker script to be treated as debug symbols.
67 (translate_symbol_table): Don't sign-extend symbol values from 16
68 to 64 bits in nm output.
69
2efec98b
AM
702020-04-20 Alan Modra <amodra@gmail.com>
71
72 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
73
18f97353
AM
742020-04-18 Alan Modra <amodra@gmail.com>
75
76 * section.c (bfd_is_const_section): Correct test for special
77 sections.
78 * bfd-in2.h: Regenerate.
79
8d55d10a
AM
802020-04-17 Alan Modra <amodra@gmail.com>
81
82 PR 25842
83 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
84 NULL nodename.
85
8e4979ac
NC
862020-04-16 Nick Clifton <nickc@redhat.com>
87
88 PR 25803
89 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
90 abort with a more helpful error message.
91
aec72fda
AM
922020-04-16 Alan Modra <amodra@gmail.com>
93
94 PR 25827
95 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
96 strdup(0).
97
95a51568
FS
982020-04-15 Fangrui Song <maskray@google.com>
99
100 PR binutils/24613
101 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
102 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
103 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
104 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
105 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
106 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
107 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
108 * elf32-sh.c (sh_elf_relocate_section): Likewise.
109 * elf32-spu.c (spu_elf_relocate_section): Likewise.
110 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
111 * elflink.c (elf_link_output_extsym): Likewise.
112 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
113
7ecb5154
AM
1142020-04-15 Alan Modra <amodra@gmail.com>
115
116 PR 25823
117 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
118 pointer into strings that may be freed for section name, always
119 allocate a new string.
120
f717994f
JMG
1212020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
122 Jan W. Jagersma <jwjagersma@gmail.com>
123
124 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
125 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
126 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
127 (_bfd_go32_mkobject): New functions.
128 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
129 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
130 (go32exe_mkobject): Call _bfd_go32_mkobject.
131 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
132 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
133 and COFF_GO32.
134 (coff_write_relocs): Enable extended reloc counter code if
135 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
136 (coff_write_object_contents): Likewise. Pad section headers
137 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
138 instead of coff_swap_scnhdr_out.
139 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
140 enable extended reloc counter.
141 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
142 Declare with ATTRIBUTE_UNUSED.
143 * libcoff-in.h: (struct coff_tdata): New field go32.
144 (obj_go32): Define.
145 * libcoff.h: Regenerate.
146
34ca5531
FS
1472020-04-14 Fangrui Song <maskray@google.com>
148
149 PR gas/25768
150 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
151 12.
152
fa1477dc
SC
1532020-04-14 Stephen Casner <casner@acm.org>
154
155 PR ld/25677
156 * pdp11.c: Add implementation of --imagic option.
157 (adjust_o_magic): Fix objcopy --extract-symbol test.
158 * libaout.h (enum aout_magic): Add i_magic.
159
a0543b0b
RO
1602020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
161 Nick Clifton <nickc@redhat.com>
162
163 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
164 <0>: Ignore.
165 <default>: Error rather than abort.
166
3349112e
L
1672020-04-03 H.J. Lu <hongjiu.lu@intel.com>
168
169 PR ld/25767
170 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
171 relocation section from section group.
172
4d095f5b
JJ
1732020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
174
175 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
176 bfd->origin to file offset.
177 * bfdwin.c (bfd_get_file_window): Likewise.
178 * bfd.c: Clarify the use of the bfd->origin field.
179 * bfd-in2.h: Regenerate.
180 * coff-i386.c: Don't include go32exe.h. Allow overriding
181 coff_write_object_contents via COFF_WRITE_CONTENTS.
182 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
183 (go32exe_write_object_contents): New functions.
184 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
185 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
186 (create_go32_stub): Remove check for 2k size limit. Read stub
187 from go32exe_temp_stub if present.
188 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
189 copy variable-length stub.
190 (go32_check_format): Read stub to go32exe_temp_stub, set
191 origin, return go32exe_cleanup.
192 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
193 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
194 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
195 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
196 Remove functions and their associated #defines.
197 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
198 * libcoff-in.h: (struct coff_tdata): New field stub_size.
199 Rename field go32stub to stub.
200 * libcoff.h: Regenerate.
201 * coff-stgo32.c (go32_check_format): Rename to...
202 (go32exe_check_format): ...this.
203 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
204 (go32exe_copy_private_bfd_data): ...this.
205 (stub_bytes): Rename to...
206 (go32exe_default_stub): ...this.
207 (create_go32_stub): Rename to...
208 (go32exe_create_stub): ...this.
209 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
210 when possible.
211
382aae06
L
2122020-04-01 H.J. Lu <hongjiu.lu@intel.com>
213
214 PR ld/25749
215 PR ld/25754
216 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
217 relocation to R_386_32 for relocation against non-preemptible
218 absolute symbol.
219 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
220 allocate dynamic relocation for non-preemptible absolute symbol.
221 (elf_i386_relocate_section): Pass sec to
222 GENERATE_DYNAMIC_RELOCATION_P.
223 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
224 (elf_x86_64_convert_load_reloc): Covert load relocation to
225 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
226 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
227 for non-preemptible absolute symbol if they overflow.
228 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
229 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
230 symbol. Don't allocate dynamic relocation for non-preemptible
231 absolute symbol.
232 (elf_x86_64_relocate_section): Don't generate relative relocation
233 for GOTPCREL relocations aganst local absolute symbol. Pass sec
234 to GENERATE_DYNAMIC_RELOCATION_P.
235 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
236 against non-preemptible absolute symbol.
237 (_bfd_elf_x86_valid_reloc_p): New function.
238 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
239 GOT_ABS GOT slot.
240 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
241 argument. Don't generate dynamic relocation against
242 non-preemptible absolute symbol.
243 (ABS_SYMBOL_P): New.
244 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
245 against non-preemptible absolute symbol.
246 (GOT_ABS): New.
247 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
248 (_bfd_elf_x86_valid_reloc_p): New.
249
a7618269
TC
2502020-04-01 Tamar Christina <tamar.christina@arm.com>
251
252 PR ld/16017
253 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
254 address in the GOT if in thumb only mode.
255
15ccbdd7
TC
2562020-04-01 Tamar Christina <tamar.christina@arm.com>
257
258 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
259
7b948a25
HPN
2602020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
261
262 * mmo.c (mmo_scan): Create .text section only when needed, not
263 from the start.
264
89b599df
AM
2652020-03-31 Alan Modra <amodra@gmail.com>
266
267 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
268 return value check.
269
81699544
AM
2702020-03-31 Alan Modra <amodra@gmail.com>
271
272 * vms-alpha.c (image_write): Check bounds for sections without
273 contents too. Error on non-zero write to section without
274 contents.
275 (_bfd_vms_slurp_etir): Check return of image_write* functions.
276
b3b360de
AM
2772020-03-31 Alan Modra <amodra@gmail.com>
278
279 * tekhex.c (pass_over): Check is_eof before reading buffer.
280
00386881
NC
2812020-03-30 Nick Clifton <nickc@redhat.com>
282
283 PR binutils/pr25662
284 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
285 field to timestamp and make it an integer.
286 * libcoff.h: Regenerate.
287 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
288 field in the pe_data structure rather than the insert_timestamp
289 field.
290
988b7300
AM
2912020-03-30 Alan Modra <amodra@gmail.com>
292
293 PR 25745
294 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
295 statistics message.
296
aa49fc22
NC
2972020-03-26 Nick Clifton <nickc@redhat.com>
298
299 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
300 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
301 prototype.
302 * libbfd.h: Regenerate.
303
ff768510
AM
3042020-03-26 Alan Modra <amodra@gmail.com>
305
306 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
307
f75fbe8a
AM
3082020-03-26 Alan Modra <amodra@gmail.com>
309
310 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
311 array.
312 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
313
aac88046
NC
3142020-03-25 Nick Clifton <nickc@redhat.com>
315
316 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
317 function.
318 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
319 * libbfd.h: Regenerate.
320
cf2611fe
SV
3212020-03-25 Shahab Vahedi <shahab@synopsys.com>
322
323 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
324 correct field name in the output string.
325
d16e3d2e
AM
3262020-03-25 Alan Modra <amodra@gmail.com>
327
328 PR 25662
329 * elf.c (assign_file_positions_for_load_sections): Adjust offset
330 for SHT_NOBITS section if first in segment.
331
1081065c
L
3322020-03-24 H.J. Lu <hongjiu.lu@intel.com>
333
334 PR binutils/25708
335 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
336 (_bfd_elf_get_symbol_version_string): This.
337 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
338 (_bfd_elf_get_symbol_version_string): This.
339 (bfd_elf_print_symbol): Pass TRUE to
340 _bfd_elf_get_symbol_version_string.
341 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
342 bfd_boolean argument.
343 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
344 * targets.c (_bfd_get_symbol_version_string): Likewise.
345 (bfd_get_symbol_version_string): Likewise.
346 * bfd-in2.h: Regenerated.
347
0b8448af 3482020-03-24 Nick Clifton <nickc@redhat.com>
e11cd7c4 349 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
0b8448af
NC
350
351 PR 25713
352 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
353 Win32 systems.
354
ec2e748a
NC
3552020-03-24 Nick Clifton <nickc@redhat.com>
356
357 PR 25681
358 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
359 segment to use for PT_GNU_RELRO, ignore empty sections in a
360 segment's current list.
361
cda7e560
L
3622020-03-24 H.J. Lu <hongjiu.lu@intel.com>
363
364 PR binutils/25717
365 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
366
7e6e972f
L
3672020-03-24 H.J. Lu <hongjiu.lu@intel.com>
368
369 PR binutils/25708
370 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
371 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
372 on the previous _bfd_elf_get_symbol_version_string.
373 (_bfd_elf_get_symbol_version_string): Use it.
374
65109548
AM
3752020-03-24 Alan Modra <amodra@gmail.com>
376
377 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
378 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
379 struct areltdata.
380
fdde2fb6
SH
3812020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
382
383 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
384
cf28cfef
AM
3852020-03-23 Alan Modra <amodra@gmail.com>
386
387 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
388 symbol count. Allocate an extra byte to ensure name strings
389 are terminated. Sanity check name offsets. Release memory on
390 error return.
391
5e737279
AM
3922020-03-23 Alan Modra <amodra@gmail.com>
393
394 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
395 field hasn't been read. Remove unnecessary casts.
396
c15a8f17
AM
3972020-03-22 Alan Modra <amodra@gmail.com>
398
399 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
400 enough to read number of symbols.
401
3d98c460
L
4022020-03-20 H.J. Lu <hongjiu.lu@intel.com>
403
404 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
405 (EXECUTABLE_SUFFIX): Likewise.
406 * config.in: Regenerated.
407 * configure: Likewise.
408 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
409 _bfd_generic_close_and_cleanup.
410 (plugin_list_entry): Remove resolution_file, resolution_option,
411 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
412 lto_wrapper, gcc_env and initialized,
413 (need_lto_wrapper_p): Removed.
414 (get_lto_wrapper): Likewise.
415 (setup_lto_wrapper_env): Likewise.
416 (register_all_symbols_read): Likewise.
417 (egister_cleanup): Likewise.
418 (get_symbols): Likewise.
419 (add_input_file): Likewise.
420 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
421 (add_symbols): Updated.
422 (try_claim): Likewise.
423 (try_load_plugin): Likewise.
424 (bfd_plugin_canonicalize_symtab): Likewise.
425 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
426 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
427
c3a1714c
L
4282020-03-19 H.J. Lu <hongjiu.lu@intel.com>
429
430 PR binutils/25640
431 * plugin.c (plugin_list_entry): Add has_symbol_type.
432 (add_symbols_v2): New function.
433 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
434 provides symbol type.
435 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
436 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
437 available.
438
67338173
AM
4392020-03-20 Alan Modra <amodra@gmail.com>
440
441 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
442 enough to read number of symbols.
443
a859124d
AM
4442020-03-20 Alan Modra <amodra@gmail.com>
445
446 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
447 backend functions for NULL before calling.
448 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
449 (bfd_section_from_shdr, assign_section_numbers): Likewise.
450 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
451 * elfnn-ia64.c (ignore_errors): New function.
452 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
453
f3a08f77
NC
4542020-03-19 Nick Clifton <nickc@redhat.com>
455
456 PR 25676
457 * dwarf2.c (struct varinfo): Add unit_offset field to record the
458 location of the varinfo in the unit's debug info data. Change the
459 type of the stack field to a boolean.
460 (lookup_var_by_offset): New function. Returns the varinfo
461 structure for the variable described at the given offset in the
462 unit's debug info.
463 (scan_unit_for_symbols): Add support for variables which have the
464 DW_AT_specification attribute.
465
6a541707
NC
4662020-03-19 Nick Clifton <nickc@redhat.com>
467
468 PR 25699
469 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
470 error return.
471
effc14f5
SH
4722020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
473
474 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
475
ac4bf06c
NC
4762020-03-18 Nick Clifton <nickc@redhat.com>
477
478 PR 25673
479 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
480 memory access when processing a corrupt secondary reloc section.
481
53215f21
CL
4822020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
483
484 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
485 instead of calling abort.
486 * elf32-csky.c (csky_build_one_stub): Likewise.
487 * elf32-hppa.c (hppa_build_one_stub): Likewise.
488 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
489 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
490 * elf32-metag.c (metag_build_one_stub): Likewise.
491 * elf32-nios2.c (nios2_build_one_stub): Likewise.
492 * elf64-ppc.c (ppc_build_one_stub): Likewise.
493 (ppc_size_one_stub): Likewise.
494 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
495
327ef784
NC
4962020-03-17 Nick Clifton <nickc@redhat.com>
497
d3c3c542 498 PR 25688
327ef784
NC
499 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
500 with error messages.
501
ecbbbdba
NC
5022020-03-17 Nick Clifton <nickc@redhat.com>
503
504 PR 25687
505 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
506 free. Add free on another failure path.
507
4b3ecb3b
AM
5082020-03-16 Alan Modra <amodra@gmail.com>
509
510 PR 25675
511 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
512 we have a non-zero section count. Do lma comparison in octets.
513
7bac4137
AM
5142020-03-16 Alan Modra <amodra@gmail.com>
515
516 * vms-alpha.c (dst_restore_location): Validate index into
517 dst_ptr_offsets array before accessing. Return status.
518 (dst_retrieve_location): Similarly, making "loc" parameter a
519 pointer to return value.
520 (_bfd_vms_slurp_etir): Update calls to above functions.
521
8b5d0a4f
KR
5222020-03-14 Kamil Rytarowski <n54@gmx.com>
523
524 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
525 targets.
526 * configure: Regenerated.
527
48e81d7f
AM
5282020-03-14 Alan Modra <amodra@gmail.com>
529
530 * section.c (BFD_FAKE_SECTIONS): Formatting.
531 * bfd-in2.h: Regenerate.
532
06d949ec
KR
5332020-03-13 Kamil Rytarowski <n54@gmx.com>
534
535 * elf.c (elfcore_grok_netbsd_note): Add support for
536 NT_NETBSDCORE_LWPSTATUS notes.
537
abf874aa
CL
5382020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
539
540 * bfd-in2.h: Regenerate.
541 * section.c (asection): Add already_assigned field.
542 (BFD_FAKE_SECTION): Add default initializer for it.
543 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
544 * elf32-arm.c (arm_build_one_stub): Add support for
545 non_contiguous_regions.
546 * elf32-csky.c (csky_build_one_stub): Likewise.
547 * elf32-hppa.c (hppa_build_one_stub): Likewise.
548 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
549 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
550 * elf32-metag.c (metag_build_one_stub): Likewise.
551 * elf32-nios2.c (nios2_build_one_stub): Likewise.
552 * elf64-ppc.c (ppc_build_one_stub): Likewise.
553 (ppc_size_one_stub): Likewise.
554 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
555 * elflink.c (elf_link_input_bfd): Likewise.
556
74e10d17
L
5572020-03-13 H.J. Lu <hongjiu.lu@intel.com>
558
559 PR ld/24920
560 * elf-linker-x86.h (elf_linker_x86_params): Add
561 static_before_all_inputs and has_dynamic_linker.
562 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
563 dynamic input objects if -static is passed at command-line
564 before all input files without --dynamic-linker unless
565 --no-dynamic-linker is used.
566
015ec493
KR
5672020-03-13 Kamil Rytarowski <n54@gmx.com>
568
569 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
570
66631823
CE
5712020-03-13 Christian Eggers <ceggers@gmx.de>
572
573 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
574 "p_paddr" from "at".
575 * elfcode.h (bfd_from_remote_memory): Add units to several
576 parameters. New local "opb". Fix usage of p_align. Fix
577 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
578 call of target_read_memory.
579 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
580 calculation of "offset" and "output_offset".
581 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
582 from "offset" and fix calculation of "end" from "vma+size". Fix
583 comparison between "sh_addr" and "vma"/"output_offset".
584 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
585 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
586 member.
587 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
588 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
589 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
590 assignment of p_paddr from phdr_lma. Fix comparison between
591 "lma+size" and "next->lma".
592 (elf_sort_segments): Fix assignment from p_paddr to lma.
593 (assign_file_positions_for_load_sections): Add unit (bytes) to
594 local "align". Fix calculation of local "off_adjust". Fix
595 calculation of local "filehdr_vaddr".
596 (assign_file_positions_for_non_load_sections): New local "opb".
597 Fix calculation of "end" from "p_size". Fix comparison between
598 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
599 from "end" and "p_vaddr".
600 (rewrite_elf_program_header): Fix comparison between p_vaddr and
601 vma. Fix assignment to p_paddr from lma. Fix comparison between
602 p_paddr and lma. Fix assignment to p_paddr from lma.
603 * merge.c (sec_merge_emit): New local "opb". Convert
604 "alignment_power" to octets.
605 (_bfd_add_merge_section): New locals "alignment_power" and
606 "opb". Fix comparison between "alignment_power" and
607 "sizeof(align)".
608 (_bfd_merge_sections): New local "opb". Divide size by opb
609 before checking align mask.
610
502794d4
CE
6112020-03-13 Christian Eggers <ceggers@gmx.de>
612
613 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
614 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
615 section LMA/VMA.
616 (_bfd_elf_make_section_from_phdr): Similarly.
617 (elf_fake_sections): Fix calculation of
618 Elf_Internal_shdr::sh_addr from section VMA.
619 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
620 and bytes.
621 (assign_file_positions_for_load_sections): Fix calculations of
622 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
623 comparison between program header address and section LMA.
624 (assign_file_positions_for_non_load_sections): Likewise.
625 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
626 (IS_CONTAINED_BY_VMA): Add parameter opb.
627 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
628 INCLUDE_SECTION_IN_SEGMENT): Likewise.
629 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
630 Fix calculations of p_addr_valid and p_vaddr_offset.
631 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
632 with octets per byte when comparing against p_vaddr.
633
8248d21a
AM
6342020-03-11 Alan Modra <amodra@gmail.com>
635
636 * som.c (setup_sections): Sanity check subspace.name.
637
435edf0b
AM
6382020-03-11 Alan Modra <amodra@gmail.com>
639
640 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
641
6b5e16ff
AM
6422020-03-10 Alan Modra <amodra@gmail.com>
643
644 PR 25648
645 * ihex.c (ihex_write_object_contents): Don't assume ordering of
646 addresses here.
647
2f57795b
AM
6482020-03-09 Alan Modra <amodra@gmail.com>
649
650 * wasm-module.c (wasm_scan): Sanity check file name length
651 before allocating memory. Move common section setup code. Do
652 without bfd_tell to calculate section size.
653
a0dcf297
NC
6542020-03-06 Nick Clifton <nickc@redhat.com>
655
656 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
657 with error messages and failure return values.
658
e15a8da9
MF
6592020-03-05 Max Filippov <jcmvbkbc@gmail.com>
660
661 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
662 relocation sections for any removed reference to a dynamic symbol.
663
a8e14f4c
NC
6642020-03-05 Nick Clifton <nickc@redhat.com>
665
666 * elf-bfd.h (struct elf_backend_data): Add new fields:
667 init_secondary_reloc_section, slurp_secondary_reloc_section,
668 write_secondary_reloc_section.
669 (_bfd_elf_init_secondary_reloc_section): Prototype.
670 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
671 (_bfd_elf_write_secondary_reloc_section): Prototype.
672 * elf.c ( bfd_section_from_shdr): Invoke the new
673 init_secondary_reloc_section backend function, if defined, when a
674 second reloc section is encountered.
675 (swap_out_syms): Invoke the new symbol_section_index function, if
676 defined, when computing the section index of an OS/PROC specific
677 symbol.
678 (_bfd_elf_init_secondary_reloc_section): New function.
679 (_bfd_elf_slurp_secondary_reloc_section): New function.
680 (_bfd_elf_write_secondary_reloc_section): New function.
681 (_bfd_elf_copy_special_section_fields): New function.
682 * elfcode.h (elf_write_relocs): Invoke the new
683 write_secondary_relocs function, if defined, in order to emit
684 secondary relocs.
685 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
686 function, if defined, in order to read in secondary relocs.
687 * elfxx-target.h (elf_backend_copy_special_section_fields):
688 Provide a non-NULL default definition.
689 (elf_backend_init_secondary_reloc_section): Likewise.
690 (elf_backend_slurp_secondary_reloc_section): Likewise.
691 (elf_backend_write_secondary_reloc_section): Likewise.
692 (struct elf_backend_data elfNN_bed): Add initialisers for the new
693 fields.
694 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
695 * configure: Regenerate.
696
6f8f95b4
AM
6972020-03-05 Alan Modra <amodra@gmail.com>
698
699 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
700 against file size before allocating memory. Use bfd_alloc rather
701 than bfd_zalloc for carsym/strings memory.
702
233bf4f8
AM
7032020-03-04 Alan Modra <amodra@gmail.com>
704
705 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
706 sh_addr mod sh_addalign is zero.
707
1039fd9a
AM
7082020-03-04 Alan Modra <amodra@gmail.com>
709
710 * format.c (bfd_check_format_matches): Call cleanup on error exit.
711
f5714099
AM
7122020-03-03 Alan Modra <amodra@gmail.com>
713
714 * format.c (struct bfd_preserve): Add cleanup field.
715 (bfd_preserve_save): Add cleanup param and save.
716 (bfd_preserve_restore): Return cleanup.
717 (bfd_preserve_finish): Call the cleanup for the discarded match.
718 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
719 and clear when preserving a match. Restore cleanup too when
720 restoring that match.
721
40b35c78
AM
7222020-03-02 Alan Modra <amodra@gmail.com>
723
724 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
725 * hpux-core.c (hpux_core_core_file_p): Update prototype.
726 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
727 (core_sco5_vec): Correct initialisers.
728
601b73d5
AM
7292020-03-02 Alan Modra <amodra@gmail.com>
730
731 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
732 * aix5ppc-core.c (xcoff64_core_p): Likewise.
733 * cisco-core.c (cisco_core_file_validate): Likewise.
734 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
735 * hpux-core.c (hpux_core_core_file_p): Likewise.
736 * irix-core.c (irix_core_core_file_p): Likewise.
737 * lynx-core.c (lynx_core_file_p): Likewise.
738 * netbsd-core.c (netbsd_core_file_p): Likewise.
739 * osf-core.c (osf_core_core_file_p): Likewise.
740 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
741 * sco5-core.c (sco5_core_file_p): Likewise.
742
728d32c4
L
7432020-03-02 H.J. Lu <hongjiu.lu@intel.com>
744
745 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
746
cb001c0d
AM
7472020-03-02 Alan Modra <amodra@gmail.com>
748
749 * targets.c (bfd_cleanup): New typedef.
750 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
751 * libbfd-in.h (_bfd_no_cleanup): Define.
752 * format.c (bfd_reinit): Add cleanup parameter, call it.
753 (bfd_check_format_matches): Set cleanup from _bfd_check_format
754 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
755 * aout-target.h (callback, object_p): Return bfd_cleanup.
756 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
757 * archive.c (bfd_generic_archive_p): Likewise.
758 * binary.c (binary_object_p): Likewise.
759 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
760 * coff-ia64.c (ia64coff_object_p): Likewise.
761 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
762 * coff-sh.c (coff_small_object_p): Likewise.
763 * coff-stgo32.c (go32_check_format): Likewise.
764 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
765 (xcoff64_core_p): Likewise.
766 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
767 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
768 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
769 * elfcode.h (elf_object_p): Likewise.
770 * elfcore.h (elf_core_file_p): Likewise.
771 * i386msdos.c (msdos_object_p): Likewise.
772 * ihex.c (ihex_object_p): Likewise.
773 * libaout.h (some_aout_object_p): Likewise.
774 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
775 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
776 * libbfd.c (_bfd_dummy_target): Likewise.
777 * libcoff-in.h (coff_object_p): Likewise.
778 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
779 (bfd_mach_o_arm64_core_p): Likewise.
780 * mach-o-arm.c (bfd_mach_o_arm_object_p),
781 (bfd_mach_o_arm_core_p): Likewise.
782 * mach-o-i386.c (bfd_mach_o_i386_object_p),
783 (bfd_mach_o_i386_core_p): Likewise.
784 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
785 (bfd_mach_o_x86_64_core_p): Likewise.
786 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
787 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
788 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
789 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
790 * mmo.c (mmo_object_p): Likewise.
791 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
792 * peicode.h (coff_real_object_p, pe_ILF_object_p),
793 (pe_bfd_object_p): Likewise.
794 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
795 * ppcboot.c (ppcboot_object_p): Likewise.
796 * rs6000-core.c (rs6000coff_core_p): Likewise.
797 * som.c (som_object_setup, som_object_p): Likewise.
798 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
799 * tekhex.c (tekhex_object_p): Likewise.
800 * vms-alpha.c (alpha_vms_object_p): Likewise.
801 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
802 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
803 * wasm-module.c (wasm_object_p): Likewise.
804 * xsym.c (bfd_sym_object_p): Likewise.
805 * xsym.h (bfd_sym_object_p): Likewise.
806 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
807 return type.
808 * pdp11.c (some_aout_object_p): Likewise.
809 * plugin.c (register_ld_plugin_object_p): Update object_p
810 parameter type.
811 * plugin.h (register_ld_plugin_object_p): Likewise.
812 * bfd-in2.h: Regenerate.
813 * libbfd.h: Regenerate.
814 * libcoff.h: Regenerate.
815
a4dd6c97
AM
8162020-03-02 Alan Modra <amodra@gmail.com>
817
818 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
819 applicable section flags.
820 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
821 (mips_ecoff_bele_vec): Likewise.
822 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
823 and .sbss sections.
824 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
825 (_bfd_ecoff_styp_to_sec_flags): Likewise.
826
bf577467
AM
8272020-03-02 Alan Modra <amodra@gmail.com>
828
829 * elf32-m32r.c (m32r_elf_section_flags): New function.
830 (elf_backend_section_flags): Define.
831 * elf32-nds32.c (nds32_elf_section_flags): New function.
832 (elf_backend_section_flags): Define.
833 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
834 .sbss and .sdata sections.
835 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
836 for SHF_V850_GPREL sections.
837 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
838 FIXME.
839 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
840 for SHF_PARISC_SHORT sections.
841 * elf64-ppc.c (ppc64_elf_section_flags): New function.
842 (elf_backend_section_flags): Define.
843 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
844 for SHF_MIPS_GPREL sections. Delete FIXME.
845
8c803a2d
AM
8462020-03-02 Alan Modra <amodra@gmail.com>
847
848 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
849 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
850 calling elf_backend_section_flags with adjusted params. Use
851 newsect->flags past that point.
852 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
853 special sections.
854 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
855 to have their type overridden, and all sh_flags but processor and
856 os specific.
857 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
858 * elf32-mep.c (mep_elf_section_flags): Likewise.
859 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
860 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
861 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
862 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
863 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
864 stub BFD and non-aarch64 input files when scanning for stubs.
865
7d4b2d2d
AM
8662020-03-02 Alan Modra <amodra@gmail.com>
867
868 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
869 limit to decompressed element size.
870
26f60d59
AM
8712020-03-02 Alan Modra <amodra@gmail.com>
872
873 * vms-lib.c (vms_traverse_index): Add recur_count param and
874 update calls. Fail on excessive recursion.
875
9cb56943
AM
8762020-03-02 Alan Modra <amodra@gmail.com>
877
878 * vms-alpha.c (vms_get_remaining_object_record): Use
879 bfd_realloc_or_free rather than bfd_realloc.
880 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
881 (dst_define_location, parse_module): Likewise, and check realloc
882 return status before using memory. Return status from function
883 adjusting all callers.
884
182ec670
AM
8852020-02-28 Alan Modra <amodra@gmail.com>
886
887 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
888
1b088c82
AM
8892020-02-28 Alan Modra <amodra@gmail.com>
890
891 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
892 Remove duplicate undersize check.
893
5f602802
AM
8942020-02-27 Alan Modra <amodra@gmail.com>
895
896 PR 24511
897 * mmo.c (mmo_scan): Set SEC_DATA for .data.
898
49d9fd42
AM
8992020-02-27 Alan Modra <amodra@gmail.com>
900
901 PR 24511
902 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
903 (coff_section_type): Adjust comment.
904 (decode_section_type): Likewise. Call coff_section_type before
905 decode_section_type.
906 (bfd_decode_symclass): Use 'c' for common sections other than
907 the standard one.
908
05f52dc2
AM
9092020-02-27 Alan Modra <amodra@gmail.com>
910
911 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
912 malloc'd block.
913
ff69a894
AM
9142020-02-27 Alan Modra <amodra@gmail.com>
915
916 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
917 if file is an archive element.
918 * bfd-in2.h: Regenerate.
919
02f7e7ee
AM
9202020-02-26 Alan Modra <amodra@gmail.com>
921
922 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
923 bfd_set_error on failing test. Don't bother changing bfd_error on
924 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
925 Check sym name is within string buffer. Use size_t for some vars.
926 (do_slurp_coff_armap): Use size_t for some variables, fix size of
927 int_buf. Don't change bfd_error on file read error. Use
928 _bfd_mul_overflow when calculating carsym buffer size. Reorder
929 calculations to catch overflows before they occur. malloc and
930 free raw armap rather than using bfd_alloc. Read raw armap before
931 allocating carsym+strings buffer.
932 (_bfd_slurp_extended_name_table): Localize variables. Check
933 name size against file size.
934
cc4c4f40
AM
9352020-02-26 Alan Modra <amodra@gmail.com>
936
937 * vms-lib.c (vms_lib_read_index): Release correct buffer.
938
e0b317de
AM
9392020-02-26 Alan Modra <amodra@gmail.com>
940
941 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
942 malloc. Check for NULL return from bfd_malloc.
943 (rx_table_find, rx_table_map): Likewise.
944 (rx_set_section_contents): Check bfd_alloc return.
945 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
946
dc1e8a47
AM
9472020-02-26 Alan Modra <amodra@gmail.com>
948
949 * aoutx.h: Indent labels correctly. Format error strings.
950 * archive.c: Likewise.
951 * archive64.c: Likewise.
952 * coff-arm.c: Likewise.
953 * coff-rs6000.c: Likewise.
954 * coff-stgo32.c: Likewise.
955 * cpu-arm.c: Likewise.
956 * dwarf2.c: Likewise.
957 * elf-ifunc.c: Likewise.
958 * elf-properties.c: Likewise.
959 * elf-s390-common.c: Likewise.
960 * elf-strtab.c: Likewise.
961 * elf.c: Likewise.
962 * elf32-arm.c: Likewise.
963 * elf32-bfin.c: Likewise.
964 * elf32-cr16.c: Likewise.
965 * elf32-csky.c: Likewise.
966 * elf32-i386.c: Likewise.
967 * elf32-m68k.c: Likewise.
968 * elf32-msp430.c: Likewise.
969 * elf32-nds32.c: Likewise.
970 * elf32-nios2.c: Likewise.
971 * elf32-pru.c: Likewise.
972 * elf32-xtensa.c: Likewise.
973 * elf64-ia64-vms.c: Likewise.
974 * elf64-x86-64.c: Likewise.
975 * elfcode.h: Likewise.
976 * elfcore.h: Likewise.
977 * elflink.c: Likewise.
978 * elfnn-aarch64.c: Likewise.
979 * elfnn-ia64.c: Likewise.
980 * elfnn-riscv.c: Likewise.
981 * elfxx-mips.c: Likewise.
982 * elfxx-sparc.c: Likewise.
983 * elfxx-x86.c: Likewise.
984 * i386lynx.c: Likewise.
985 * merge.c: Likewise.
986 * pdp11.c: Likewise.
987 * plugin.c: Likewise.
988 * reloc.c: Likewise.
989
e310298c
AM
9902020-02-26 Alan Modra <amodra@gmail.com>
991
992 PR 25593
993 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
994 "dyn_loaded".
995 (bfd_elf_add_dt_needed_tag): Declare.
996 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
997 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
998 from elf_add_dt_needed_tag. Remove soname and doit param.
999 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
1000 to see whether as-needed lib is already loaded, use dyn_loaded
1001 list instead. When saving and restoring around as-needed lib
1002 handle possibility that dynstr has not been initialised. Don't
1003 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
1004 Mark libs loaded via DT_NEEDED entries of other libs with
1005 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
1006 the output.
1007 (elf_link_check_versioned_symbol): Remove now unneccesary
1008 DYNAMIC check when traversing dyn_loaded list.
1009
b570b954
AM
10102020-02-26 Alan Modra <amodra@gmail.com>
1011
1012 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
1013
ecda9016
L
10142020-02-25 H.J. Lu <hongjiu.lu@intel.com>
1015
1016 PR binutils/25584
1017 * plugin.c (need_lto_wrapper_p): New.
1018 (bfd_plugin_set_program_name): Add an int argument to set
1019 need_lto_wrapper_p.
1020 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
1021 set.
1022 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
1023
a98c743f
AM
10242020-02-24 Alan Modra <amodra@gmail.com>
1025
1026 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
1027
c893ce36
AM
10282020-02-24 Alan Modra <amodra@gmail.com>
1029
1030 * vms-lib.c (struct carsym_mem): Add limit.
1031 (vms_add_index): Heed limit.
1032 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
1033 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
1034 Always return actual number read.
1035 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
1036 assertion with error exit.
1037
7b3c2715
AM
10382020-02-22 Alan Modra <amodra@gmail.com>
1039
1040 PR 25585
1041 * elf.c (assign_file_positions_for_load_sections): Continue linking
1042 on "PHDR segment not covered by LOAD segment" errors.
1043
a4425a57
AM
10442020-02-21 Alan Modra <amodra@gmail.com>
1045
1046 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
1047 overflow check.
1048 (bfd_mach_o_canonicalize_reloc): Likewise.
1049 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
1050 counts and offsets against file size.
1051 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
1052 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
1053 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
1054 against file size. Delete symbol table error message.
1055 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
1056 against file size.
1057 (bfd_mach_o_read_symtab): Likewise.
1058 (bfd_mach_o_read_command): Pass file size.
1059 (bfd_mach_o_scan): Sanity check command count against file size.
1060
dda2980f
AM
10612020-02-21 Alan Modra <amodra@gmail.com>
1062
1063 PR 25569
1064 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
1065 "text", "data" and "bss" section pointer vars. Don't update
1066 section size, just exec header sizes.
1067 (adjust_sizes_and_vmas): Don't update text section size. Set
1068 initial exec header a_text. Print exec headers sizes.
1069 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
1070 (adjust_sizes_and_vmas): Similarly. Formatting.
1071 (final_link): Correct final file extension.
1072
00e49dff
NC
10732020-02-20 Nick Clifton <nickc@redhat.com>
1074
1075 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
1076 callback.
1077 * elfxx-target.h (elf_backend_symbol_section_index): Provide
1078 default definition.
1079 (elfNN_bed): Initialise the symbol_section_index field.
1080 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
1081 OS and PROC specific section indicies. Warn if converting other
1082 reserved incidies to SHN_ABS.
1083
fcaaac0a
SB
10842020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
1085
1086 PR 25537
1087 * cpu-z80.c: Add machine type compatibility checking.
1088
dcf06b89
L
10892020-02-19 H.J. Lu <hongjiu.lu@intel.com>
1090
1091 PR binutils/25355
1092 * plugin.c (plugin_list_entry): Remove handle.
1093 (try_load_plugin): Call dlclose before return.
1094
2c7c5554
AM
10952020-02-19 Alan Modra <amodra@gmail.com>
1096
1097 * libbfd-in.h (_bfd_constant_p): Define.
1098 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
1099 file size before allocating memory.
1100 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
1101 * elf.c (bfd_elf_get_str_section): Likewise.
1102 (_bfd_elf_slurp_version_tables): Likewise.
1103 * libbfd.h: Regenerate.
1104
2bb3687b
AM
11052020-02-19 Alan Modra <amodra@gmail.com>
1106
1107 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
1108 * aoutx.h (aout_get_external_symbols): Replace calls to
1109 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
1110 (slurp_reloc_table): Likewise.
1111 * archive.c (do_slurp_bsd_armap): Likewise.
1112 (do_slurp_coff_armap): Likewise.
1113 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
1114 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
1115 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
1116 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
1117 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
1118 (_bfd_coff_get_external_symbols): Likewise.
1119 * ecoff.c (ecoff_slurp_symbolic_header),
1120 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
1121 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
1122 (ecoff_indirect_link_order): Likewise.
1123 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
1124 (_bfd_elf_slurp_version_tables): Likewise.
1125 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1126 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1127 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1128 * elf64-alpha.c (READ): Likewise.
1129 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
1130 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
1131 * elfcode.h (elf_slurp_symbol_table),
1132 (elf_slurp_reloc_table_from_section): Likewise.
1133 * elflink.c (elf_link_add_object_symbols),
1134 (elf_link_check_versioned_symbol): Likewise.
1135 * elfxx-mips.c (READ): Likewise.
1136 * i386lynx.c (slurp_reloc_table): Likewise.
1137 * lynx-core.c (lynx_core_file_p): Likewise.
1138 * mach-o.c (bfd_mach_o_canonicalize_relocs),
1139 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
1140 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
1141 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
1142 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
1143 (bfd_pef_parse_symbols): Likewise.
1144 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
1145 * som.c (setup_sections, som_slurp_string_table),
1146 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1147 (som_bfd_fill_in_ar_symbols): Likewise.
1148 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
1149 (evax_bfd_print_image): Likewise.
1150 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
1151 * wasm-module.c (wasm_scan): Likewise.
1152 * xcofflink.c (xcoff_link_add_symbols): Likewise.
1153 * xsym.c (bfd_sym_read_name_table),
1154 (bfd_sym_print_type_information_table_entry): Likewise.
1155 * libbfd.h: Regenerate.
1156
806470a2
AM
11572020-02-19 Alan Modra <amodra@gmail.com>
1158
1159 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
1160 reading external relocs.
1161 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
1162 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
1163 after bfd_bread.
1164 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
1165 bfd_release.
1166 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
1167 (m32c_elf_relax_section): Likewise.
1168 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
1169 (rl78_elf_relax_section): Likewise.
1170 * elf32-rx.c (rx_offset_for_reloc): Likewise.
1171 (elf32_rx_relax_section): Likewise.
1172 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
1173 parameter types and use..
1174 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
1175 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
1176 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
1177 being read from file, just the extra.
1178 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
1179 after reading external syms. Free on failure.
1180
1f4361a7
AM
11812020-02-19 Alan Modra <amodra@gmail.com>
1182
1183 * coffcode.h (buy_and_read, coff_slurp_line_table),
1184 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
1185 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
1186 corresponding bfd_alloc call. Adjust variables to suit.
1187 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1188 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
1189 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
1190 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
1191 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
1192 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1193 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1194 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1195 * elf64-alpha.c (READ): Likewise.
1196 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
1197 (elf_slurp_symbol_table, elf_slurp_reloc_table),
1198 (bfd_from_remote_memory): Likewise.
1199 * elfcore.h (core_find_build_id): Likewise.
1200 * elfxx-mips.c (READ): Likewise.
1201 * mach-o.c (bfd_mach_o_mangle_sections),
1202 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
1203 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
1204 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
1205 * som.c (setup_sections, som_prep_for_fixups)
1206 (som_build_and_write_symbol_table, som_slurp_symbol_table),
1207 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1208 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
1209 (som_bfd_ar_write_symbol_stuff): Likewise.
1210 * vms-alpha.c (vector_grow1): Likewise.
1211 * vms-lib.c (vms_add_index): Likewise.
1212 * wasm-module.c (wasm_scan_name_function_section): Likewise.
1213 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
1214 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
1215 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
1216 (bfd_alloc2, bfd_zalloc2): Delete.
1217 (_bfd_mul_overflow): Define.
1218 * libbfd.h: Regenerate.
1219
446f7ed5
AM
12202020-02-19 Alan Modra <amodra@gmail.com>
1221
1222 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
1223 bfd_zalloc2.
1224 (assign_section_numbers): Likewise.
1225 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
1226 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
1227 bfd_malloc2, size_t amt, and unsigned tls_count.
1228 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
1229 * elflink.c (elf_create_symbuf): Use bfd_malloc.
1230 (elf_output_implib): Use bfd_alloc.
1231
b03202e3
AM
12322020-02-19 Alan Modra <amodra@gmail.com>
1233
1234 * bfd.c (struct bfd): Move format and direction to other
1235 bitfields. Add "size".
1236 * bfdio.c (bfd_get_size): Cache size when not writing file.
1237 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
1238 returning zero, ie. unknown.
1239 (bfd_get_alt_debug_link_info): Likewise.
1240 * bfd-in2.h: Regenerate.
1241
7c5fa58e
AM
12422020-02-19 Alan Modra <amodra@gmail.com>
1243
1244 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
1245 bfd_get_file_size twice.
1246 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
1247 zero, ie. unknown, return.
1248 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
1249 * elfcode.h (elf_swap_shdr_in): Likewise.
1250 (elf_object_p): Don't call bfd_get_file_size twice and correct
1251 file size check.
1252
96d3b80f
AM
12532020-02-19 Alan Modra <amodra@gmail.com>
1254
1255 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
1256 FALSE if memory alloc fails. Adjust calls.
1257 * som.c (som_prep_for_fixups): Likewise.
1258 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
1259 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
1260 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
1261 * som.c (som_build_and_write_symbol_table): Return via error_return
1262 on seek failure.
1263 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
1264 (VEC_APPEND_EL): Delete.
1265 (vector_grow1): Return pointer to element. Catch overflow.
1266 Return NULL on memory allocation failure.
1267 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
1268 (alpha_vms_add_fixup_ca): Likewise.
1269 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
1270 before using.
1271 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
1272
986f0783
AM
12732020-02-19 Alan Modra <amodra@gmail.com>
1274
1275 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
1276 * aout-target.h (object_p): Likewise.
1277 * aout-tic30.c (tic30_aout_object_p): Likewise.
1278 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
1279 (emit_stringtab, write_syms, link_hash_table_create),
1280 (aout_link_write_other_symbol): Likewise.
1281 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
1282 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
1283 (_bfd_compute_and_write_armap): Likewise.
1284 * archures.c (bfd_arch_list): Likewise.
1285 * bfd.c (bfd_record_phdr): Likewise.
1286 * binary.c (binary_canonicalize_symtab): Likewise.
1287 * cisco-core.c (cisco_core_file_validate): Likewise.
1288 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
1289 (find_arm_glue, record_arm_to_thumb_glue),
1290 (record_thumb_to_arm_glue): Likewise.
1291 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
1292 (ppc_allocate_toc_section): Likewise.
1293 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
1294 * coff-sh.c (sh_relax_section): Likewise.
1295 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
1296 * coffcode.h (handle_COMDAT, coff_new_section_hook),
1297 (coff_set_alignment_hook, coff_mkobject),
1298 (coff_compute_section_file_positions): Likewise.
1299 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
1300 (coff_find_nearest_line_with_names),
1301 ( bfd_coff_set_symbol_class): Likewise.
1302 * cofflink.c (_bfd_coff_link_hash_table_create),
1303 (_bfd_coff_link_input_bfd): Likewise.
1304 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
1305 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
1306 (build_line_info_table, sort_line_sequences),
1307 (line_info_add_include_dir, line_info_add_file_name),
1308 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
1309 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
1310 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
1311 (_bfd_ecoff_find_nearest_line),
1312 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
1313 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
1314 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
1315 * elf-m10300.c (mn10300_elf_relax_section),
1316 (elf32_mn10300_link_hash_table_create): Likewise.
1317 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
1318 * elf.c (make_mapping, copy_elf_program_header): Likewise.
1319 * elf32-arm.c (elf32_arm_link_hash_table_create),
1320 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
1321 (elf32_arm_new_section_hook): Likewise.
1322 * elf32-avr.c (elf_avr_new_section_hook),
1323 (elf32_avr_link_hash_table_create, get_local_syms),
1324 (elf32_avr_setup_section_lists): Likewise.
1325 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
1326 (bfin_link_hash_table_create): Likewise.
1327 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
1328 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
1329 * elf32-csky.c (csky_elf_link_hash_table_create),
1330 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
1331 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
1332 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
1333 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
1334 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1335 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
1336 * elf32-m32r.c (m32r_elf_link_hash_table_create),
1337 (m32r_elf_check_relocs): Likewise.
1338 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
1339 (elf32_m68hc11_setup_section_lists),
1340 (elf32_m68hc11_size_stubs): Likewise.
1341 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
1342 * elf32-metag.c (elf_metag_link_hash_table_create),
1343 (elf_metag_setup_section_lists): Likewise.
1344 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
1345 (microblaze_elf_check_relocs): Likewise.
1346 * elf32-nds32.c (nds32_elf_link_hash_table_create),
1347 (nds32_elf_check_relocs): Likewise.
1348 * elf32-nios2.c (nios2_elf32_setup_section_lists),
1349 (get_local_syms, nios2_elf32_check_relocs),
1350 (nios2_elf32_link_hash_table_create): Likewise.
1351 * elf32-or1k.c (or1k_elf_link_hash_table_create),
1352 (or1k_elf_check_relocs): Likewise.
1353 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
1354 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
1355 * elf32-s390.c (elf_s390_link_hash_table_create),
1356 (elf_s390_check_relocs): Likewise.
1357 * elf32-score.c (score_elf_create_got_section),
1358 (s3_elf32_score_new_section_hook),
1359 (elf32_score_link_hash_table_create): Likewise.
1360 * elf32-score7.c (score_elf_create_got_section),
1361 (s7_elf32_score_new_section_hook): Likewise.
1362 * elf32-sh.c (sh_elf_link_hash_table_create),
1363 (sh_elf_check_relocs): Likewise.
1364 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
1365 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
1366 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
1367 (tilepro_elf_check_relocs): Likewise.
1368 * elf32-v850.c (remember_hi16s_reloc): Likewise.
1369 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
1370 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
1371 (elf_xtensa_new_section_hook): Likewise.
1372 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
1373 (get_got_entry, elf64_alpha_check_relocs): Likewise.
1374 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
1375 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
1376 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
1377 * elf64-ppc.c (ppc64_elf_new_section_hook),
1378 (ppc64_elf_link_hash_table_create, update_local_sym_info),
1379 (update_plt_info, ppc64_elf_check_relocs): Likewise.
1380 * elf64-s390.c (elf_s390_link_hash_table_create),
1381 (elf_s390_check_relocs): Likewise.
1382 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1383 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
1384 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
1385 (elf_link_add_archive_symbols, compute_bucket_count),
1386 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
1387 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
1388 (bfd_elf_final_link): Likewise.
1389 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
1390 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
1391 (elfNN_aarch64_new_section_hook): Likewise.
1392 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
1393 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
1394 (riscv_elf_check_relocs): Likewise.
1395 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
1396 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
1397 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
1398 (_bfd_mips_elf_link_hash_table_create): Likewise.
1399 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
1400 (_bfd_sparc_elf_check_relocs),
1401 (_bfd_sparc_elf_new_section_hook): Likewise.
1402 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
1403 (tilegx_elf_check_relocs): Likewise.
1404 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1405 * format.c (bfd_check_format_matches): Likewise.
1406 * hash.c (_bfd_stringtab_init): Likewise.
1407 * ihex.c (ihex_scan): Likewise.
1408 * irix-core.c (irix_core_core_file_p): Likewise.
1409 * linker.c (bfd_wrapped_link_hash_lookup),
1410 (_bfd_generic_link_hash_table_create),
1411 (_bfd_generic_reloc_link_order): Likewise.
1412 * lynx-core.c (lynx_core_file_p): Likewise.
1413 * netbsd-core.c (netbsd_core_file_p): Likewise.
1414 * osf-core.c (osf_core_core_file_p): Likewise.
1415 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
1416 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
1417 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
1418 * peicode.h (pe_mkobject): Likewise.
1419 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
1420 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1421 * sco5-core.c (read_uarea): Likewise.
1422 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
1423 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
1424 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
1425 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
1426 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
1427 * srec.c (srec_scan): Likewise.
1428 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
1429 * targets.c (bfd_target_list): Likewise.
1430 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
1431 * trad-core.c (trad_unix_core_file_p): Likewise.
1432 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
1433 (vms_new_section_hook): Likewise.
1434 * wasm-module.c (wasm_make_empty_symbol): Likewise.
1435 * xcofflink.c (xcoff_get_section_contents),
1436 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
1437 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
1438 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
1439
2d0e1217
AM
14402020-02-19 Alan Modra <amodra@gmail.com>
1441
1442 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
1443
99845b3b
L
14442020-02-13 H.J. Lu <hongjiu.lu@intel.com>
1445
1446 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
1447 and use it if it isn't NULL. Remove has_plugin_p argument. Add
1448 a build_list_p argument. Don't search plugin_list. Short circuit
1449 when building the plugin list.
1450 (has_plugin): Renamed to has_plugin_list.
1451 (bfd_plugin_set_plugin): Don't set has_plugin.
1452 (bfd_plugin_specified_p): Check plugin_list instead.
1453 (build_plugin_list): New function.
1454 (load_plugin): Call build_plugin_list and use plugin_list.
1455
22fe7df8
L
14562020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1457
1458 PR binutils/25355
1459 * plugin.c (try_claim): Always clean up for LTO wrapper.
1460 (try_load_plugin): Treat each object as independent. Create a
1461 copy for plugin name.
1462
c675ec1e
NC
14632020-02-11 Nick Clifton <nickc@redhat.com>
1464
1465 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
1466 for addresses in print statements.
1467 (msp430_elf_relax_delete_bytes): Likewise.
1468 (msp430_elf_relax_add_words): Likewise.
1469 (msp430_elf_relax_section): Likewise.
1470
1d07a805
L
14712020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1472
1473 * plugin.c (add_symbols): Clear plugin_data memory.
1474
0aa99dcd
L
14752020-02-10 H.J. Lu <hongjiu.lu@intel.com>
1476
1477 PR binutils/25355
1478 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
1479 (EXECUTABLE_SUFFIX): Likewise.
1480 * config.in: Regenerated.
1481 * configure: Likewise.
1482 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
1483 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
1484 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
1485 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
1486 (get_lto_wrapper): New.
1487 (setup_lto_wrapper_env): Likewise.
1488 (current_plugin): Likewise.
1489 (register_all_symbols_read): Likewise.
1490 (register_cleanup): Likewise.
1491 (get_symbols): Likewise.
1492 (add_input_file): Likewise.
1493 (bfd_plugin_close_and_cleanup): Likewise.
1494 (claim_file): Removed.
1495 (register_claim_file): Set current_plugin->claim_file.
1496 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
1497 lto_syms in current_plugin.
1498 (try_claim): Use current_plugin->claim_file. Call LTO plugin
1499 all_symbols_read handler. Copy real symbols to plugin_data.
1500 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
1501 (try_load_plugin): Don't reuse the previous plugin for LTO
1502 wrapper. Set up GCC LTO wrapper if possible. Don't set
1503 plugin_list_iter->claim_file.
1504 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
1505 possible.
1506 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
1507 real_syms.
1508
ac4280da
JL
15092020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1510
1511 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
1512 check if previous instruction matches a conditional jump inserted
1513 earlier. Invert conditional jump and delete branch in this case.
1514
8d6cb116
JL
15152020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1516
1517 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
1518 msp430_elf_relax_add_words. Support insertion of either one or two
1519 words.
1520 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
1521 needs to be grown. Handle insertion of branch instruction to replace
1522 jump.
1523
d60f5448
JL
15242020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1525
1526 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
1527 debugging relocations.
1528 (msp430_elf_relax_delete_bytes): Likewise.
1529 (msp430_elf_relax_add_two_words): Likewise.
1530 (msp430_elf_relax_section): Likewise.
1531
e1f85e11
AM
15322020-02-10 Alan Modra <amodra@gmail.com>
1533
1534 * archures.c: Wrap overlong z80 comments.
1535 * bfd-in2.h: Regenerate.
1536
9fc0b501
SB
15372020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
1538
1539 PR 25469
1540 * archures.c: Add GBZ80 and Z80N machine values.
1541 * reloc.c: Add BFD_RELOC_Z80_16_BE.
1542 * coff-z80.c: Add support for new reloc.
1543 * coffcode.h: Add support for new machine values.
1544 * cpu-z80.c: Add support for new machine names.
1545 * elf32-z80.c: Add support for new reloc.
1546 * bfd-in2.h: Regenerate.
1547 * libbfd.h: Regenerate.
1548
9984857c
NC
15492020-02-07 Nick Clifton <nickc@redhat.com>
1550
1551 PR 23932
1552 * elf.c (rewrite_elf_program_header): Do not complain if no
1553 sections are mapped to a segment.
1554
5242a0a0
L
15552020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1556
1557 PR ld/25490
1558 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
1559 for garbage collection on __patchable_function_entries section
1560 without linked-to section.
1561
b7d07216
L
15622020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1563
1564 PR gas/25381
1565 * bfd-in2.h: Regenerated.
1566 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
1567 on section if gc_mark of any of its linked-to sections is set
1568 and don't set gc_mark again.
1569 * section.c (asection): Add linked_to_symbol_name to map_head
1570 union.
1571
b93a662b
MR
15722020-02-06 Maciej W. Rozycki <macro@wdc.com>
1573
1574 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
1575 reporting an unrecognized instruction with R_V850_LONGJUMP.
1576
6df4c9c2
AM
15772020-02-05 Alan Modra <amodra@gmail.com>
1578
1579 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
1580
24872cb3
AM
15812020-02-04 Alan Modra <amodra@gmail.com>
1582
1583 * elf32-ppc.c (ppc_elf_relocate_section): After applying
1584 R_PPC_VLE_ADDR20, goto copy_reloc.
1585
ef4627fa
L
15862020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1587
1588 * bfd-in2.h: Regenerated.
1589 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
1590
a8c4d40b
L
15912020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1592
1593 PR gas/25380
1594 * bfd-in2.h: Regenerated.
1595 * ecoff.c (bfd_debug_section): Add section_id.
1596 * section.c (bfd_section): Add section_id.
1597 (SEC_ASSEMBLER_SECTION_ID): New.
1598 (BFD_FAKE_SECTION): Add section_id.
1599
5a9212a1
NC
16002020-02-01 Nick Clifton <nickc@redhat.com>
1601
1602 * config.bfd: Move the c30-aout and tic30-aout targets onto the
1603 obsolete list.
1604
e7cbe0c4
SL
16052020-01-31 Sandra Loosemore <sandra@codesourcery.com>
1606
1607 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
1608 encodings are relative to the GOT on nios2, too.
1609
72ebe8c5
AM
16102020-01-31 Alan Modra <amodra@gmail.com>
1611
1612 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
1613 file. Use $< and $@ in rules.
1614 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
1615 (elf32-ia64.c, elf64-ia64.c): Likewise.
1616 (elf32-riscv.c, elf64-riscv.c): Likewise.
1617 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1618 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
1619 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
1620 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
1621 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1622 * Makefile.in: Regenerate.
1623
327301a4
AM
16242020-01-31 Alan Modra <amodra@gmail.com>
1625
1626 PR 4110
1627 * elf.c (setup_group): Don't clear entire section contents,
1628 just the padding after group flags. Release alloc'd memory
1629 after a seek or read failure.
1630
b5d36aaa
JT
16312020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1632
1633 * peXXigen.c (pe_is_repro): New function.
1634 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
1635 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
1636
1957ab10
JT
16372020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1638
1639 * peXXigen.c (debug_type_names): Add names for new debug data type
1640 values.
1641
87b2920f
JT
16422020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1643
1644 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
1645 inner loop. Fix a memory leak.
1646
72913831
AM
16472020-01-30 Alan Modra <amodra@gmail.com>
1648
1649 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
1650 or obj_coff_keep_strings here.
1651 (coff_get_normalized_symtab): Free external syms directly.
1652 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
1653 on error exit path.
1654
c35d018b
JW
16552020-01-27 Jim Wilson <jimw@sifive.com>
1656
1657 * cpu-riscv.c (riscv_scan): New.
1658 (N): Change bfd_default_scan to riscv_scan.
1659
086b06f3
AS
16602020-01-27 Andreas Schwab <schwab@suse.de>
1661
1662 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
1663 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
1664 * Makefile.in: Regenerate.
1665 * cpu-plugin.c: Remove.
1666 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
1667 (bfd_plugin_arch): Remove declaration.
1668 * bfd-in2.h: Regenerate.
1669 * po/SRC-POTFILES.in: Regenerate.
1670
3024a17a
AM
16712020-01-27 H.J. Lu <hongjiu.lu@intel.com>
1672 Alan Modra <amodra@gmail.com>
1673
1674 PR ld/25458
1675 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
1676
b5f998b2
JW
16772020-01-24 Jim Wilson <jimw@sifive.com>
1678
1679 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
1680 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
1681 avoid over long line.
1682
caa31cfa
NC
16832020-01-24 Nick Clifton <nickc@redhat.com>
1684
1685 PR 25447
1686 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
1687 syms and keep strings flags as these may have been set in order to
1688 prevent a bogus call to free.
1689
24e648d4
NC
16902020-01-23 Nick Clifton <nickc@redhat.com>
1691
1692 * po/fr.po: Updated French translation.
1693
67641dd3
AM
16942020-01-23 Alan Modra <amodra@gmail.com>
1695
1696 PR 25444
1697 * elf.c (assign_file_positions_for_load_sections): Avoid divide
1698 by zero when p_align is zero.
1699
403d1bd9
JW
17002020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
1701
1702 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
1703 (riscv_prefix_cmp): Likewise.
1704 (riscv_non_std_ext_p): Deleted.
1705 (riscv_std_sv_ext_p): Likewise.
1706 (riscv_non_std_sv_ext_p): Likewise.
1707 (riscv_merge_non_std_and_sv_ext): Rename to...
1708 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
1709 (riscv_merge_arch_attr_info): Replace 3 calls to
1710 riscv_merge_non_std_and_sv_ext with single call to
1711 riscv_merge_multi_letter_ext.
1712 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
1713 encounter a 'z' prefix.
1714 (riscv_get_prefix_class): New function, return prefix class based
1715 on first few characters of input string.
1716 (riscv_parse_config): New structure to factor out minor differences
1717 in extension class parsing behaviour.
1718 (riscv_parse_sv_or_non_std_ext): Rename to...
1719 (riscv_parse_prefixed_ext): and parameterise with
1720 riscv_parse_config.
1721 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
1722 (riscv_multi_letter_ext_valid_p): New.
1723 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
1724 (riscv_parse_subset): Delegate all non-single-letter parsing work
1725 to riscv_parse_prefixed_ext.
1726 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
1727 (riscv_get_prefix_class): Declare.
1728
a804e476
AM
17292020-01-22 Alan Modra <amodra@gmail.com>
1730
1731 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
1732 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
1733 __tls_get_addr_desc.
1734 (ppc64_elf_size_stubs): Add section for linker generated
1735 __tls_get_addr_desc wrapper function. Loop at least once if
1736 generating this function.
1737 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
1738 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
1739
9e7028aa
AM
17402020-01-22 Alan Modra <amodra@gmail.com>
1741
1742 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
1743 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
1744 tga_desc_fd.
1745 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
1746 (STDU_R1_0R1, ADDI_R1_R1): Define.
1747 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
1748 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
1749 tga_desc_fd to opt_fd, and tga_desc to opt. Set
1750 no_tls_get_addr_regsave.
1751 (branch_reloc_hash_match): Add hash3 and hash4.
1752 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
1753 (ppc64_elf_size_dynamic_sections): Likewise.
1754 (ppc64_elf_relocate_section): Likewise.
1755 (plt_stub_size, build_plt_stub): Likewise. Size regsave
1756 __tls_get_addr stub.
1757 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
1758 eh_frame.
1759 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
1760 eh_frame for regsave __tls_get_addr.
1761
abc489c6
AM
17622020-01-22 Alan Modra <amodra@gmail.com>
1763
1764 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
1765 which __tls_get_addr calls will be eliminated.
1766
26916852
NC
17672020-01-20 Nick Clifton <nickc@redhat.com>
1768
1769 * po/pt.po: Updates Portuguese translation.
1770 * po/ru.po: Updated Russian translation.
1771 * po/uk.po: Updated Ukranian translation.
1772
14470f07
L
17732020-01-20 H.J. Lu <hongjiu.lu@intel.com>
1774
1775 PR ld/25416
1776 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
1777 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
1778 X32 mode.
1779 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
1780 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
1781 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
1782 "rex leal x@tlsdesc(%rip), %reg" to
1783 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
1784 "call *(%eax)" to "nopl (%rax)".
1785
b9ca1af6
AM
17862020-01-20 Alan Modra <amodra@gmail.com>
1787
1788 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
1789 (MTLR_R11): Don't define.
1790 (LD_R0_0R3, CMPDI_R0_0): Define.
1791 (build_tls_get_addr_stub): Don't use r11 in stub.
1792
ed7007c1
AM
17932020-01-20 Alan Modra <amodra@gmail.com>
1794
1795 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
1796 (defined_sym_val, is_tls_get_addr): Likewise.
1797
1b1bb2c6
NC
17982020-01-18 Nick Clifton <nickc@redhat.com>
1799
1800 * version.m4 (BFD_VERSION): Set to 2.34.50.
1801 * configure: Regenerate.
1802 * po/bfd.pot: Regenerate.
1803
ae774686
NC
18042020-01-18 Nick Clifton <nickc@redhat.com>
1805
1806 Binutils 2.34 branch created.
1807
07f1f3aa
CB
18082020-01-17 Christian Biesinger <cbiesinger@google.com>
1809
1810 * coff-arm.c: Fix spelling error (seperate).
1811 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
1812 error (seperate).
1813 * sysdep.h (strnlen): Fix spelling error (seperate).
1814
0d1cc75d
LB
18152020-01-15 Lars Brinkhoff <lars@nocrew.org>
1816
1817 PR 20694
1818 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
1819
e1c6cf61
AM
18202020-01-15 Alan Modra <amodra@gmail.com>
1821
1822 PR 25384
1823 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
1824 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
1825 of function symbols unless dot symbols are present. Do warn
1826 whenever one is created, regardles of whether a PLT entry is
1827 also emitted for the function symbol.
1828
ef4e5ba5
AM
18292020-01-14 Alan Modra <amodra@gmail.com>
1830
1831 * som.c (som_bfd_count_ar_symbols): Error when file position
1832 of symbols on chains is not strictly increasing.
1833
8ab484c2
AM
18342020-01-14 Alan Modra <amodra@gmail.com>
1835
1836 * vms.h (VMS_DEBUG): Define as 0.
1837 * vms-alpha.c (image_write): Move debug output after bounds check.
1838 Tidy bounds check.
1839 (_bfd_vms_slurp_eihd): Warning fix.
1840 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
1841
b50ef514
AM
18422020-01-13 Alan Modra <amodra@gmail.com>
1843
1844 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
1845 for "ignored" records.
1846
0c0adcc5
AM
18472020-01-13 Alan Modra <amodra@gmail.com>
1848
1849 * wasm-module.c (wasm_scan_name_function_section): Formatting.
1850 Delete asect name check. Move asect NULL check to wasm_object_p.
1851 Correct bounds check of sizes against end. Replace uses of
1852 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
1853 just one bfd_release.
1854 (wasm_scan): Don't use malloc/strdup for section names,
1855 bfd_alloc instead. Simplify code prefixing section name.
1856 Formatting. Don't attempt to free memory here..
1857 (wasm_object_p): ..do so here.
1858
7f026732
SN
18592020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
1860
1861 PR ld/22269
1862 * elf32-arm.c (elf32_arm_final_link_relocate): Use
1863 UNDEFWEAK_NO_DYNAMIC_RELOC.
1864 (allocate_dynrelocs_for_symbol): Likewise.
1865
8cd0e5e9
TC
18662020-01-10 Tamar Christina <tamar.christina@arm.com>
1867
1868 PR 25210
1869 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
1870
71780f45
AM
18712020-01-10 Alan Modra <amodra@gmail.com>
1872
1873 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
1874
b899eb3b
NC
18752020-01-09 Nick Clifton <nickc@redhat.com>
1876
1877 PR 25221
1878 * bfd.c (bfd_convert_section_contents): Check for a compress
1879 header size that is larger than the actual section size.
1880
4c6ee646
AM
18812020-01-08 Alan Modra <amodra@gmail.com>
1882
1883 PR 25351
1884 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
1885 after removing sections.
1886
85f78364
JW
18872020-01-06 Jim Wilson <jimw@sifive.com>
1888
1889 PR 25205
1890 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
1891 check for !bfd_link_pic (info).
1892 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
1893 <R_RISCV_JAL>: Add comment.
1894 (_bfd_riscv_relax_section): For plt.offset check, add check for
1895 bfd_link_pic (info). Add comment.
1896
49078ece
AM
18972020-01-06 Alan Modra <amodra@gmail.com>
1898
1899 * format.c (bfd_check_format_matches): Ignore bfd_error on target
1900 match failures. Don't init to bfd_error_wrong_format before
1901 calling _bfd_check_format.
1902
ab356be7
AM
19032020-01-06 Alan Modra <amodra@gmail.com>
1904
1905 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
1906 status rather than exiting on stack overflow or underflow.
1907 (_bfd_vms_slurp_etir): Adjust to suit.
1908
85d86817
AM
19092020-01-06 Alan Modra <amodra@gmail.com>
1910
1911 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
1912
3e6aa775
AM
19132020-01-06 Alan Modra <amodra@gmail.com>
1914
1915 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
1916 command. Check name offset is within command.
1917 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
1918 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
1919 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
1920 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
1921 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
1922 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
1923 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
1924 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
1925 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
1926 (bfd_mach_o_read_segment): Similarly.
1927 (bfd_mach_o_read_thread): Properly bound check thread struct.
1928 Don't repeat checks on second loop.
1929 (bfd_mach_o_read_command): Fail on invalid command length.
1930
ea933f17
AM
19312020-01-04 Alan Modra <amodra@gmail.com>
1932
1933 * format.c (bfd_check_format_matches): Add preserve_match.
1934 Save initial bfd state in "preserve", matched bfd state in
1935 "preserve_match". Save just the first match. Release
1936 bfd_alloc memory. Restore and finish preserved state as
1937 appropriate on all function exit paths.
1938
f24bdec4
AM
19392020-01-04 Alan Modra <amodra@gmail.com>
1940
1941 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
1942
991fb595
AM
19432020-01-04 Alan Modra <amodra@gmail.com>
1944
1945 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
1946 match too.
1947
f2a3559d
NC
19482020-01-03 Nick Clifton <nickc@redhat.com>
1949
1950 PR 25307
1951 (bfd_pef_parse_function_stubs): Correct the test that ensures that
1952 there is enough data remaining in the code buffer before
1953 attempting to read a function stub.
1954
7a0fb7be
NC
19552020-01-03 Nick Clifton <nickc@redhat.com>
1956
1957 PR 25308
1958 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
1959 return value from bfd_malloc.
1960 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
1961 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
1962 (elf32_arm_filter_cmse_symbols): Likewise.
1963 (elf32_arm_write_section): Likewise.
1964 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
1965 (bfd_mach_o_follow_dsym): Likewise.
1966 * pef.c (bfd_pef_print_loader_section): Likewise.
1967 (bfd_pef_scan_start_address): Likewise.
1968 (bfd_pef_parse_function_stubs): Likewise.
1969 (bfd_pef_parse_symbols): Likewise.
1970
b26a3d58
ST
19712020-01-03 Sergei Trofimovich <siarheit@google.com>
1972
1973 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
1974 on binary inputs ld/PR25316.
1975 (is_ia64_elf): new helper to filter on ia64 objects.
1976
4bb7a87e
JB
19772020-01-03 Jan Beulich <jbeulich@suse.com>
1978
1979 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
1980 in parameter names.
1981 (bfd_mach_o_scan): Insert underscore in two variable names.
1982
6655dba2
SB
19832020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
1984
1985 * Makefile.am: Add z80-elf target support.
1986 * configure.ac: Likewise.
1987 * targets.c: Likewise.
1988 * Makefile.in: Regenerate.
1989 * configure: Regenerate.
1990 * config.bfd: Add z80-elf target support and new arches: ez80 and
1991 z180.
1992 * elf32-z80.c: New file.
1993 * archures.c: Add new z80 architectures: eZ80 and Z180.
1994 * coffcode.h: Likewise.
1995 * cpu-z80.c: Likewise.
1996 * coff-z80.c: Add new relocations for Z80 target and local label
1997 check.
1998 * reloc.c: Add new relocs.
1999 * bfd-in2.h: Regenerate.
2000 * libbfd.h: Regenerate.
2001
0db131fb
TC
20022020-01-02 Tamar Christina <tamar.christina@arm.com>
2003
2004 PR 25210
2005 PR 24753
2006 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
2007
b14ce8bf
AM
20082020-01-01 Alan Modra <amodra@gmail.com>
2009
2010 Update year range in copyright notice of all files.
2011
0b114740 2012For older changes see ChangeLog-2019
3499769a 2013\f
0b114740 2014Copyright (C) 2020 Free Software Foundation, Inc.
3499769a
AM
2015
2016Copying and distribution of this file, with or without modification,
2017are permitted in any medium without royalty provided the copyright
2018notice and this notice are preserved.
2019
2020Local Variables:
2021mode: change-log
2022left-margin: 8
2023fill-column: 74
2024version-control: never
2025End:
This page took 0.488862 seconds and 4 git commands to generate.