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