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