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