Replace "if (x) free (x)" with "free (x)", bfd
[deliverable/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
c9594989
AM
12020-05-21 Alan Modra <amodra@gmail.com>
2
3 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
4 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
5 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
6 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
7 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
8 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
9 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
10 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
11 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
12 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
13 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
14 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
15 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
16 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
17 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
18 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
19 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
20 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
21 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
22 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
23
8f595e9b
NC
242020-05-20 Nelson Chu <nelson.chu@sifive.com>
25
26 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
27 get_default_version. It is used to find the default version for
28 the specific extension.
29 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
30 default_major_version and default_minor_version. Add new bfd_boolean
31 parameter *use_default_version. Set it to TRUE if we need to call
32 the callback rps->get_default_version to find the default version.
33 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
34 the default version in riscv_parsing_subset_version, and then call
35 riscv_add_subset to add the subset into subset list.
36 (riscv_parse_prefixed_ext): Likewise.
37 (riscv_std_z_ext_strtab): Support Zicsr extensions.
38 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
39 strings rather than characters.
40 riscv_merge_arch_attr_info): The callback function get_default_version
41 is only needed for assembler, so set it to NULL int the linker.
42 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
43 * elfxx-riscv.h: Updated.
44
7b958a48
AM
452020-05-20 Alan Modra <amodra@gmail.com>
46
47 PR 25993
48 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
49 use bfd_set_filename.
50 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
51 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
52 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
53 (bfd_create): Likewise.
54 (_bfd_delete_bfd): Don't free filename.
55 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
56 return pointer to the copy or NULL on alloc fail.
57 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
58 result of bfd_set_filename.
59 * bfd-in2.h: Regenerate.
60
3c568b8a
AM
612020-05-20 Alan Modra <amodra@gmail.com>
62
63 PR 26011
64 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
65 section size against file size.
66 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
67
6fd1d259
GN
682020-05-19 Gunther Nikl <gnikl@justmail.de>
69
70 PR 26005
11c0dd51
NC
71 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
72 and memset when allocating memory for the sections_being_created
73 array.
6fd1d259 74
7e94cf6c
SH
752020-05-19 Stafford Horne <shorne@gmail.com>
76
77 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
78 to relgot.
79 (or1k_elf_relocate_section): Access srelgot via
80 htab->root.srelgot. Add assertions for srelgot->contents.
81 Introduce local variable for srelgot to not reuse global
82 sreloc.
83 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
84 (or1k_set_got_and_rela_sizes): New function.
85 (or1k_initial_exec_offset): New function.
86 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
87 (or1k_elf_relocate_section): Allow for TLS to handle multiple
88 model access.
89 (or1k_elf_check_relocs): Use OR to set TLS access.
90 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
91 sizes.
92 (or1k_elf_size_dynamic_sections): Use
93 or1k_set_got_and_rela_sizes to set sizes.
94 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
95 (TCB_SIZE): New macro.
96 (tpoff): Use TCB_SIZE and alignment to calculate offset.
97 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
98 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
99 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
100 (tpoff): Add dynamic boolean argument.
101 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
102
7e057737
SP
1032020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
104
105 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
106 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
107 cases with BFD_RELOC_AARCH64_JUMP26.
108 (elfNN_aarch64_check_relocs): Likewise.
109
765cf5f6
AM
1102020-05-19 Alan Modra <amodra@gmail.com>
111
112 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
113 bfd_get_filename rather than accessing bfd->filename directly.
114 * aout-target.h (MY (object_p)): Likewise.
115 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
116 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
117 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
118 (_bfd_archive_bsd44_construct_extended_name_table),
119 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
120 (_bfd_bsd_write_armap): Likewise.
121 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
122 * cache.c (bfd_open_file): Likewise.
123 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
124 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
125 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
126 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
127 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
128 * elf32-nds32.c (nds32_elf_output_symbol_hook),
129 (patch_tls_desc_to_ie): Likewise.
130 * elf32-spu.c (sort_bfds, print_one_overlay_section),
131 (spu_elf_auto_overlay): Likewise.
132 * elf64-hppa.c (elf_hppa_final_link): Likewise.
133 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
134 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
135 * elflink.c (bfd_elf_size_dynamic_sections),
136 (elf_link_input_bfd): Likewise.
137 * linker.c (_bfd_generic_link_output_symbols): Likewise.
138 * mach-o.c (bfd_mach_o_follow_dsym),
139 (bfd_mach_o_close_and_cleanup): Likewise.
140 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
141 (find_separate_debug_file, get_build_id_name): Likewise.
142 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
143 * plugin.c (bfd_plugin_open_input): Likewise.
144 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
145 * som.c (som_write_armap): Likewise.
146 * srec.c (srec_write_record, srec_write_symbols): Likewise.
147 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
148 (_bfd_vms_lib_write_archive_contents): Likewise.
149 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
150
39a1432c
AM
1512020-05-19 Alan Modra <amodra@gmail.com>
152
153 PR 25713
154 * bfdio.c (_bfd_real_fopen): Typo fix.
155
ed02cdb5
NC
1562020-05-18 Nick Clifton <nickc@redhat.com>
157
158 PR 26005
159 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
160 for the sections_being_created array.
161
7a87e9c8
AM
1622020-05-18 Alan Modra <amodra@gmail.com>
163
164 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
165 they can be freed without also freeing internal_relocs.
166
ca859a89
JC
1672020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
168
169 PR 25713
170 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
171 separators into DOS style when creating a WIN32 fullpath.
172
fc46e8bd
NC
1732020-05-14 Nelson Chu <nelson.chu@sifive.com>
174
175 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
176 to initialize RISC-V tdata.
177
533f049e
GN
1782020-05-12 Gunther Nikl <gnikl@justmail.de>
179
180 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
181 relocation size.
182
94ba9882
AM
1832020-05-11 Alan Modra <amodra@gmail.com>
184
185 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
186
7c1f4227
AM
1872020-05-11 Alan Modra <amodra@gmail.com>
188
189 * elf64-ppc.c: Rename powerxx to power10 throughout.
190
4d5acb1e
AM
1912020-05-11 Alan Modra <amodra@gmail.com>
192
193 PR 25961
194 * coffgen.c (coff_get_normalized_symtab): Check that buffer
195 contains required number of auxents before processing any auxent.
196 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
197 file name from auxents for PE.
198
7242fa8a
GN
1992020-05-04 Gunther Nikl <gnikl@justmail.de>
200
201 * aout-cris.c (DEFAULT_ARCH): Delete define.
202 (MY_set_arch_mach): Likewise.
203 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
204 of bfd_arch_cris.
205 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
206 of r_type before the shift.
207
2082020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
cff69cf4
WD
209
210 PR ld/25665
211 * elfnn-aarch64.c (group_sections): Copy implementation from
212 elf32-arm.c.
213
a2714d6c
AM
2142020-05-01 Alan Modra <amodra@gmail.com>
215
216 PR 25900
217 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
218 accessing root.u.def of symbols. Also check root.u.def.section
219 is non-NULL. Reverse tests so as to make the logic positive.
220
a8acd6ee
AM
2212020-05-01 Alan Modra <amodra@gmail.com>
222
223 PR 25882
224 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
225 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
226
6b728d32
AM
2272020-05-01 Alan Modra <amodra@gmail.com>
228
229 PR 25882
230 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
231 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
232 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
233 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
234 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
235 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
236 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
237 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
238 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
239 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
240
91ed9b71
AM
2412020-05-01 Alan Modra <amodra@gmail.com>
242
243 PR 25882
244 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
245 from shared libraries.
246
d548f47d
MF
2472020-04-29 Max Filippov <jcmvbkbc@gmail.com>
248
249 * elf32-xtensa.c (relax_section): Don't negate diff_value for
250 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
251 equals 0. Report overflow when the result has negative sign but
252 all significant bits are zero.
253
dfa85db1
GN
2542020-04-29 Gunther Nikl <gnikl@justmail.de>
255
256 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
257 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
258
48e5bada
AM
2592020-04-28 Alan Modra <amodra@gmail.com>
260
261 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
262 Emit warning message.
263
251dae91
TC
2642020-04-27 Tamar Christina <tamar.christina@arm.com>
265
266 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
267 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
268 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
269 to x86_64_pe_big_vec as it not a big-endian format.
270 (vec i386_pe_big_vec): New.
271 * configure.ac: Likewise.
272 * targets.c: Likewise.
273 * configure: Regenerate.
274 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
275 COFF_WITH_PE_BIGOBJ): New.
276 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
277 New.
278 (x86_64_pe_be_vec): Moved.
279
27456742
AK
2802020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
281
282 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
283 * elf.c (elfcore_grok_arc_v2): New function.
284 (elfcore_grok_note): Call the new function to handle the corresponding
285 note.
286 (elfcore_write_arc_v2): New function.
287 (elfcore_write_register_note): Call the new function to handle the
288 corresponding pseudo-sections.
289
30ce8e47
MF
2902020-04-22 Max Filippov <jcmvbkbc@gmail.com>
291
292 PR ld/25861
293 * bfd-in2.h: Regenerated.
294 * elf32-xtensa.c (elf_howto_table): New entries for
295 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
296 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
297 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
298 R_XTENSA_NDIFF{8,16,32}.
299 * libbfd.h (bfd_reloc_code_real_names): Add names for
300 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
301 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
302 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
303 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
304
c36876fe
TC
3052020-04-21 Tamar Christina <tamar.christina@arm.com>
306
307 PR binutils/24753
308 * compress.c (bfd_get_full_section_contents): Exclude sections with no
309 content.
310
6f6fd151
L
3112020-04-21 H.J. Lu <hongjiu.lu@intel.com>
312
313 PR ld/25849
314 * elf-bfd.h (elf_backend_data): Add
315 elf_backend_strip_zero_sized_dynamic_sections.
316 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
317 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
318 New macro.
319 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
320 function.
321 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
322 New macro.
323 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
324
1f7f2abb
L
3252020-04-21 H.J. Lu <hongjiu.lu@intel.com>
326
327 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
328 sec.
329 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
330 DT_TEXTREL with -M.
331 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
332
e04f33c0
NC
3332020-04-21 Nick Clifton <nickc@redhat.com>
334
335 * po/sr.po: Updated Serbian translation.
336
fad3d2c1
AM
3372020-04-21 Alan Modra <amodra@gmail.com>
338
339 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
340 processing.
341
23c8270e
SC
3422020-04-20 Stephen Casner <casner@acm.org>
343
344 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
345 causing globals from linker script to be treated as debug symbols.
346 (translate_symbol_table): Don't sign-extend symbol values from 16
347 to 64 bits in nm output.
348
2efec98b
AM
3492020-04-20 Alan Modra <amodra@gmail.com>
350
351 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
352
18f97353
AM
3532020-04-18 Alan Modra <amodra@gmail.com>
354
355 * section.c (bfd_is_const_section): Correct test for special
356 sections.
357 * bfd-in2.h: Regenerate.
358
8d55d10a
AM
3592020-04-17 Alan Modra <amodra@gmail.com>
360
361 PR 25842
362 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
363 NULL nodename.
364
8e4979ac
NC
3652020-04-16 Nick Clifton <nickc@redhat.com>
366
367 PR 25803
368 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
369 abort with a more helpful error message.
370
aec72fda
AM
3712020-04-16 Alan Modra <amodra@gmail.com>
372
373 PR 25827
374 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
375 strdup(0).
376
95a51568
FS
3772020-04-15 Fangrui Song <maskray@google.com>
378
379 PR binutils/24613
380 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
381 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
382 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
383 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
384 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
385 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
386 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
387 * elf32-sh.c (sh_elf_relocate_section): Likewise.
388 * elf32-spu.c (spu_elf_relocate_section): Likewise.
389 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
390 * elflink.c (elf_link_output_extsym): Likewise.
391 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
392
7ecb5154
AM
3932020-04-15 Alan Modra <amodra@gmail.com>
394
395 PR 25823
396 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
397 pointer into strings that may be freed for section name, always
398 allocate a new string.
399
f717994f
JMG
4002020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
401 Jan W. Jagersma <jwjagersma@gmail.com>
402
403 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
404 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
405 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
406 (_bfd_go32_mkobject): New functions.
407 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
408 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
409 (go32exe_mkobject): Call _bfd_go32_mkobject.
410 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
411 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
412 and COFF_GO32.
413 (coff_write_relocs): Enable extended reloc counter code if
414 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
415 (coff_write_object_contents): Likewise. Pad section headers
416 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
417 instead of coff_swap_scnhdr_out.
418 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
419 enable extended reloc counter.
420 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
421 Declare with ATTRIBUTE_UNUSED.
422 * libcoff-in.h: (struct coff_tdata): New field go32.
423 (obj_go32): Define.
424 * libcoff.h: Regenerate.
425
34ca5531
FS
4262020-04-14 Fangrui Song <maskray@google.com>
427
428 PR gas/25768
429 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
430 12.
431
fa1477dc
SC
4322020-04-14 Stephen Casner <casner@acm.org>
433
434 PR ld/25677
435 * pdp11.c: Add implementation of --imagic option.
436 (adjust_o_magic): Fix objcopy --extract-symbol test.
437 * libaout.h (enum aout_magic): Add i_magic.
438
a0543b0b
RO
4392020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
440 Nick Clifton <nickc@redhat.com>
441
442 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
443 <0>: Ignore.
444 <default>: Error rather than abort.
445
3349112e
L
4462020-04-03 H.J. Lu <hongjiu.lu@intel.com>
447
448 PR ld/25767
449 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
450 relocation section from section group.
451
4d095f5b
JJ
4522020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
453
454 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
455 bfd->origin to file offset.
456 * bfdwin.c (bfd_get_file_window): Likewise.
457 * bfd.c: Clarify the use of the bfd->origin field.
458 * bfd-in2.h: Regenerate.
459 * coff-i386.c: Don't include go32exe.h. Allow overriding
460 coff_write_object_contents via COFF_WRITE_CONTENTS.
461 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
462 (go32exe_write_object_contents): New functions.
463 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
464 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
465 (create_go32_stub): Remove check for 2k size limit. Read stub
466 from go32exe_temp_stub if present.
467 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
468 copy variable-length stub.
469 (go32_check_format): Read stub to go32exe_temp_stub, set
470 origin, return go32exe_cleanup.
471 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
472 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
473 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
474 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
475 Remove functions and their associated #defines.
476 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
477 * libcoff-in.h: (struct coff_tdata): New field stub_size.
478 Rename field go32stub to stub.
479 * libcoff.h: Regenerate.
480 * coff-stgo32.c (go32_check_format): Rename to...
481 (go32exe_check_format): ...this.
482 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
483 (go32exe_copy_private_bfd_data): ...this.
484 (stub_bytes): Rename to...
485 (go32exe_default_stub): ...this.
486 (create_go32_stub): Rename to...
487 (go32exe_create_stub): ...this.
488 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
489 when possible.
490
382aae06
L
4912020-04-01 H.J. Lu <hongjiu.lu@intel.com>
492
493 PR ld/25749
494 PR ld/25754
495 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
496 relocation to R_386_32 for relocation against non-preemptible
497 absolute symbol.
498 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
499 allocate dynamic relocation for non-preemptible absolute symbol.
500 (elf_i386_relocate_section): Pass sec to
501 GENERATE_DYNAMIC_RELOCATION_P.
502 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
503 (elf_x86_64_convert_load_reloc): Covert load relocation to
504 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
505 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
506 for non-preemptible absolute symbol if they overflow.
507 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
508 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
509 symbol. Don't allocate dynamic relocation for non-preemptible
510 absolute symbol.
511 (elf_x86_64_relocate_section): Don't generate relative relocation
512 for GOTPCREL relocations aganst local absolute symbol. Pass sec
513 to GENERATE_DYNAMIC_RELOCATION_P.
514 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
515 against non-preemptible absolute symbol.
516 (_bfd_elf_x86_valid_reloc_p): New function.
517 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
518 GOT_ABS GOT slot.
519 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
520 argument. Don't generate dynamic relocation against
521 non-preemptible absolute symbol.
522 (ABS_SYMBOL_P): New.
523 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
524 against non-preemptible absolute symbol.
525 (GOT_ABS): New.
526 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
527 (_bfd_elf_x86_valid_reloc_p): New.
528
a7618269
TC
5292020-04-01 Tamar Christina <tamar.christina@arm.com>
530
531 PR ld/16017
532 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
533 address in the GOT if in thumb only mode.
534
15ccbdd7
TC
5352020-04-01 Tamar Christina <tamar.christina@arm.com>
536
537 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
538
7b948a25
HPN
5392020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
540
541 * mmo.c (mmo_scan): Create .text section only when needed, not
542 from the start.
543
89b599df
AM
5442020-03-31 Alan Modra <amodra@gmail.com>
545
546 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
547 return value check.
548
81699544
AM
5492020-03-31 Alan Modra <amodra@gmail.com>
550
551 * vms-alpha.c (image_write): Check bounds for sections without
552 contents too. Error on non-zero write to section without
553 contents.
554 (_bfd_vms_slurp_etir): Check return of image_write* functions.
555
b3b360de
AM
5562020-03-31 Alan Modra <amodra@gmail.com>
557
558 * tekhex.c (pass_over): Check is_eof before reading buffer.
559
00386881
NC
5602020-03-30 Nick Clifton <nickc@redhat.com>
561
562 PR binutils/pr25662
563 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
564 field to timestamp and make it an integer.
565 * libcoff.h: Regenerate.
566 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
567 field in the pe_data structure rather than the insert_timestamp
568 field.
569
988b7300
AM
5702020-03-30 Alan Modra <amodra@gmail.com>
571
572 PR 25745
573 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
574 statistics message.
575
aa49fc22
NC
5762020-03-26 Nick Clifton <nickc@redhat.com>
577
578 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
579 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
580 prototype.
581 * libbfd.h: Regenerate.
582
ff768510
AM
5832020-03-26 Alan Modra <amodra@gmail.com>
584
585 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
586
f75fbe8a
AM
5872020-03-26 Alan Modra <amodra@gmail.com>
588
589 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
590 array.
591 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
592
aac88046
NC
5932020-03-25 Nick Clifton <nickc@redhat.com>
594
595 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
596 function.
597 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
598 * libbfd.h: Regenerate.
599
cf2611fe
SV
6002020-03-25 Shahab Vahedi <shahab@synopsys.com>
601
602 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
603 correct field name in the output string.
604
d16e3d2e
AM
6052020-03-25 Alan Modra <amodra@gmail.com>
606
607 PR 25662
608 * elf.c (assign_file_positions_for_load_sections): Adjust offset
609 for SHT_NOBITS section if first in segment.
610
1081065c
L
6112020-03-24 H.J. Lu <hongjiu.lu@intel.com>
612
613 PR binutils/25708
614 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
615 (_bfd_elf_get_symbol_version_string): This.
616 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
617 (_bfd_elf_get_symbol_version_string): This.
618 (bfd_elf_print_symbol): Pass TRUE to
619 _bfd_elf_get_symbol_version_string.
620 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
621 bfd_boolean argument.
622 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
623 * targets.c (_bfd_get_symbol_version_string): Likewise.
624 (bfd_get_symbol_version_string): Likewise.
625 * bfd-in2.h: Regenerated.
626
0b8448af 6272020-03-24 Nick Clifton <nickc@redhat.com>
e11cd7c4 628 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
0b8448af
NC
629
630 PR 25713
631 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
632 Win32 systems.
633
ec2e748a
NC
6342020-03-24 Nick Clifton <nickc@redhat.com>
635
636 PR 25681
637 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
638 segment to use for PT_GNU_RELRO, ignore empty sections in a
639 segment's current list.
640
cda7e560
L
6412020-03-24 H.J. Lu <hongjiu.lu@intel.com>
642
643 PR binutils/25717
644 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
645
7e6e972f
L
6462020-03-24 H.J. Lu <hongjiu.lu@intel.com>
647
648 PR binutils/25708
649 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
650 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
651 on the previous _bfd_elf_get_symbol_version_string.
652 (_bfd_elf_get_symbol_version_string): Use it.
653
65109548
AM
6542020-03-24 Alan Modra <amodra@gmail.com>
655
656 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
657 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
658 struct areltdata.
659
fdde2fb6
SH
6602020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
661
662 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
663
cf28cfef
AM
6642020-03-23 Alan Modra <amodra@gmail.com>
665
666 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
667 symbol count. Allocate an extra byte to ensure name strings
668 are terminated. Sanity check name offsets. Release memory on
669 error return.
670
5e737279
AM
6712020-03-23 Alan Modra <amodra@gmail.com>
672
673 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
674 field hasn't been read. Remove unnecessary casts.
675
c15a8f17
AM
6762020-03-22 Alan Modra <amodra@gmail.com>
677
678 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
679 enough to read number of symbols.
680
3d98c460
L
6812020-03-20 H.J. Lu <hongjiu.lu@intel.com>
682
683 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
684 (EXECUTABLE_SUFFIX): Likewise.
685 * config.in: Regenerated.
686 * configure: Likewise.
687 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
688 _bfd_generic_close_and_cleanup.
689 (plugin_list_entry): Remove resolution_file, resolution_option,
690 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
691 lto_wrapper, gcc_env and initialized,
692 (need_lto_wrapper_p): Removed.
693 (get_lto_wrapper): Likewise.
694 (setup_lto_wrapper_env): Likewise.
695 (register_all_symbols_read): Likewise.
696 (egister_cleanup): Likewise.
697 (get_symbols): Likewise.
698 (add_input_file): Likewise.
699 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
700 (add_symbols): Updated.
701 (try_claim): Likewise.
702 (try_load_plugin): Likewise.
703 (bfd_plugin_canonicalize_symtab): Likewise.
704 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
705 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
706
c3a1714c
L
7072020-03-19 H.J. Lu <hongjiu.lu@intel.com>
708
709 PR binutils/25640
710 * plugin.c (plugin_list_entry): Add has_symbol_type.
711 (add_symbols_v2): New function.
712 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
713 provides symbol type.
714 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
715 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
716 available.
717
67338173
AM
7182020-03-20 Alan Modra <amodra@gmail.com>
719
720 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
721 enough to read number of symbols.
722
a859124d
AM
7232020-03-20 Alan Modra <amodra@gmail.com>
724
725 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
726 backend functions for NULL before calling.
727 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
728 (bfd_section_from_shdr, assign_section_numbers): Likewise.
729 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
730 * elfnn-ia64.c (ignore_errors): New function.
731 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
732
f3a08f77
NC
7332020-03-19 Nick Clifton <nickc@redhat.com>
734
735 PR 25676
736 * dwarf2.c (struct varinfo): Add unit_offset field to record the
737 location of the varinfo in the unit's debug info data. Change the
738 type of the stack field to a boolean.
739 (lookup_var_by_offset): New function. Returns the varinfo
740 structure for the variable described at the given offset in the
741 unit's debug info.
742 (scan_unit_for_symbols): Add support for variables which have the
743 DW_AT_specification attribute.
744
6a541707
NC
7452020-03-19 Nick Clifton <nickc@redhat.com>
746
747 PR 25699
748 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
749 error return.
750
effc14f5
SH
7512020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
752
753 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
754
ac4bf06c
NC
7552020-03-18 Nick Clifton <nickc@redhat.com>
756
757 PR 25673
758 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
759 memory access when processing a corrupt secondary reloc section.
760
53215f21
CL
7612020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
762
763 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
764 instead of calling abort.
765 * elf32-csky.c (csky_build_one_stub): Likewise.
766 * elf32-hppa.c (hppa_build_one_stub): Likewise.
767 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
768 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
769 * elf32-metag.c (metag_build_one_stub): Likewise.
770 * elf32-nios2.c (nios2_build_one_stub): Likewise.
771 * elf64-ppc.c (ppc_build_one_stub): Likewise.
772 (ppc_size_one_stub): Likewise.
773 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
774
327ef784
NC
7752020-03-17 Nick Clifton <nickc@redhat.com>
776
d3c3c542 777 PR 25688
327ef784
NC
778 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
779 with error messages.
780
ecbbbdba
NC
7812020-03-17 Nick Clifton <nickc@redhat.com>
782
783 PR 25687
784 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
785 free. Add free on another failure path.
786
4b3ecb3b
AM
7872020-03-16 Alan Modra <amodra@gmail.com>
788
789 PR 25675
790 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
791 we have a non-zero section count. Do lma comparison in octets.
792
7bac4137
AM
7932020-03-16 Alan Modra <amodra@gmail.com>
794
795 * vms-alpha.c (dst_restore_location): Validate index into
796 dst_ptr_offsets array before accessing. Return status.
797 (dst_retrieve_location): Similarly, making "loc" parameter a
798 pointer to return value.
799 (_bfd_vms_slurp_etir): Update calls to above functions.
800
8b5d0a4f
KR
8012020-03-14 Kamil Rytarowski <n54@gmx.com>
802
803 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
804 targets.
805 * configure: Regenerated.
806
48e81d7f
AM
8072020-03-14 Alan Modra <amodra@gmail.com>
808
809 * section.c (BFD_FAKE_SECTIONS): Formatting.
810 * bfd-in2.h: Regenerate.
811
06d949ec
KR
8122020-03-13 Kamil Rytarowski <n54@gmx.com>
813
814 * elf.c (elfcore_grok_netbsd_note): Add support for
815 NT_NETBSDCORE_LWPSTATUS notes.
816
abf874aa
CL
8172020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
818
819 * bfd-in2.h: Regenerate.
820 * section.c (asection): Add already_assigned field.
821 (BFD_FAKE_SECTION): Add default initializer for it.
822 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
823 * elf32-arm.c (arm_build_one_stub): Add support for
824 non_contiguous_regions.
825 * elf32-csky.c (csky_build_one_stub): Likewise.
826 * elf32-hppa.c (hppa_build_one_stub): Likewise.
827 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
828 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
829 * elf32-metag.c (metag_build_one_stub): Likewise.
830 * elf32-nios2.c (nios2_build_one_stub): Likewise.
831 * elf64-ppc.c (ppc_build_one_stub): Likewise.
832 (ppc_size_one_stub): Likewise.
833 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
834 * elflink.c (elf_link_input_bfd): Likewise.
835
74e10d17
L
8362020-03-13 H.J. Lu <hongjiu.lu@intel.com>
837
838 PR ld/24920
839 * elf-linker-x86.h (elf_linker_x86_params): Add
840 static_before_all_inputs and has_dynamic_linker.
841 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
842 dynamic input objects if -static is passed at command-line
843 before all input files without --dynamic-linker unless
844 --no-dynamic-linker is used.
845
015ec493
KR
8462020-03-13 Kamil Rytarowski <n54@gmx.com>
847
848 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
849
66631823
CE
8502020-03-13 Christian Eggers <ceggers@gmx.de>
851
852 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
853 "p_paddr" from "at".
854 * elfcode.h (bfd_from_remote_memory): Add units to several
855 parameters. New local "opb". Fix usage of p_align. Fix
856 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
857 call of target_read_memory.
858 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
859 calculation of "offset" and "output_offset".
860 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
861 from "offset" and fix calculation of "end" from "vma+size". Fix
862 comparison between "sh_addr" and "vma"/"output_offset".
863 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
864 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
865 member.
866 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
867 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
868 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
869 assignment of p_paddr from phdr_lma. Fix comparison between
870 "lma+size" and "next->lma".
871 (elf_sort_segments): Fix assignment from p_paddr to lma.
872 (assign_file_positions_for_load_sections): Add unit (bytes) to
873 local "align". Fix calculation of local "off_adjust". Fix
874 calculation of local "filehdr_vaddr".
875 (assign_file_positions_for_non_load_sections): New local "opb".
876 Fix calculation of "end" from "p_size". Fix comparison between
877 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
878 from "end" and "p_vaddr".
879 (rewrite_elf_program_header): Fix comparison between p_vaddr and
880 vma. Fix assignment to p_paddr from lma. Fix comparison between
881 p_paddr and lma. Fix assignment to p_paddr from lma.
882 * merge.c (sec_merge_emit): New local "opb". Convert
883 "alignment_power" to octets.
884 (_bfd_add_merge_section): New locals "alignment_power" and
885 "opb". Fix comparison between "alignment_power" and
886 "sizeof(align)".
887 (_bfd_merge_sections): New local "opb". Divide size by opb
888 before checking align mask.
889
502794d4
CE
8902020-03-13 Christian Eggers <ceggers@gmx.de>
891
892 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
893 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
894 section LMA/VMA.
895 (_bfd_elf_make_section_from_phdr): Similarly.
896 (elf_fake_sections): Fix calculation of
897 Elf_Internal_shdr::sh_addr from section VMA.
898 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
899 and bytes.
900 (assign_file_positions_for_load_sections): Fix calculations of
901 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
902 comparison between program header address and section LMA.
903 (assign_file_positions_for_non_load_sections): Likewise.
904 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
905 (IS_CONTAINED_BY_VMA): Add parameter opb.
906 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
907 INCLUDE_SECTION_IN_SEGMENT): Likewise.
908 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
909 Fix calculations of p_addr_valid and p_vaddr_offset.
910 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
911 with octets per byte when comparing against p_vaddr.
912
8248d21a
AM
9132020-03-11 Alan Modra <amodra@gmail.com>
914
915 * som.c (setup_sections): Sanity check subspace.name.
916
435edf0b
AM
9172020-03-11 Alan Modra <amodra@gmail.com>
918
919 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
920
6b5e16ff
AM
9212020-03-10 Alan Modra <amodra@gmail.com>
922
923 PR 25648
924 * ihex.c (ihex_write_object_contents): Don't assume ordering of
925 addresses here.
926
2f57795b
AM
9272020-03-09 Alan Modra <amodra@gmail.com>
928
929 * wasm-module.c (wasm_scan): Sanity check file name length
930 before allocating memory. Move common section setup code. Do
931 without bfd_tell to calculate section size.
932
a0dcf297
NC
9332020-03-06 Nick Clifton <nickc@redhat.com>
934
935 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
936 with error messages and failure return values.
937
e15a8da9
MF
9382020-03-05 Max Filippov <jcmvbkbc@gmail.com>
939
940 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
941 relocation sections for any removed reference to a dynamic symbol.
942
a8e14f4c
NC
9432020-03-05 Nick Clifton <nickc@redhat.com>
944
945 * elf-bfd.h (struct elf_backend_data): Add new fields:
946 init_secondary_reloc_section, slurp_secondary_reloc_section,
947 write_secondary_reloc_section.
948 (_bfd_elf_init_secondary_reloc_section): Prototype.
949 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
950 (_bfd_elf_write_secondary_reloc_section): Prototype.
951 * elf.c ( bfd_section_from_shdr): Invoke the new
952 init_secondary_reloc_section backend function, if defined, when a
953 second reloc section is encountered.
954 (swap_out_syms): Invoke the new symbol_section_index function, if
955 defined, when computing the section index of an OS/PROC specific
956 symbol.
957 (_bfd_elf_init_secondary_reloc_section): New function.
958 (_bfd_elf_slurp_secondary_reloc_section): New function.
959 (_bfd_elf_write_secondary_reloc_section): New function.
960 (_bfd_elf_copy_special_section_fields): New function.
961 * elfcode.h (elf_write_relocs): Invoke the new
962 write_secondary_relocs function, if defined, in order to emit
963 secondary relocs.
964 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
965 function, if defined, in order to read in secondary relocs.
966 * elfxx-target.h (elf_backend_copy_special_section_fields):
967 Provide a non-NULL default definition.
968 (elf_backend_init_secondary_reloc_section): Likewise.
969 (elf_backend_slurp_secondary_reloc_section): Likewise.
970 (elf_backend_write_secondary_reloc_section): Likewise.
971 (struct elf_backend_data elfNN_bed): Add initialisers for the new
972 fields.
973 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
974 * configure: Regenerate.
975
6f8f95b4
AM
9762020-03-05 Alan Modra <amodra@gmail.com>
977
978 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
979 against file size before allocating memory. Use bfd_alloc rather
980 than bfd_zalloc for carsym/strings memory.
981
233bf4f8
AM
9822020-03-04 Alan Modra <amodra@gmail.com>
983
984 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
985 sh_addr mod sh_addalign is zero.
986
1039fd9a
AM
9872020-03-04 Alan Modra <amodra@gmail.com>
988
989 * format.c (bfd_check_format_matches): Call cleanup on error exit.
990
f5714099
AM
9912020-03-03 Alan Modra <amodra@gmail.com>
992
993 * format.c (struct bfd_preserve): Add cleanup field.
994 (bfd_preserve_save): Add cleanup param and save.
995 (bfd_preserve_restore): Return cleanup.
996 (bfd_preserve_finish): Call the cleanup for the discarded match.
997 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
998 and clear when preserving a match. Restore cleanup too when
999 restoring that match.
1000
40b35c78
AM
10012020-03-02 Alan Modra <amodra@gmail.com>
1002
1003 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
1004 * hpux-core.c (hpux_core_core_file_p): Update prototype.
1005 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
1006 (core_sco5_vec): Correct initialisers.
1007
601b73d5
AM
10082020-03-02 Alan Modra <amodra@gmail.com>
1009
1010 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
1011 * aix5ppc-core.c (xcoff64_core_p): Likewise.
1012 * cisco-core.c (cisco_core_file_validate): Likewise.
1013 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
1014 * hpux-core.c (hpux_core_core_file_p): Likewise.
1015 * irix-core.c (irix_core_core_file_p): Likewise.
1016 * lynx-core.c (lynx_core_file_p): Likewise.
1017 * netbsd-core.c (netbsd_core_file_p): Likewise.
1018 * osf-core.c (osf_core_core_file_p): Likewise.
1019 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1020 * sco5-core.c (sco5_core_file_p): Likewise.
1021
728d32c4
L
10222020-03-02 H.J. Lu <hongjiu.lu@intel.com>
1023
1024 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
1025
cb001c0d
AM
10262020-03-02 Alan Modra <amodra@gmail.com>
1027
1028 * targets.c (bfd_cleanup): New typedef.
1029 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
1030 * libbfd-in.h (_bfd_no_cleanup): Define.
1031 * format.c (bfd_reinit): Add cleanup parameter, call it.
1032 (bfd_check_format_matches): Set cleanup from _bfd_check_format
1033 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
1034 * aout-target.h (callback, object_p): Return bfd_cleanup.
1035 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
1036 * archive.c (bfd_generic_archive_p): Likewise.
1037 * binary.c (binary_object_p): Likewise.
1038 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
1039 * coff-ia64.c (ia64coff_object_p): Likewise.
1040 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
1041 * coff-sh.c (coff_small_object_p): Likewise.
1042 * coff-stgo32.c (go32_check_format): Likewise.
1043 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
1044 (xcoff64_core_p): Likewise.
1045 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
1046 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
1047 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
1048 * elfcode.h (elf_object_p): Likewise.
1049 * elfcore.h (elf_core_file_p): Likewise.
1050 * i386msdos.c (msdos_object_p): Likewise.
1051 * ihex.c (ihex_object_p): Likewise.
1052 * libaout.h (some_aout_object_p): Likewise.
1053 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
1054 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
1055 * libbfd.c (_bfd_dummy_target): Likewise.
1056 * libcoff-in.h (coff_object_p): Likewise.
1057 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
1058 (bfd_mach_o_arm64_core_p): Likewise.
1059 * mach-o-arm.c (bfd_mach_o_arm_object_p),
1060 (bfd_mach_o_arm_core_p): Likewise.
1061 * mach-o-i386.c (bfd_mach_o_i386_object_p),
1062 (bfd_mach_o_i386_core_p): Likewise.
1063 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
1064 (bfd_mach_o_x86_64_core_p): Likewise.
1065 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
1066 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
1067 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
1068 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
1069 * mmo.c (mmo_object_p): Likewise.
1070 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
1071 * peicode.h (coff_real_object_p, pe_ILF_object_p),
1072 (pe_bfd_object_p): Likewise.
1073 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
1074 * ppcboot.c (ppcboot_object_p): Likewise.
1075 * rs6000-core.c (rs6000coff_core_p): Likewise.
1076 * som.c (som_object_setup, som_object_p): Likewise.
1077 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
1078 * tekhex.c (tekhex_object_p): Likewise.
1079 * vms-alpha.c (alpha_vms_object_p): Likewise.
1080 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
1081 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
1082 * wasm-module.c (wasm_object_p): Likewise.
1083 * xsym.c (bfd_sym_object_p): Likewise.
1084 * xsym.h (bfd_sym_object_p): Likewise.
1085 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
1086 return type.
1087 * pdp11.c (some_aout_object_p): Likewise.
1088 * plugin.c (register_ld_plugin_object_p): Update object_p
1089 parameter type.
1090 * plugin.h (register_ld_plugin_object_p): Likewise.
1091 * bfd-in2.h: Regenerate.
1092 * libbfd.h: Regenerate.
1093 * libcoff.h: Regenerate.
1094
a4dd6c97
AM
10952020-03-02 Alan Modra <amodra@gmail.com>
1096
1097 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
1098 applicable section flags.
1099 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
1100 (mips_ecoff_bele_vec): Likewise.
1101 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
1102 and .sbss sections.
1103 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
1104 (_bfd_ecoff_styp_to_sec_flags): Likewise.
1105
bf577467
AM
11062020-03-02 Alan Modra <amodra@gmail.com>
1107
1108 * elf32-m32r.c (m32r_elf_section_flags): New function.
1109 (elf_backend_section_flags): Define.
1110 * elf32-nds32.c (nds32_elf_section_flags): New function.
1111 (elf_backend_section_flags): Define.
1112 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
1113 .sbss and .sdata sections.
1114 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
1115 for SHF_V850_GPREL sections.
1116 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
1117 FIXME.
1118 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
1119 for SHF_PARISC_SHORT sections.
1120 * elf64-ppc.c (ppc64_elf_section_flags): New function.
1121 (elf_backend_section_flags): Define.
1122 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
1123 for SHF_MIPS_GPREL sections. Delete FIXME.
1124
8c803a2d
AM
11252020-03-02 Alan Modra <amodra@gmail.com>
1126
1127 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
1128 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
1129 calling elf_backend_section_flags with adjusted params. Use
1130 newsect->flags past that point.
1131 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
1132 special sections.
1133 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
1134 to have their type overridden, and all sh_flags but processor and
1135 os specific.
1136 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
1137 * elf32-mep.c (mep_elf_section_flags): Likewise.
1138 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
1139 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
1140 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
1141 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
1142 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
1143 stub BFD and non-aarch64 input files when scanning for stubs.
1144
7d4b2d2d
AM
11452020-03-02 Alan Modra <amodra@gmail.com>
1146
1147 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
1148 limit to decompressed element size.
1149
26f60d59
AM
11502020-03-02 Alan Modra <amodra@gmail.com>
1151
1152 * vms-lib.c (vms_traverse_index): Add recur_count param and
1153 update calls. Fail on excessive recursion.
1154
9cb56943
AM
11552020-03-02 Alan Modra <amodra@gmail.com>
1156
1157 * vms-alpha.c (vms_get_remaining_object_record): Use
1158 bfd_realloc_or_free rather than bfd_realloc.
1159 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
1160 (dst_define_location, parse_module): Likewise, and check realloc
1161 return status before using memory. Return status from function
1162 adjusting all callers.
1163
182ec670
AM
11642020-02-28 Alan Modra <amodra@gmail.com>
1165
1166 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
1167
1b088c82
AM
11682020-02-28 Alan Modra <amodra@gmail.com>
1169
1170 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
1171 Remove duplicate undersize check.
1172
5f602802
AM
11732020-02-27 Alan Modra <amodra@gmail.com>
1174
1175 PR 24511
1176 * mmo.c (mmo_scan): Set SEC_DATA for .data.
1177
49d9fd42
AM
11782020-02-27 Alan Modra <amodra@gmail.com>
1179
1180 PR 24511
1181 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
1182 (coff_section_type): Adjust comment.
1183 (decode_section_type): Likewise. Call coff_section_type before
1184 decode_section_type.
1185 (bfd_decode_symclass): Use 'c' for common sections other than
1186 the standard one.
1187
05f52dc2
AM
11882020-02-27 Alan Modra <amodra@gmail.com>
1189
1190 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
1191 malloc'd block.
1192
ff69a894
AM
11932020-02-27 Alan Modra <amodra@gmail.com>
1194
1195 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
1196 if file is an archive element.
1197 * bfd-in2.h: Regenerate.
1198
02f7e7ee
AM
11992020-02-26 Alan Modra <amodra@gmail.com>
1200
1201 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
1202 bfd_set_error on failing test. Don't bother changing bfd_error on
1203 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
1204 Check sym name is within string buffer. Use size_t for some vars.
1205 (do_slurp_coff_armap): Use size_t for some variables, fix size of
1206 int_buf. Don't change bfd_error on file read error. Use
1207 _bfd_mul_overflow when calculating carsym buffer size. Reorder
1208 calculations to catch overflows before they occur. malloc and
1209 free raw armap rather than using bfd_alloc. Read raw armap before
1210 allocating carsym+strings buffer.
1211 (_bfd_slurp_extended_name_table): Localize variables. Check
1212 name size against file size.
1213
cc4c4f40
AM
12142020-02-26 Alan Modra <amodra@gmail.com>
1215
1216 * vms-lib.c (vms_lib_read_index): Release correct buffer.
1217
e0b317de
AM
12182020-02-26 Alan Modra <amodra@gmail.com>
1219
1220 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
1221 malloc. Check for NULL return from bfd_malloc.
1222 (rx_table_find, rx_table_map): Likewise.
1223 (rx_set_section_contents): Check bfd_alloc return.
1224 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
1225
dc1e8a47
AM
12262020-02-26 Alan Modra <amodra@gmail.com>
1227
1228 * aoutx.h: Indent labels correctly. Format error strings.
1229 * archive.c: Likewise.
1230 * archive64.c: Likewise.
1231 * coff-arm.c: Likewise.
1232 * coff-rs6000.c: Likewise.
1233 * coff-stgo32.c: Likewise.
1234 * cpu-arm.c: Likewise.
1235 * dwarf2.c: Likewise.
1236 * elf-ifunc.c: Likewise.
1237 * elf-properties.c: Likewise.
1238 * elf-s390-common.c: Likewise.
1239 * elf-strtab.c: Likewise.
1240 * elf.c: Likewise.
1241 * elf32-arm.c: Likewise.
1242 * elf32-bfin.c: Likewise.
1243 * elf32-cr16.c: Likewise.
1244 * elf32-csky.c: Likewise.
1245 * elf32-i386.c: Likewise.
1246 * elf32-m68k.c: Likewise.
1247 * elf32-msp430.c: Likewise.
1248 * elf32-nds32.c: Likewise.
1249 * elf32-nios2.c: Likewise.
1250 * elf32-pru.c: Likewise.
1251 * elf32-xtensa.c: Likewise.
1252 * elf64-ia64-vms.c: Likewise.
1253 * elf64-x86-64.c: Likewise.
1254 * elfcode.h: Likewise.
1255 * elfcore.h: Likewise.
1256 * elflink.c: Likewise.
1257 * elfnn-aarch64.c: Likewise.
1258 * elfnn-ia64.c: Likewise.
1259 * elfnn-riscv.c: Likewise.
1260 * elfxx-mips.c: Likewise.
1261 * elfxx-sparc.c: Likewise.
1262 * elfxx-x86.c: Likewise.
1263 * i386lynx.c: Likewise.
1264 * merge.c: Likewise.
1265 * pdp11.c: Likewise.
1266 * plugin.c: Likewise.
1267 * reloc.c: Likewise.
1268
e310298c
AM
12692020-02-26 Alan Modra <amodra@gmail.com>
1270
1271 PR 25593
1272 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
1273 "dyn_loaded".
1274 (bfd_elf_add_dt_needed_tag): Declare.
1275 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
1276 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
1277 from elf_add_dt_needed_tag. Remove soname and doit param.
1278 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
1279 to see whether as-needed lib is already loaded, use dyn_loaded
1280 list instead. When saving and restoring around as-needed lib
1281 handle possibility that dynstr has not been initialised. Don't
1282 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
1283 Mark libs loaded via DT_NEEDED entries of other libs with
1284 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
1285 the output.
1286 (elf_link_check_versioned_symbol): Remove now unneccesary
1287 DYNAMIC check when traversing dyn_loaded list.
1288
b570b954
AM
12892020-02-26 Alan Modra <amodra@gmail.com>
1290
1291 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
1292
ecda9016
L
12932020-02-25 H.J. Lu <hongjiu.lu@intel.com>
1294
1295 PR binutils/25584
1296 * plugin.c (need_lto_wrapper_p): New.
1297 (bfd_plugin_set_program_name): Add an int argument to set
1298 need_lto_wrapper_p.
1299 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
1300 set.
1301 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
1302
a98c743f
AM
13032020-02-24 Alan Modra <amodra@gmail.com>
1304
1305 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
1306
c893ce36
AM
13072020-02-24 Alan Modra <amodra@gmail.com>
1308
1309 * vms-lib.c (struct carsym_mem): Add limit.
1310 (vms_add_index): Heed limit.
1311 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
1312 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
1313 Always return actual number read.
1314 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
1315 assertion with error exit.
1316
7b3c2715
AM
13172020-02-22 Alan Modra <amodra@gmail.com>
1318
1319 PR 25585
1320 * elf.c (assign_file_positions_for_load_sections): Continue linking
1321 on "PHDR segment not covered by LOAD segment" errors.
1322
a4425a57
AM
13232020-02-21 Alan Modra <amodra@gmail.com>
1324
1325 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
1326 overflow check.
1327 (bfd_mach_o_canonicalize_reloc): Likewise.
1328 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
1329 counts and offsets against file size.
1330 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
1331 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
1332 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
1333 against file size. Delete symbol table error message.
1334 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
1335 against file size.
1336 (bfd_mach_o_read_symtab): Likewise.
1337 (bfd_mach_o_read_command): Pass file size.
1338 (bfd_mach_o_scan): Sanity check command count against file size.
1339
dda2980f
AM
13402020-02-21 Alan Modra <amodra@gmail.com>
1341
1342 PR 25569
1343 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
1344 "text", "data" and "bss" section pointer vars. Don't update
1345 section size, just exec header sizes.
1346 (adjust_sizes_and_vmas): Don't update text section size. Set
1347 initial exec header a_text. Print exec headers sizes.
1348 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
1349 (adjust_sizes_and_vmas): Similarly. Formatting.
1350 (final_link): Correct final file extension.
1351
00e49dff
NC
13522020-02-20 Nick Clifton <nickc@redhat.com>
1353
1354 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
1355 callback.
1356 * elfxx-target.h (elf_backend_symbol_section_index): Provide
1357 default definition.
1358 (elfNN_bed): Initialise the symbol_section_index field.
1359 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
1360 OS and PROC specific section indicies. Warn if converting other
1361 reserved incidies to SHN_ABS.
1362
fcaaac0a
SB
13632020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
1364
1365 PR 25537
1366 * cpu-z80.c: Add machine type compatibility checking.
1367
dcf06b89
L
13682020-02-19 H.J. Lu <hongjiu.lu@intel.com>
1369
1370 PR binutils/25355
1371 * plugin.c (plugin_list_entry): Remove handle.
1372 (try_load_plugin): Call dlclose before return.
1373
2c7c5554
AM
13742020-02-19 Alan Modra <amodra@gmail.com>
1375
1376 * libbfd-in.h (_bfd_constant_p): Define.
1377 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
1378 file size before allocating memory.
1379 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
1380 * elf.c (bfd_elf_get_str_section): Likewise.
1381 (_bfd_elf_slurp_version_tables): Likewise.
1382 * libbfd.h: Regenerate.
1383
2bb3687b
AM
13842020-02-19 Alan Modra <amodra@gmail.com>
1385
1386 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
1387 * aoutx.h (aout_get_external_symbols): Replace calls to
1388 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
1389 (slurp_reloc_table): Likewise.
1390 * archive.c (do_slurp_bsd_armap): Likewise.
1391 (do_slurp_coff_armap): Likewise.
1392 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
1393 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
1394 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
1395 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
1396 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
1397 (_bfd_coff_get_external_symbols): Likewise.
1398 * ecoff.c (ecoff_slurp_symbolic_header),
1399 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
1400 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
1401 (ecoff_indirect_link_order): Likewise.
1402 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
1403 (_bfd_elf_slurp_version_tables): Likewise.
1404 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1405 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1406 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1407 * elf64-alpha.c (READ): Likewise.
1408 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
1409 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
1410 * elfcode.h (elf_slurp_symbol_table),
1411 (elf_slurp_reloc_table_from_section): Likewise.
1412 * elflink.c (elf_link_add_object_symbols),
1413 (elf_link_check_versioned_symbol): Likewise.
1414 * elfxx-mips.c (READ): Likewise.
1415 * i386lynx.c (slurp_reloc_table): Likewise.
1416 * lynx-core.c (lynx_core_file_p): Likewise.
1417 * mach-o.c (bfd_mach_o_canonicalize_relocs),
1418 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
1419 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
1420 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
1421 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
1422 (bfd_pef_parse_symbols): Likewise.
1423 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
1424 * som.c (setup_sections, som_slurp_string_table),
1425 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1426 (som_bfd_fill_in_ar_symbols): Likewise.
1427 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
1428 (evax_bfd_print_image): Likewise.
1429 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
1430 * wasm-module.c (wasm_scan): Likewise.
1431 * xcofflink.c (xcoff_link_add_symbols): Likewise.
1432 * xsym.c (bfd_sym_read_name_table),
1433 (bfd_sym_print_type_information_table_entry): Likewise.
1434 * libbfd.h: Regenerate.
1435
806470a2
AM
14362020-02-19 Alan Modra <amodra@gmail.com>
1437
1438 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
1439 reading external relocs.
1440 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
1441 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
1442 after bfd_bread.
1443 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
1444 bfd_release.
1445 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
1446 (m32c_elf_relax_section): Likewise.
1447 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
1448 (rl78_elf_relax_section): Likewise.
1449 * elf32-rx.c (rx_offset_for_reloc): Likewise.
1450 (elf32_rx_relax_section): Likewise.
1451 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
1452 parameter types and use..
1453 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
1454 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
1455 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
1456 being read from file, just the extra.
1457 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
1458 after reading external syms. Free on failure.
1459
1f4361a7
AM
14602020-02-19 Alan Modra <amodra@gmail.com>
1461
1462 * coffcode.h (buy_and_read, coff_slurp_line_table),
1463 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
1464 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
1465 corresponding bfd_alloc call. Adjust variables to suit.
1466 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1467 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
1468 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
1469 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
1470 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
1471 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1472 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1473 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1474 * elf64-alpha.c (READ): Likewise.
1475 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
1476 (elf_slurp_symbol_table, elf_slurp_reloc_table),
1477 (bfd_from_remote_memory): Likewise.
1478 * elfcore.h (core_find_build_id): Likewise.
1479 * elfxx-mips.c (READ): Likewise.
1480 * mach-o.c (bfd_mach_o_mangle_sections),
1481 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
1482 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
1483 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
1484 * som.c (setup_sections, som_prep_for_fixups)
1485 (som_build_and_write_symbol_table, som_slurp_symbol_table),
1486 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1487 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
1488 (som_bfd_ar_write_symbol_stuff): Likewise.
1489 * vms-alpha.c (vector_grow1): Likewise.
1490 * vms-lib.c (vms_add_index): Likewise.
1491 * wasm-module.c (wasm_scan_name_function_section): Likewise.
1492 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
1493 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
1494 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
1495 (bfd_alloc2, bfd_zalloc2): Delete.
1496 (_bfd_mul_overflow): Define.
1497 * libbfd.h: Regenerate.
1498
446f7ed5
AM
14992020-02-19 Alan Modra <amodra@gmail.com>
1500
1501 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
1502 bfd_zalloc2.
1503 (assign_section_numbers): Likewise.
1504 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
1505 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
1506 bfd_malloc2, size_t amt, and unsigned tls_count.
1507 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
1508 * elflink.c (elf_create_symbuf): Use bfd_malloc.
1509 (elf_output_implib): Use bfd_alloc.
1510
b03202e3
AM
15112020-02-19 Alan Modra <amodra@gmail.com>
1512
1513 * bfd.c (struct bfd): Move format and direction to other
1514 bitfields. Add "size".
1515 * bfdio.c (bfd_get_size): Cache size when not writing file.
1516 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
1517 returning zero, ie. unknown.
1518 (bfd_get_alt_debug_link_info): Likewise.
1519 * bfd-in2.h: Regenerate.
1520
7c5fa58e
AM
15212020-02-19 Alan Modra <amodra@gmail.com>
1522
1523 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
1524 bfd_get_file_size twice.
1525 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
1526 zero, ie. unknown, return.
1527 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
1528 * elfcode.h (elf_swap_shdr_in): Likewise.
1529 (elf_object_p): Don't call bfd_get_file_size twice and correct
1530 file size check.
1531
96d3b80f
AM
15322020-02-19 Alan Modra <amodra@gmail.com>
1533
1534 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
1535 FALSE if memory alloc fails. Adjust calls.
1536 * som.c (som_prep_for_fixups): Likewise.
1537 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
1538 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
1539 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
1540 * som.c (som_build_and_write_symbol_table): Return via error_return
1541 on seek failure.
1542 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
1543 (VEC_APPEND_EL): Delete.
1544 (vector_grow1): Return pointer to element. Catch overflow.
1545 Return NULL on memory allocation failure.
1546 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
1547 (alpha_vms_add_fixup_ca): Likewise.
1548 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
1549 before using.
1550 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
1551
986f0783
AM
15522020-02-19 Alan Modra <amodra@gmail.com>
1553
1554 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
1555 * aout-target.h (object_p): Likewise.
1556 * aout-tic30.c (tic30_aout_object_p): Likewise.
1557 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
1558 (emit_stringtab, write_syms, link_hash_table_create),
1559 (aout_link_write_other_symbol): Likewise.
1560 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
1561 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
1562 (_bfd_compute_and_write_armap): Likewise.
1563 * archures.c (bfd_arch_list): Likewise.
1564 * bfd.c (bfd_record_phdr): Likewise.
1565 * binary.c (binary_canonicalize_symtab): Likewise.
1566 * cisco-core.c (cisco_core_file_validate): Likewise.
1567 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
1568 (find_arm_glue, record_arm_to_thumb_glue),
1569 (record_thumb_to_arm_glue): Likewise.
1570 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
1571 (ppc_allocate_toc_section): Likewise.
1572 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
1573 * coff-sh.c (sh_relax_section): Likewise.
1574 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
1575 * coffcode.h (handle_COMDAT, coff_new_section_hook),
1576 (coff_set_alignment_hook, coff_mkobject),
1577 (coff_compute_section_file_positions): Likewise.
1578 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
1579 (coff_find_nearest_line_with_names),
1580 ( bfd_coff_set_symbol_class): Likewise.
1581 * cofflink.c (_bfd_coff_link_hash_table_create),
1582 (_bfd_coff_link_input_bfd): Likewise.
1583 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
1584 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
1585 (build_line_info_table, sort_line_sequences),
1586 (line_info_add_include_dir, line_info_add_file_name),
1587 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
1588 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
1589 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
1590 (_bfd_ecoff_find_nearest_line),
1591 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
1592 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
1593 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
1594 * elf-m10300.c (mn10300_elf_relax_section),
1595 (elf32_mn10300_link_hash_table_create): Likewise.
1596 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
1597 * elf.c (make_mapping, copy_elf_program_header): Likewise.
1598 * elf32-arm.c (elf32_arm_link_hash_table_create),
1599 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
1600 (elf32_arm_new_section_hook): Likewise.
1601 * elf32-avr.c (elf_avr_new_section_hook),
1602 (elf32_avr_link_hash_table_create, get_local_syms),
1603 (elf32_avr_setup_section_lists): Likewise.
1604 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
1605 (bfin_link_hash_table_create): Likewise.
1606 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
1607 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
1608 * elf32-csky.c (csky_elf_link_hash_table_create),
1609 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
1610 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
1611 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
1612 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
1613 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1614 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
1615 * elf32-m32r.c (m32r_elf_link_hash_table_create),
1616 (m32r_elf_check_relocs): Likewise.
1617 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
1618 (elf32_m68hc11_setup_section_lists),
1619 (elf32_m68hc11_size_stubs): Likewise.
1620 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
1621 * elf32-metag.c (elf_metag_link_hash_table_create),
1622 (elf_metag_setup_section_lists): Likewise.
1623 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
1624 (microblaze_elf_check_relocs): Likewise.
1625 * elf32-nds32.c (nds32_elf_link_hash_table_create),
1626 (nds32_elf_check_relocs): Likewise.
1627 * elf32-nios2.c (nios2_elf32_setup_section_lists),
1628 (get_local_syms, nios2_elf32_check_relocs),
1629 (nios2_elf32_link_hash_table_create): Likewise.
1630 * elf32-or1k.c (or1k_elf_link_hash_table_create),
1631 (or1k_elf_check_relocs): Likewise.
1632 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
1633 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
1634 * elf32-s390.c (elf_s390_link_hash_table_create),
1635 (elf_s390_check_relocs): Likewise.
1636 * elf32-score.c (score_elf_create_got_section),
1637 (s3_elf32_score_new_section_hook),
1638 (elf32_score_link_hash_table_create): Likewise.
1639 * elf32-score7.c (score_elf_create_got_section),
1640 (s7_elf32_score_new_section_hook): Likewise.
1641 * elf32-sh.c (sh_elf_link_hash_table_create),
1642 (sh_elf_check_relocs): Likewise.
1643 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
1644 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
1645 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
1646 (tilepro_elf_check_relocs): Likewise.
1647 * elf32-v850.c (remember_hi16s_reloc): Likewise.
1648 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
1649 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
1650 (elf_xtensa_new_section_hook): Likewise.
1651 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
1652 (get_got_entry, elf64_alpha_check_relocs): Likewise.
1653 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
1654 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
1655 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
1656 * elf64-ppc.c (ppc64_elf_new_section_hook),
1657 (ppc64_elf_link_hash_table_create, update_local_sym_info),
1658 (update_plt_info, ppc64_elf_check_relocs): Likewise.
1659 * elf64-s390.c (elf_s390_link_hash_table_create),
1660 (elf_s390_check_relocs): Likewise.
1661 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1662 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
1663 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
1664 (elf_link_add_archive_symbols, compute_bucket_count),
1665 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
1666 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
1667 (bfd_elf_final_link): Likewise.
1668 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
1669 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
1670 (elfNN_aarch64_new_section_hook): Likewise.
1671 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
1672 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
1673 (riscv_elf_check_relocs): Likewise.
1674 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
1675 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
1676 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
1677 (_bfd_mips_elf_link_hash_table_create): Likewise.
1678 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
1679 (_bfd_sparc_elf_check_relocs),
1680 (_bfd_sparc_elf_new_section_hook): Likewise.
1681 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
1682 (tilegx_elf_check_relocs): Likewise.
1683 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1684 * format.c (bfd_check_format_matches): Likewise.
1685 * hash.c (_bfd_stringtab_init): Likewise.
1686 * ihex.c (ihex_scan): Likewise.
1687 * irix-core.c (irix_core_core_file_p): Likewise.
1688 * linker.c (bfd_wrapped_link_hash_lookup),
1689 (_bfd_generic_link_hash_table_create),
1690 (_bfd_generic_reloc_link_order): Likewise.
1691 * lynx-core.c (lynx_core_file_p): Likewise.
1692 * netbsd-core.c (netbsd_core_file_p): Likewise.
1693 * osf-core.c (osf_core_core_file_p): Likewise.
1694 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
1695 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
1696 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
1697 * peicode.h (pe_mkobject): Likewise.
1698 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
1699 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1700 * sco5-core.c (read_uarea): Likewise.
1701 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
1702 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
1703 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
1704 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
1705 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
1706 * srec.c (srec_scan): Likewise.
1707 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
1708 * targets.c (bfd_target_list): Likewise.
1709 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
1710 * trad-core.c (trad_unix_core_file_p): Likewise.
1711 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
1712 (vms_new_section_hook): Likewise.
1713 * wasm-module.c (wasm_make_empty_symbol): Likewise.
1714 * xcofflink.c (xcoff_get_section_contents),
1715 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
1716 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
1717 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
1718
2d0e1217
AM
17192020-02-19 Alan Modra <amodra@gmail.com>
1720
1721 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
1722
99845b3b
L
17232020-02-13 H.J. Lu <hongjiu.lu@intel.com>
1724
1725 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
1726 and use it if it isn't NULL. Remove has_plugin_p argument. Add
1727 a build_list_p argument. Don't search plugin_list. Short circuit
1728 when building the plugin list.
1729 (has_plugin): Renamed to has_plugin_list.
1730 (bfd_plugin_set_plugin): Don't set has_plugin.
1731 (bfd_plugin_specified_p): Check plugin_list instead.
1732 (build_plugin_list): New function.
1733 (load_plugin): Call build_plugin_list and use plugin_list.
1734
22fe7df8
L
17352020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1736
1737 PR binutils/25355
1738 * plugin.c (try_claim): Always clean up for LTO wrapper.
1739 (try_load_plugin): Treat each object as independent. Create a
1740 copy for plugin name.
1741
c675ec1e
NC
17422020-02-11 Nick Clifton <nickc@redhat.com>
1743
1744 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
1745 for addresses in print statements.
1746 (msp430_elf_relax_delete_bytes): Likewise.
1747 (msp430_elf_relax_add_words): Likewise.
1748 (msp430_elf_relax_section): Likewise.
1749
1d07a805
L
17502020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1751
1752 * plugin.c (add_symbols): Clear plugin_data memory.
1753
0aa99dcd
L
17542020-02-10 H.J. Lu <hongjiu.lu@intel.com>
1755
1756 PR binutils/25355
1757 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
1758 (EXECUTABLE_SUFFIX): Likewise.
1759 * config.in: Regenerated.
1760 * configure: Likewise.
1761 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
1762 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
1763 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
1764 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
1765 (get_lto_wrapper): New.
1766 (setup_lto_wrapper_env): Likewise.
1767 (current_plugin): Likewise.
1768 (register_all_symbols_read): Likewise.
1769 (register_cleanup): Likewise.
1770 (get_symbols): Likewise.
1771 (add_input_file): Likewise.
1772 (bfd_plugin_close_and_cleanup): Likewise.
1773 (claim_file): Removed.
1774 (register_claim_file): Set current_plugin->claim_file.
1775 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
1776 lto_syms in current_plugin.
1777 (try_claim): Use current_plugin->claim_file. Call LTO plugin
1778 all_symbols_read handler. Copy real symbols to plugin_data.
1779 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
1780 (try_load_plugin): Don't reuse the previous plugin for LTO
1781 wrapper. Set up GCC LTO wrapper if possible. Don't set
1782 plugin_list_iter->claim_file.
1783 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
1784 possible.
1785 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
1786 real_syms.
1787
ac4280da
JL
17882020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1789
1790 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
1791 check if previous instruction matches a conditional jump inserted
1792 earlier. Invert conditional jump and delete branch in this case.
1793
8d6cb116
JL
17942020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1795
1796 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
1797 msp430_elf_relax_add_words. Support insertion of either one or two
1798 words.
1799 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
1800 needs to be grown. Handle insertion of branch instruction to replace
1801 jump.
1802
d60f5448
JL
18032020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1804
1805 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
1806 debugging relocations.
1807 (msp430_elf_relax_delete_bytes): Likewise.
1808 (msp430_elf_relax_add_two_words): Likewise.
1809 (msp430_elf_relax_section): Likewise.
1810
e1f85e11
AM
18112020-02-10 Alan Modra <amodra@gmail.com>
1812
1813 * archures.c: Wrap overlong z80 comments.
1814 * bfd-in2.h: Regenerate.
1815
9fc0b501
SB
18162020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
1817
1818 PR 25469
1819 * archures.c: Add GBZ80 and Z80N machine values.
1820 * reloc.c: Add BFD_RELOC_Z80_16_BE.
1821 * coff-z80.c: Add support for new reloc.
1822 * coffcode.h: Add support for new machine values.
1823 * cpu-z80.c: Add support for new machine names.
1824 * elf32-z80.c: Add support for new reloc.
1825 * bfd-in2.h: Regenerate.
1826 * libbfd.h: Regenerate.
1827
9984857c
NC
18282020-02-07 Nick Clifton <nickc@redhat.com>
1829
1830 PR 23932
1831 * elf.c (rewrite_elf_program_header): Do not complain if no
1832 sections are mapped to a segment.
1833
5242a0a0
L
18342020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1835
1836 PR ld/25490
1837 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
1838 for garbage collection on __patchable_function_entries section
1839 without linked-to section.
1840
b7d07216
L
18412020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1842
1843 PR gas/25381
1844 * bfd-in2.h: Regenerated.
1845 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
1846 on section if gc_mark of any of its linked-to sections is set
1847 and don't set gc_mark again.
1848 * section.c (asection): Add linked_to_symbol_name to map_head
1849 union.
1850
b93a662b
MR
18512020-02-06 Maciej W. Rozycki <macro@wdc.com>
1852
1853 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
1854 reporting an unrecognized instruction with R_V850_LONGJUMP.
1855
6df4c9c2
AM
18562020-02-05 Alan Modra <amodra@gmail.com>
1857
1858 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
1859
24872cb3
AM
18602020-02-04 Alan Modra <amodra@gmail.com>
1861
1862 * elf32-ppc.c (ppc_elf_relocate_section): After applying
1863 R_PPC_VLE_ADDR20, goto copy_reloc.
1864
ef4627fa
L
18652020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1866
1867 * bfd-in2.h: Regenerated.
1868 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
1869
a8c4d40b
L
18702020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1871
1872 PR gas/25380
1873 * bfd-in2.h: Regenerated.
1874 * ecoff.c (bfd_debug_section): Add section_id.
1875 * section.c (bfd_section): Add section_id.
1876 (SEC_ASSEMBLER_SECTION_ID): New.
1877 (BFD_FAKE_SECTION): Add section_id.
1878
5a9212a1
NC
18792020-02-01 Nick Clifton <nickc@redhat.com>
1880
1881 * config.bfd: Move the c30-aout and tic30-aout targets onto the
1882 obsolete list.
1883
e7cbe0c4
SL
18842020-01-31 Sandra Loosemore <sandra@codesourcery.com>
1885
1886 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
1887 encodings are relative to the GOT on nios2, too.
1888
72ebe8c5
AM
18892020-01-31 Alan Modra <amodra@gmail.com>
1890
1891 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
1892 file. Use $< and $@ in rules.
1893 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
1894 (elf32-ia64.c, elf64-ia64.c): Likewise.
1895 (elf32-riscv.c, elf64-riscv.c): Likewise.
1896 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1897 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
1898 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
1899 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
1900 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1901 * Makefile.in: Regenerate.
1902
327301a4
AM
19032020-01-31 Alan Modra <amodra@gmail.com>
1904
1905 PR 4110
1906 * elf.c (setup_group): Don't clear entire section contents,
1907 just the padding after group flags. Release alloc'd memory
1908 after a seek or read failure.
1909
b5d36aaa
JT
19102020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1911
1912 * peXXigen.c (pe_is_repro): New function.
1913 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
1914 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
1915
1957ab10
JT
19162020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1917
1918 * peXXigen.c (debug_type_names): Add names for new debug data type
1919 values.
1920
87b2920f
JT
19212020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1922
1923 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
1924 inner loop. Fix a memory leak.
1925
72913831
AM
19262020-01-30 Alan Modra <amodra@gmail.com>
1927
1928 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
1929 or obj_coff_keep_strings here.
1930 (coff_get_normalized_symtab): Free external syms directly.
1931 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
1932 on error exit path.
1933
c35d018b
JW
19342020-01-27 Jim Wilson <jimw@sifive.com>
1935
1936 * cpu-riscv.c (riscv_scan): New.
1937 (N): Change bfd_default_scan to riscv_scan.
1938
086b06f3
AS
19392020-01-27 Andreas Schwab <schwab@suse.de>
1940
1941 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
1942 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
1943 * Makefile.in: Regenerate.
1944 * cpu-plugin.c: Remove.
1945 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
1946 (bfd_plugin_arch): Remove declaration.
1947 * bfd-in2.h: Regenerate.
1948 * po/SRC-POTFILES.in: Regenerate.
1949
3024a17a
AM
19502020-01-27 H.J. Lu <hongjiu.lu@intel.com>
1951 Alan Modra <amodra@gmail.com>
1952
1953 PR ld/25458
1954 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
1955
b5f998b2
JW
19562020-01-24 Jim Wilson <jimw@sifive.com>
1957
1958 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
1959 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
1960 avoid over long line.
1961
caa31cfa
NC
19622020-01-24 Nick Clifton <nickc@redhat.com>
1963
1964 PR 25447
1965 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
1966 syms and keep strings flags as these may have been set in order to
1967 prevent a bogus call to free.
1968
24e648d4
NC
19692020-01-23 Nick Clifton <nickc@redhat.com>
1970
1971 * po/fr.po: Updated French translation.
1972
67641dd3
AM
19732020-01-23 Alan Modra <amodra@gmail.com>
1974
1975 PR 25444
1976 * elf.c (assign_file_positions_for_load_sections): Avoid divide
1977 by zero when p_align is zero.
1978
403d1bd9
JW
19792020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
1980
1981 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
1982 (riscv_prefix_cmp): Likewise.
1983 (riscv_non_std_ext_p): Deleted.
1984 (riscv_std_sv_ext_p): Likewise.
1985 (riscv_non_std_sv_ext_p): Likewise.
1986 (riscv_merge_non_std_and_sv_ext): Rename to...
1987 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
1988 (riscv_merge_arch_attr_info): Replace 3 calls to
1989 riscv_merge_non_std_and_sv_ext with single call to
1990 riscv_merge_multi_letter_ext.
1991 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
1992 encounter a 'z' prefix.
1993 (riscv_get_prefix_class): New function, return prefix class based
1994 on first few characters of input string.
1995 (riscv_parse_config): New structure to factor out minor differences
1996 in extension class parsing behaviour.
1997 (riscv_parse_sv_or_non_std_ext): Rename to...
1998 (riscv_parse_prefixed_ext): and parameterise with
1999 riscv_parse_config.
2000 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
2001 (riscv_multi_letter_ext_valid_p): New.
2002 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
2003 (riscv_parse_subset): Delegate all non-single-letter parsing work
2004 to riscv_parse_prefixed_ext.
2005 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
2006 (riscv_get_prefix_class): Declare.
2007
a804e476
AM
20082020-01-22 Alan Modra <amodra@gmail.com>
2009
2010 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
2011 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
2012 __tls_get_addr_desc.
2013 (ppc64_elf_size_stubs): Add section for linker generated
2014 __tls_get_addr_desc wrapper function. Loop at least once if
2015 generating this function.
2016 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
2017 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
2018
9e7028aa
AM
20192020-01-22 Alan Modra <amodra@gmail.com>
2020
2021 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
2022 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
2023 tga_desc_fd.
2024 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
2025 (STDU_R1_0R1, ADDI_R1_R1): Define.
2026 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
2027 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
2028 tga_desc_fd to opt_fd, and tga_desc to opt. Set
2029 no_tls_get_addr_regsave.
2030 (branch_reloc_hash_match): Add hash3 and hash4.
2031 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
2032 (ppc64_elf_size_dynamic_sections): Likewise.
2033 (ppc64_elf_relocate_section): Likewise.
2034 (plt_stub_size, build_plt_stub): Likewise. Size regsave
2035 __tls_get_addr stub.
2036 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
2037 eh_frame.
2038 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
2039 eh_frame for regsave __tls_get_addr.
2040
abc489c6
AM
20412020-01-22 Alan Modra <amodra@gmail.com>
2042
2043 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
2044 which __tls_get_addr calls will be eliminated.
2045
26916852
NC
20462020-01-20 Nick Clifton <nickc@redhat.com>
2047
2048 * po/pt.po: Updates Portuguese translation.
2049 * po/ru.po: Updated Russian translation.
2050 * po/uk.po: Updated Ukranian translation.
2051
14470f07
L
20522020-01-20 H.J. Lu <hongjiu.lu@intel.com>
2053
2054 PR ld/25416
2055 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
2056 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
2057 X32 mode.
2058 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
2059 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
2060 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
2061 "rex leal x@tlsdesc(%rip), %reg" to
2062 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
2063 "call *(%eax)" to "nopl (%rax)".
2064
b9ca1af6
AM
20652020-01-20 Alan Modra <amodra@gmail.com>
2066
2067 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
2068 (MTLR_R11): Don't define.
2069 (LD_R0_0R3, CMPDI_R0_0): Define.
2070 (build_tls_get_addr_stub): Don't use r11 in stub.
2071
ed7007c1
AM
20722020-01-20 Alan Modra <amodra@gmail.com>
2073
2074 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
2075 (defined_sym_val, is_tls_get_addr): Likewise.
2076
1b1bb2c6
NC
20772020-01-18 Nick Clifton <nickc@redhat.com>
2078
2079 * version.m4 (BFD_VERSION): Set to 2.34.50.
2080 * configure: Regenerate.
2081 * po/bfd.pot: Regenerate.
2082
ae774686
NC
20832020-01-18 Nick Clifton <nickc@redhat.com>
2084
2085 Binutils 2.34 branch created.
2086
07f1f3aa
CB
20872020-01-17 Christian Biesinger <cbiesinger@google.com>
2088
2089 * coff-arm.c: Fix spelling error (seperate).
2090 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
2091 error (seperate).
2092 * sysdep.h (strnlen): Fix spelling error (seperate).
2093
0d1cc75d
LB
20942020-01-15 Lars Brinkhoff <lars@nocrew.org>
2095
2096 PR 20694
2097 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
2098
e1c6cf61
AM
20992020-01-15 Alan Modra <amodra@gmail.com>
2100
2101 PR 25384
2102 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
2103 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
2104 of function symbols unless dot symbols are present. Do warn
2105 whenever one is created, regardles of whether a PLT entry is
2106 also emitted for the function symbol.
2107
ef4e5ba5
AM
21082020-01-14 Alan Modra <amodra@gmail.com>
2109
2110 * som.c (som_bfd_count_ar_symbols): Error when file position
2111 of symbols on chains is not strictly increasing.
2112
8ab484c2
AM
21132020-01-14 Alan Modra <amodra@gmail.com>
2114
2115 * vms.h (VMS_DEBUG): Define as 0.
2116 * vms-alpha.c (image_write): Move debug output after bounds check.
2117 Tidy bounds check.
2118 (_bfd_vms_slurp_eihd): Warning fix.
2119 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
2120
b50ef514
AM
21212020-01-13 Alan Modra <amodra@gmail.com>
2122
2123 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
2124 for "ignored" records.
2125
0c0adcc5
AM
21262020-01-13 Alan Modra <amodra@gmail.com>
2127
2128 * wasm-module.c (wasm_scan_name_function_section): Formatting.
2129 Delete asect name check. Move asect NULL check to wasm_object_p.
2130 Correct bounds check of sizes against end. Replace uses of
2131 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
2132 just one bfd_release.
2133 (wasm_scan): Don't use malloc/strdup for section names,
2134 bfd_alloc instead. Simplify code prefixing section name.
2135 Formatting. Don't attempt to free memory here..
2136 (wasm_object_p): ..do so here.
2137
7f026732
SN
21382020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
2139
2140 PR ld/22269
2141 * elf32-arm.c (elf32_arm_final_link_relocate): Use
2142 UNDEFWEAK_NO_DYNAMIC_RELOC.
2143 (allocate_dynrelocs_for_symbol): Likewise.
2144
8cd0e5e9
TC
21452020-01-10 Tamar Christina <tamar.christina@arm.com>
2146
2147 PR 25210
2148 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
2149
71780f45
AM
21502020-01-10 Alan Modra <amodra@gmail.com>
2151
2152 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
2153
b899eb3b
NC
21542020-01-09 Nick Clifton <nickc@redhat.com>
2155
2156 PR 25221
2157 * bfd.c (bfd_convert_section_contents): Check for a compress
2158 header size that is larger than the actual section size.
2159
4c6ee646
AM
21602020-01-08 Alan Modra <amodra@gmail.com>
2161
2162 PR 25351
2163 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
2164 after removing sections.
2165
85f78364
JW
21662020-01-06 Jim Wilson <jimw@sifive.com>
2167
2168 PR 25205
2169 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
2170 check for !bfd_link_pic (info).
2171 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
2172 <R_RISCV_JAL>: Add comment.
2173 (_bfd_riscv_relax_section): For plt.offset check, add check for
2174 bfd_link_pic (info). Add comment.
2175
49078ece
AM
21762020-01-06 Alan Modra <amodra@gmail.com>
2177
2178 * format.c (bfd_check_format_matches): Ignore bfd_error on target
2179 match failures. Don't init to bfd_error_wrong_format before
2180 calling _bfd_check_format.
2181
ab356be7
AM
21822020-01-06 Alan Modra <amodra@gmail.com>
2183
2184 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
2185 status rather than exiting on stack overflow or underflow.
2186 (_bfd_vms_slurp_etir): Adjust to suit.
2187
85d86817
AM
21882020-01-06 Alan Modra <amodra@gmail.com>
2189
2190 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
2191
3e6aa775
AM
21922020-01-06 Alan Modra <amodra@gmail.com>
2193
2194 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
2195 command. Check name offset is within command.
2196 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
2197 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
2198 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
2199 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
2200 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
2201 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
2202 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
2203 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
2204 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
2205 (bfd_mach_o_read_segment): Similarly.
2206 (bfd_mach_o_read_thread): Properly bound check thread struct.
2207 Don't repeat checks on second loop.
2208 (bfd_mach_o_read_command): Fail on invalid command length.
2209
ea933f17
AM
22102020-01-04 Alan Modra <amodra@gmail.com>
2211
2212 * format.c (bfd_check_format_matches): Add preserve_match.
2213 Save initial bfd state in "preserve", matched bfd state in
2214 "preserve_match". Save just the first match. Release
2215 bfd_alloc memory. Restore and finish preserved state as
2216 appropriate on all function exit paths.
2217
f24bdec4
AM
22182020-01-04 Alan Modra <amodra@gmail.com>
2219
2220 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
2221
991fb595
AM
22222020-01-04 Alan Modra <amodra@gmail.com>
2223
2224 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
2225 match too.
2226
f2a3559d
NC
22272020-01-03 Nick Clifton <nickc@redhat.com>
2228
2229 PR 25307
2230 (bfd_pef_parse_function_stubs): Correct the test that ensures that
2231 there is enough data remaining in the code buffer before
2232 attempting to read a function stub.
2233
7a0fb7be
NC
22342020-01-03 Nick Clifton <nickc@redhat.com>
2235
2236 PR 25308
2237 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
2238 return value from bfd_malloc.
2239 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
2240 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
2241 (elf32_arm_filter_cmse_symbols): Likewise.
2242 (elf32_arm_write_section): Likewise.
2243 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
2244 (bfd_mach_o_follow_dsym): Likewise.
2245 * pef.c (bfd_pef_print_loader_section): Likewise.
2246 (bfd_pef_scan_start_address): Likewise.
2247 (bfd_pef_parse_function_stubs): Likewise.
2248 (bfd_pef_parse_symbols): Likewise.
2249
b26a3d58
ST
22502020-01-03 Sergei Trofimovich <siarheit@google.com>
2251
2252 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
2253 on binary inputs ld/PR25316.
2254 (is_ia64_elf): new helper to filter on ia64 objects.
2255
4bb7a87e
JB
22562020-01-03 Jan Beulich <jbeulich@suse.com>
2257
2258 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
2259 in parameter names.
2260 (bfd_mach_o_scan): Insert underscore in two variable names.
2261
6655dba2
SB
22622020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
2263
2264 * Makefile.am: Add z80-elf target support.
2265 * configure.ac: Likewise.
2266 * targets.c: Likewise.
2267 * Makefile.in: Regenerate.
2268 * configure: Regenerate.
2269 * config.bfd: Add z80-elf target support and new arches: ez80 and
2270 z180.
2271 * elf32-z80.c: New file.
2272 * archures.c: Add new z80 architectures: eZ80 and Z180.
2273 * coffcode.h: Likewise.
2274 * cpu-z80.c: Likewise.
2275 * coff-z80.c: Add new relocations for Z80 target and local label
2276 check.
2277 * reloc.c: Add new relocs.
2278 * bfd-in2.h: Regenerate.
2279 * libbfd.h: Regenerate.
2280
0db131fb
TC
22812020-01-02 Tamar Christina <tamar.christina@arm.com>
2282
2283 PR 25210
2284 PR 24753
2285 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
2286
b14ce8bf
AM
22872020-01-01 Alan Modra <amodra@gmail.com>
2288
2289 Update year range in copyright notice of all files.
2290
0b114740 2291For older changes see ChangeLog-2019
3499769a 2292\f
0b114740 2293Copyright (C) 2020 Free Software Foundation, Inc.
3499769a
AM
2294
2295Copying and distribution of this file, with or without modification,
2296are permitted in any medium without royalty provided the copyright
2297notice and this notice are preserved.
2298
2299Local Variables:
2300mode: change-log
2301left-margin: 8
2302fill-column: 74
2303version-control: never
2304End:
This page took 0.398606 seconds and 4 git commands to generate.