Recognize some new Mach-O load commands
[deliverable/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
d768f160
SJ
12020-06-22 Saagar Jha <saagar@saagarjha.com>
2
3 * mach-o.c: Support the new load commands by reading a linkedit
4 data command for them.
5
39ff0b81
NC
62020-06-22 Nelson Chu <nelson.chu@sifive.com>
7
8 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
9 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
10 (riscv_get_priv_spec_class): Likewise.
11 (riscv_get_priv_spec_name): Likewise.
12 (riscv_get_priv_spec_class_from_numbers): New function, convert
13 the version numbers into string, then call riscv_get_priv_spec_class
14 to get the priv spec class.
15 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
16 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
17 (riscv_get_priv_spec_name): Likewise.
18 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
19 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
20 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
21 of input and output objects form their priv spec attributes by
22 riscv_get_priv_spec_class_from_numbers. Report warning rather than
23 errors when linking objects with differnet priv spec versions. We do
24 know v1.9.1 may have conflicts to other versions, so report the
25 warning, too. After that, update the output priv spec version to the
26 newest one so far.
27
cbd7581f
NC
282020-06-22 Nelson Chu <nelson.chu@sifive.com>
29
30 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
31 priv attributes, we will check the conflicts for all of them (major,
32 minor and revision), and then set the priv_attrs_merged to TRUE to
33 indicate that we have handled all of the priv attributes. Remove
34 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
35
1e927850
AM
362020-06-21 Alan Modra <amodra@gmail.com>
37
38 PR 26132
39 * configure.ac: Disable plugins by default for some targets.
40 * plugin.c: Comment typo fix.
41 * configure: Regenerate.
42
13aa5ceb
NC
432020-06-19 Nick Clifton <nickc@redhat.com>
44
45 * plugin.c (try_load_plugin): Suppress the error message about
46 being unable to open a plugin if creating a list of viable
47 plugins.
48
a435742a
AM
492020-06-16 Alan Modra <amodra@gmail.com>
50
51 * aout-tic30.c: Delete file.
52 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
53 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
54 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
55 (xc16x-*-elf): Sort properly.
56 * configure.ac: Remove tic30_aout_vec.
57 * targets.c: Likewise.
58 * Makefile.in: Regenerate.
59 * configure: Regenerate.
60 * po/SRC-POTFILES.in: Regenerate.
61
7a77f1ac
MF
622020-06-15 Max Filippov <jcmvbkbc@gmail.com>
63
64 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
65 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
66 (elf32xtensa_abi): New global variable.
67 (xtensa_abi_choice): New function.
68 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
69 XSHAL_ABI to select PLT code.
70
cae64165
RM
712020-06-15 Roland McGrath <mcgrathr@google.com>
72
73 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
74 field of bfd_link_info.
75
40be168c
AM
762020-06-15 Alan Modra <amodra@gmail.com>
77
78 * config.bfd: Obsolete powerpcle-*-pe targets.
79
75cfe082
AM
802020-06-15 Alan Modra <amodra@gmail.com>
81
82 PR 26103
83 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
84 symbols that were defined in discarded sections.
85 * cofflink.c (coff_link_check_archive_element): Likewise.
86 (coff_link_add_symbols): Set indx to -3 for symbols defined in
87 discarded sections.
88 (_bfd_coff_write_global_sym): Don't emit such symbols.
89 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
90 libcoff.h: Regenerate.
91
f0aa3025
AM
922020-06-11 Alan Modra <amodra@gmail.com>
93
94 PR 26107
95 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
96
447f6d86
L
972020-06-10 H.J. Lu <hongjiu.lu@intel.com>
98
99 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
100 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
101 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
102 of reltext.
103
e1b5d517
L
1042020-06-10 H.J. Lu <hongjiu.lu@intel.com>
105
106 PR ld/26094
107 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
108 Clear verinfo.verdef.
109
cebd6b8a
L
1102020-06-09 H.J. Lu <hongjiu.lu@intel.com>
111
112 PR ld/18801
113 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
114 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
115 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
116 resolvers.
117 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
118 Set ifunc_resolvers if there are FUNC resolvers.
119 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
120 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
121 with elf.ifunc_resolvers.
122 (write_plt_relocs_for_local_syms): Likewise.
123 (ppc64_elf_relocate_section): Likewise.
124 (ppc64_elf_finish_dynamic_sections): Likewise.
125 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
126 Updated.
127 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
128 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
129 instead of readonly_dynrelocs_against_ifunc.
130 * elfxx-x86.h (elf_x86_link_hash_table): Remove
131 readonly_dynrelocs_against_ifunc.
132
efb2a7b4
AM
1332020-06-09 Alan Modra <amodra@gmail.com>
134
135 * elf64-ppc.c (struct ppc_link_hash_table): Delete
136 maybe_local_ifunc_resolver field.
137 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
138 cases where maybe_local_ifunc_resolver was set.
139 (ppc64_elf_relocate_section): Likewise.
140 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
141 error to a warning.
142
9bcc30e4
L
1432020-06-08 H.J. Lu <hongjiu.lu@intel.com>
144
145 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
146 tlsdesc_got.
147 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
148 and dt_tlsdesc_got.
149 (elf32_arm_size_dynamic_sections): Updated. Clear
150 root.tlsdesc_plt for DF_BIND_NOW.
151 (elf32_arm_finish_dynamic_sections): Updated.
152 (elf32_arm_output_arch_local_syms): Likewise.
153 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
154 Clear root.tlsdesc_plt for DF_BIND_NOW.
155 (nds32_elf_finish_dynamic_sections): Updated.
156 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
157 dt_tlsdesc_plt and dt_tlsdesc_got.
158 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
159 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
160 tlsdesc_plt and dt_tlsdesc_got.
161 (elfNN_aarch64_allocate_dynrelocs): Updated.
162 (elfNN_aarch64_finish_dynamic_sections): Likewise.
163 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
164 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
165 twice.
166 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
167 (_bfd_x86_elf_size_dynamic_sections): Likewise.
168 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
169 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
170 tlsdesc_got.
171
845b83d7
L
1722020-06-07 H.J. Lu <hongjiu.lu@intel.com>
173
174 * elf32-tic6x.c (elf32_bed): Defined the default to
175 elf32_tic6x_bed.
176
9b8a8575
L
1772020-06-07 H.J. Lu <hongjiu.lu@intel.com>
178
179 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
180 plt_rel_sec.
181 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
182 root.splt/root.srelplt.
183 (elf64_hppa_create_dynamic_sections): Likewise.
184 (elf64_hppa_size_dynamic_sections): Likewise.
185 (elf64_hppa_finish_dynamic_symbol): Likewise.
186 (elf_hppa_final_link): Likewise.
187 (elf_hppa_final_link_relocate): Likewise.
188
bcab203d
L
1892020-06-06 H.J. Lu <hongjiu.lu@intel.com>
190
191 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
192 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
193 is_vxworks.
194
90c14f0c
L
1952020-06-06 H.J. Lu <hongjiu.lu@intel.com>
196
197 * elf-bfd.h (elf_target_os): New.
198 (elf_link_hash_table): Add target_os.
199 (elf_backend_data): Add target_os.
200 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
201 symbian_p and nacl_p.
202 (create_got_section): Updated.
203 (elf32_arm_create_dynamic_sections): Likewise.
204 (arm_type_of_stub): Likewise.
205 (elf32_arm_create_or_find_stub_sec): Likewise.
206 (elf32_arm_allocate_plt_entry): Likewise.
207 (elf32_arm_populate_plt_entry): Likewise.
208 (elf32_arm_final_link_relocate): Likewise.
209 (elf32_arm_check_relocs): Likewise.
210 (allocate_dynrelocs_for_symbol): Likewise.
211 (elf32_arm_finish_dynamic_symbol): Likewise.
212 (elf32_arm_finish_dynamic_sections): Likewise.
213 (elf32_arm_output_plt_map_1): Likewise.
214 (elf32_arm_output_arch_local_syms): Likewise.
215 (elf32_arm_add_symbol_hook): Likewise.
216 (elf32_arm_nacl_link_hash_table_create): Likewise.
217 (elf32_arm_vxworks_link_hash_table_create): Likewise.
218 (elf32_arm_symbian_link_hash_table_create): Likewise.
219 (ELF_TARGET_OS): New.
220 * elf32-i386.c (elf_i386_arch_bed): Removed.
221 (elf_backend_arch_data): Likewise.
222 (elf_i386_solaris_arch_bed): Likewise.
223 (elf_i386_nacl_arch_bed): Likewise.
224 (elf_i386_vxworks_arch_bed): Likewise.
225 (elf_i386_relocate_section): Updated.
226 (elf_i386_finish_dynamic_sections): Likewise.
227 (elf_i386_get_synthetic_symtab): Likewise.
228 (elf_i386_link_setup_gnu_properties): Likewise.
229 (ELF_TARGET_OS): New.
230 * elf32-mips.c (ELF_TARGET_OS): New.
231 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
232 (ppc_elf_create_got): Updated.
233 (ppc_elf_create_dynamic_sections): Likewise.
234 (ppc_elf_check_relocs): Likewise.
235 (ppc_elf_adjust_dynamic_symbol): Likewise.
236 (ppc_elf_size_dynamic_sections): Likewise.
237 (ppc_elf_relocate_section): Likewise.
238 (ppc_elf_finish_dynamic_sections): Likewise.
239 (ppc_elf_vxworks_link_hash_table_create): Likewise.
240 (ELF_TARGET_OS): New.
241 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
242 (sh_elf_link_hash_table_create): Updated.
243 (sh_elf_create_dynamic_sections): Likewise.
244 (allocate_dynrelocs): Likewise.
245 (sh_elf_size_dynamic_sections): Likewise.
246 (sh_elf_relocate_section): Likewise.
247 (sh_elf_finish_dynamic_symbol): Likewise.
248 (sh_elf_finish_dynamic_sections): Likewise.
249 (ELF_TARGET_OS): New.
250 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
251 Removed.
252 (bfd_elf32_bfd_link_hash_table_create): Likewise.
253 (ELF_TARGET_OS): New.
254 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
255 (elf_x86_64_solaris_arch_bed): Likewise.
256 (elf_x86_64_nacl_arch_bed): Likewise.
257 (elf_x86_64_finish_dynamic_sections): Updated.
258 (elf_x86_64_get_synthetic_symtab): Likewise.
259 (elf_x86_64_link_setup_gnu_properties): Likewise.
260 (ELF_TARGET_OS): New.
261 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
262 target_o.
263 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
264 (MIPS_ELF_REL_DYN_NAME): Updated.
265 (ELF_MIPS_GP_OFFSET): Likewise.
266 (mips_elf_create_local_got_entry): Likewise.
267 (mips_elf_allocate_dynamic_relocations): Likewise.
268 (mips_elf_count_got_symbols): Likewise.
269 (is_gott_symbol): Likewise.
270 (mips_elf_calculate_relocation): Likewise.
271 (mips_elf_create_dynamic_relocation): Likewise.
272 (_bfd_mips_elf_check_relocs): Likewise.
273 (allocate_dynrelocs): Likewise.
274 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
275 (mips_elf_lay_out_got): Likewise.
276 (mips_elf_set_plt_sym_value): Likewise.
277 (_bfd_mips_elf_size_dynamic_sections): Likewise.
278 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
279 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
280 (_bfd_mips_elf_final_link): Likewise.
281 (_bfd_mips_init_file_header): Likewise.
282 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
283 Likewise.
284 (allocate_dynrelocs): Likewise.
285 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
286 (_bfd_sparc_elf_relocate_section): Likewise.
287 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
288 (sparc_finish_dyn): Likewise.
289 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
290 * elfxx-target.h (ELF_TARGET_OS): New.
291 (elfNN_bed): Add ELF_TARGET_OS.
292 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
293 (_bfd_x86_elf_link_hash_table_create): Likewise.
294 (_bfd_x86_elf_size_dynamic_sections): Likewise.
295 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
296 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
297 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
298 * elfxx-x86.h (elf_x86_target_os): Removed.
299 (elf_x86_backend_data): Likewise.
300 (get_elf_x86_backend_data): Likewise.
301 (elf_x86_link_hash_table): Remove target_os.
302
87c69f97
AM
3032020-06-06 Alan Modra <amodra@gmail.com>
304
305 * reloc.c: Rename
306 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
307 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
308 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
309 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
310 * elf64-ppc.c: Update throughout for reloc renaming.
311 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
312 * libbfd.h: Regenerate.
313 * bfd-in2.h: Regenerate.
314
981f1518
L
3152020-06-05 H.J. Lu <hongjiu.lu@intel.com>
316
8a4ba3a1 317 PR ld/26080
981f1518
L
318 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
319 section.
320
9c65eeac
NC
3212020-06-05 Nick Clifton <nickc@redhat.com>
322
323 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
324 bug.
325
41285764
NC
3262020-06-05 Nelson Chu <nelson.chu@sifive.com>
327
328 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
329 priv_may_conflict, in_priv_zero and out_priv_zero to decide
330 whether the object can be linked according to it's priv
331 attributes. The object without any priv spec attributes can
332 be linked with others. If the first input object doesn't contain
333 any priv attributes, then we need to copy the setting from the
334 next input one. Also report more detailed error messages to user.
335
a975c88e
SC
3362020-06-04 Stephen Casner <casner@acm.org>
337
338 Extend pdp11-aout symbol table format to accommodate .stab
339 symbols and implement correct handling of them.
340
341 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
342 (N_STAB, is_stab): Needed new function is_stab to disambiguate
343 normal vs. .stab symbol table type values, replacing N_STAB mask.
344 (translate_from_native_sym_flags): Determine correct section for
345 different .stab types.
346 (translate_to_native_sym_flags): Leave .stab types intact.
347 (translate_symbol_table): Error if symbol indicates overlay;
348 store desc field from .stab symbols.
349 (write_syms): Output desc field with symbol.
350 (aout_link_check_ar_symbols): Skip .stab symbols.
351 (aout_link_add_symbols): Correctly distinguish .stab symbols.
352 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
353 (aout_link_write_symbols): Write 0 for desk and ovly fields;
354 correctly distinguish .stab symbols and select calculate their
355 section and value; and copy desc and ovly fields from input symbol
356 to output symbol.
357
3b9313c4
SC
3582020-06-04 Stephen Casner <casner@acm.org>
359
360 * aoutx.h (translate_symbol_table): Comment had external and
361 internal swapped.
362 * pdp11.c (translate_symbol_table): Likewise.
363
add5f777
L
3642020-06-04 H.J. Lu <hongjiu.lu@intel.com>
365
366 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
367 (is_x86_elf): Check elf.hash_table_id instead of target_id.
368 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
369
c4b126b8
L
3702020-06-04 H.J. Lu <hongjiu.lu@intel.com>
371
372 PR ld/26080
373 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
374 in debug section against symbol defined in shared library to 0.
375 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
376 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
377 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
378 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
379 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
380 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
381 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
382 * elf32-sh.c (sh_elf_check_relocs): Likewise.
383 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
384 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
385 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
386 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
387 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
388 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
389 reference.
390 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
391 there is non-GOT reference.
392 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
393 non-alloced sections.
394
31af1e68
SC
3952020-06-03 Stephen Casner <casner@acm.org>
396
397 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
398
399 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
400 files with relocs.
401 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
402 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
403 other size that doesn't qcover the header word.
404 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
405 string table, and zero it.
406 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
407 message and set bfd_error on finding an invalid name string offset.
408 (add_to_stringtab): INLINE -> inline
409 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
410 bound check.
411 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
412 any relocs that could not be recognised.
413 92744f05809 PR 20929 - Check for relocs without an associated symbol.
414 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
415 name exists and is long enough, before attempting to see if it is
416 for a .o file.
417 c3864421222 - Correct case for N_SO being the last symbol.
418 50455f1ab29 PR 20891 - Handle the case where the main file name
419 and the directory name are both empty.
420 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
421 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
422 range string table offsets.
423 531336e3a0b PR 20909 - Fix off-by-one error in check for an
cae64165 424 illegal string offset.
31af1e68
SC
425 (aout_link_includes_newfunc): Add comment.
426 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
427 on unexpected relocation type rather than ASSERT.
428
d4d8aee3
L
4292020-06-03 H.J. Lu <hongjiu.lu@intel.com>
430
431 PR ld/26066
432 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
433 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
434
58ee44ef
L
4352020-06-03 H.J. Lu <hongjiu.lu@intel.com>
436
437 PR ld/26066
438 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
439 non-alloced sections.
440
9a689602
L
4412020-06-03 H.J. Lu <hongjiu.lu@intel.com>
442
443 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
444 dynamic relocations for non SEC_ALLOC sections.
445
0bff7528
GN
4462020-06-03 Gunther Nikl <gnikl@justmail.de>
447
448 * aout64.c (BMAGIC, QMAGIC): Do not define.
449 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
450 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
451 to check the file format.
452 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
453 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
454 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
455
50d03636
L
4562020-06-03 H.J. Lu <hongjiu.lu@intel.com>
457
458 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
459 relocations for non SEC_ALLOC sections.
460
d49e5065
L
4612020-06-03 H.J. Lu <hongjiu.lu@intel.com>
462
463 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
464 * elf32-arm.c (maybe_set_textrel): Removed.
465 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
466 with _bfd_elf_maybe_set_textrel.
467 * elf32-csky.c (maybe_set_textrel): Removed.
468 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
469 with _bfd_elf_maybe_set_textrel.
470 * elf32-hppa.c (maybe_set_textrel): Removed.
471 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
472 with _bfd_elf_maybe_set_textrel.
473 * elf32-lm32.c (maybe_set_textrel): Removed.
474 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
475 with _bfd_elf_maybe_set_textrel.
476 * elf32-m32r.c (maybe_set_textrel): Removed.
477 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
478 with _bfd_elf_maybe_set_textrel.
479 * elf32-metag.c (maybe_set_textrel): Removed.
480 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
481 with _bfd_elf_maybe_set_textrel.
482 * elf32-nds32.c (maybe_set_textrel): Removed.
483 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
484 with _bfd_elf_maybe_set_textrel.
485 * elf32-or1k.c (maybe_set_textrel): Removed.
486 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
487 with _bfd_elf_maybe_set_textrel.
488 * elf32-ppc.c (maybe_set_textrel): Removed.
489 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
490 with _bfd_elf_maybe_set_textrel.
491 * elf32-s390.c (maybe_set_textrel): Removed.
492 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
493 with _bfd_elf_maybe_set_textrel.
494 * elf32-sh.c (maybe_set_textrel): Removed.
495 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
496 with _bfd_elf_maybe_set_textrel.
497 * elf32-tic6x.c (maybe_set_textrel): Removed.
498 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
499 with _bfd_elf_maybe_set_textrel.
500 * elf32-tilepro.c (maybe_set_textrel): Removed.
501 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
502 with _bfd_elf_maybe_set_textrel.
503 * elf64-ppc.c (maybe_set_textrel): Removed.
504 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
505 with _bfd_elf_maybe_set_textrel.
506 * elf64-s390.c (maybe_set_textrel): Removed.
507 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
508 with _bfd_elf_maybe_set_textrel.
509 * elfnn-aarch64.c (maybe_set_textrel): Removed.
510 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
511 with _bfd_elf_maybe_set_textrel.
512 * elfnn-riscv.c (maybe_set_textrel): Removed.
513 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
514 with _bfd_elf_maybe_set_textrel.
515 * elfxx-sparc.c (maybe_set_textrel): Removed.
516 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
517 with _bfd_elf_maybe_set_textrel.
518 * elfxx-tilegx.c (maybe_set_textrel): Removed.
519 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
520 with _bfd_elf_maybe_set_textrel.
521 * elfxx-x86.c (maybe_set_textrel): Removed.
522 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
523 with _bfd_elf_maybe_set_textrel.
524 * elflink.c (_bfd_elf_maybe_set_textrel): New.
525
ad172eaa
L
5262020-06-03 H.J. Lu <hongjiu.lu@intel.com>
527
528 PR ld/26067
529 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
530 dyn_relocs.
531 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
532 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
533 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
534 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
535 Likewise.
536 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
537 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
538 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
539 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
540 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
541 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
542 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
543 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
544 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
545 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
546 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
547 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
548 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
549 (elf_backend_copy_indirect_symbol): Likewise.
550 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
551 (elf_backend_copy_indirect_symbol): Likewise.
552 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
553
5dbc8b37
L
5542020-06-03 H.J. Lu <hongjiu.lu@intel.com>
555
556 PR ld/26067
557 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
558 * elf32-arm.c (readonly_dynrelocs): Removed.
559 (maybe_set_textrel): Replace readonly_dynrelocs with
560 _bfd_elf_readonly_dynrelocs.
561 * elf32-csky.c (readonly_dynrelocs): Removed.
562 (maybe_set_textrel): Replace readonly_dynrelocs with
563 _bfd_elf_readonly_dynrelocs.
564 * elf32-hppa.c(readonly_dynrelocs): Removed.
565 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
566 _bfd_elf_readonly_dynrelocs.
567 (maybe_set_textrel): Likewise.
568 * elf32-lm32.c (readonly_dynrelocs): Removed.
569 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
570 with _bfd_elf_readonly_dynrelocs.
571 (maybe_set_textrel): Likewise.
572 * elf32-m32r.c (readonly_dynrelocs): Removed.
573 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
574 with _bfd_elf_readonly_dynrelocs.
575 (maybe_set_textrel): Likewise.
576 * elf32-metag.c (readonly_dynrelocs): Removed.
577 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
578 with _bfd_elf_readonly_dynrelocs.
579 (maybe_set_textrel): Likewise.
580 * elf32-microblaze.c (readonly_dynrelocs): Removed.
581 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
582 with _bfd_elf_readonly_dynrelocs.
583 * elf32-nds32.c (readonly_dynrelocs): Removed.
584 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
585 with _bfd_elf_readonly_dynrelocs.
586 (maybe_set_textrel): Likewise.
587 * elf32-or1k.c (readonly_dynrelocs): Removed.
588 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
589 with _bfd_elf_readonly_dynrelocs.
590 * elf32-ppc.c (readonly_dynrelocs): Removed.
591 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
592 _bfd_elf_readonly_dynrelocs.
593 (ppc_elf_adjust_dynamic_symbol): Likewise.
594 (maybe_set_textrel): Likewise.
595 * elf32-s390.c (readonly_dynrelocs): Removed.
596 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
597 with _bfd_elf_readonly_dynrelocs.
598 (maybe_set_textrel): Likewise.
599 * elf32-sh.c (readonly_dynrelocs): Removed.
600 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
601 _bfd_elf_readonly_dynrelocs.
602 (maybe_set_textrel): Likewise.
603 * elf32-tic6x.c (readonly_dynrelocs): Removed.
604 (maybe_set_textrel): Replace readonly_dynrelocs with
605 _bfd_elf_readonly_dynrelocs.
606 * elf32-tilepro.c (readonly_dynrelocs): Removed.
607 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
608 with _bfd_elf_readonly_dynrelocs.
609 (maybe_set_textrel): Likewise.
610 * elf64-ppc.c (readonly_dynrelocs): Removed.
611 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
612 _bfd_elf_readonly_dynrelocs.
613 (ppc64_elf_adjust_dynamic_symbol): Likewise.
614 (maybe_set_textrel): Likewise.
615 * elf64-s390.c (readonly_dynrelocs): Removed.
616 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
617 with _bfd_elf_readonly_dynrelocs.
618 (maybe_set_textrel): Likewise.
619 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
620 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
621 (maybe_set_textrel): Replace readonly_dynrelocs with
622 _bfd_elf_readonly_dynrelocs.
623 * elfnn-riscv.c (readonly_dynrelocs): Removed.
624 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
625 with _bfd_elf_readonly_dynrelocs.
626 (maybe_set_textrel): Likewise.
627 * elfxx-sparc.c (readonly_dynrelocs): Removed.
628 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
629 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
630 (maybe_set_textrel): Likewise.
631 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
632 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
633 with _bfd_elf_readonly_dynrelocs.
634 (maybe_set_textrel): Likewise.
635 * elfxx-x86.c (readonly_dynrelocs): Removed.
636 (maybe_set_textrel): Replace readonly_dynrelocs with
637 _bfd_elf_readonly_dynrelocs.
638 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
639
433953ff
L
6402020-06-03 H.J. Lu <hongjiu.lu@intel.com>
641
642 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
643 -fsanitize=undefined.
644
67580036
AM
6452020-06-03 Alan Modra <amodra@gmail.com>
646
647 PR 26069
648 PR 18758
649 * peicode.h (pe_ILF_make_a_section): Align data for compilers
650 other than gcc.
651 (pe_ILF_build_a_bfd): Likewise.
652
0ed18fa1
AM
6532020-06-03 Alan Modra <amodra@gmail.com>
654
7eea15c5 655 PR 26069
0ed18fa1
AM
656 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
657 core files as well as objects.
658
190eb1dd
L
6592020-06-01 H.J. Lu <hongjiu.lu@intel.com>
660
661 PR ld/26067
662 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
663 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
664 Updated.
665 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
666 (elf_arc_link_hash_newfunc): Updated.
667 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
668 (elf32_arm_link_hash_newfunc): Updated.
669 (elf32_arm_copy_indirect_symbol): Likewise.
670 (elf32_arm_check_relocs): Likewise.
671 (readonly_dynrelocs): Likewise.
672 (allocate_dynrelocs_for_symbol): Likewise.
673 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
674 (csky_elf_link_hash_newfunc): Updated.
675 (csky_allocate_dynrelocs): Likewise.
676 (readonly_dynrelocs): Likewise.
677 (csky_elf_copy_indirect_symbol): Likewise.
678 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
679 (hppa_link_hash_newfunc): Updated.
680 (elf32_hppa_copy_indirect_symbol): Likewise.
681 (elf32_hppa_hide_symbol): Likewise.
682 (elf32_hppa_adjust_dynamic_symbol): Likewise.
683 (allocate_dynrelocs): Likewise.
684 (elf32_hppa_relocate_section): Likewise.
685 * elf32-i386.c (elf_i386_check_relocs): Likewise.
686 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
687 (lm32_elf_link_hash_newfunc): Likewise.
688 (lm32_elf_link_hash_table_create): Updated.
689 (readonly_dynrelocs): Likewise.
690 (allocate_dynrelocs): Likewise.
691 (lm32_elf_copy_indirect_symbol): Likewise.
692 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
693 (m32r_elf_link_hash_newfunc): Likewise.
694 (m32r_elf_link_hash_table_create): Updated.
695 (m32r_elf_copy_indirect_symbol): Likewise.
696 (allocate_dynrelocs): Likewise.
697 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
698 (metag_link_hash_newfunc): Updated.
699 (elf_metag_copy_indirect_symbol): Likewise.
700 (readonly_dynrelocs): Likewise.
701 (allocate_dynrelocs): Likewise.
702 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
703 dyn_relocs.
704 (link_hash_newfunc): Updated.
705 (microblaze_elf_check_relocs): Likewise.
706 (microblaze_elf_copy_indirect_symbol): Likewise.
707 (readonly_dynrelocs): Likewise.
708 (allocate_dynrelocs): Likewise.
709 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
710 (nds32_elf_link_hash_newfunc): Updated.
711 (nds32_elf_copy_indirect_symbol): Likewise.
712 (readonly_dynrelocs): Likewise.
713 (allocate_dynrelocs): Likewise.
714 (nds32_elf_check_relocs): Likewise.
715 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
716 (link_hash_newfunc): Updated.
717 (nios2_elf32_copy_indirect_symbol): Likewise.
718 (nios2_elf32_check_relocs): Likewise.
719 (allocate_dynrelocs): Likewise.
720 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
721 (or1k_elf_link_hash_newfunc): Updated.
722 (readonly_dynrelocs): Likewise.
723 (allocate_dynrelocs): Likewise.
724 (or1k_elf_copy_indirect_symbol): Likewise.
725 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
726 (ppc_elf_link_hash_newfunc): Updated.
727 (ppc_elf_copy_indirect_symbol): Likewise.
728 (ppc_elf_check_relocs): Likewise.
729 (readonly_dynrelocs): Likewise.
730 (ppc_elf_adjust_dynamic_symbol): Likewise.
731 (allocate_dynrelocs): Likewise.
732 (ppc_elf_relocate_section): Likewise.
733 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
734 (link_hash_newfunc): Updated.
735 (elf_s390_copy_indirect_symbol): Likewise.
736 (readonly_dynrelocs): Likewise.
737 (elf_s390_adjust_dynamic_symbol): Likewise.
738 (allocate_dynrelocs): Likewise.
739 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
740 (sh_elf_link_hash_newfunc): Updated.
741 (readonly_dynrelocs): Likewise.
742 (allocate_dynrelocs): Likewise.
743 (sh_elf_copy_indirect_symbol): Likewise.
744 (sh_elf_check_relocs): Likewise.
745 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
746 (elf32_tic6x_link_hash_newfunc): Likewise.
747 (elf32_tic6x_link_hash_table_create): Updated.
748 (readonly_dynrelocs): Likewise.
749 (elf32_tic6x_check_relocs): Likewise.
750 (elf32_tic6x_allocate_dynrelocs): Likewise.
751 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
752 dyn_relocs.
753 (link_hash_newfunc): Updated.
754 (tilepro_elf_copy_indirect_symbol): Likewise.
755 (tilepro_elf_check_relocs): Likewise.
756 (allocate_dynrelocs): Likewise.
757 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
758 (ppc64_elf_copy_indirect_symbol): Updated.
759 (ppc64_elf_check_relocs): Likewise.
760 (readonly_dynrelocs): Likewise.
761 (ppc64_elf_adjust_dynamic_symbol): Likewise.
762 (dec_dynrel_count): Likewise.
763 (allocate_dynrelocs): Likewise.
764 (ppc64_elf_relocate_section): Likewise.
765 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
766 (link_hash_newfunc): Updated.
767 (elf_s390_copy_indirect_symbol): Likewise.
768 (readonly_dynrelocs): Likewise.
769 (allocate_dynrelocs): Likewise.
770 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
771 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
772 dyn_relocs.
773 (elfNN_aarch64_link_hash_newfunc): Updated.
774 (elfNN_aarch64_copy_indirect_symbol): Likewise.
775 (readonly_dynrelocs): Likewise.
776 (need_copy_relocation_p): Likewise.
777 (elfNN_aarch64_allocate_dynrelocs): Likewise.
778 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
779 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
780 (link_hash_newfunc): Updated.
781 (riscv_elf_copy_indirect_symbol): Likewise.
782 (riscv_elf_check_relocs): Likewise.
783 (readonly_dynrelocs): Likewise.
784 (allocate_dynrelocs): Likewise.
785 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
786 dyn_relocs.
787 (link_hash_newfunc): Updated.
788 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
789 (_bfd_sparc_elf_check_relocs): Likewise.
790 (readonly_dynrelocs): Likewise.
791 (allocate_dynrelocs): Likewise.
792 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
793 (link_hash_newfunc): Updated.
794 (tilegx_elf_copy_indirect_symbol): Likewise.
795 (tilegx_elf_check_relocs): Likewise.
796 (readonly_dynrelocs): Likewise.
797 (allocate_dynrelocs): Likewise.
798 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
799 (readonly_dynrelocs): Likewise.
800 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
801 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
802
2fdb65f2
AM
8032020-06-01 Alan Modra <amodra@gmail.com>
804
805 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
806 command against cmd_length, not the end of record. For
807 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
808 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
809 cmd_length test.
810
12adf805
DF
8112020-05-28 David Faust <david.faust@oracle.com>
812
813 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
814 R_BPF_INSN_{32,64} relocations.
815
66e3eb08
SC
8162020-05-28 Stephen Casner <casner@acm.org>
817
818 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
819 addreses in .long (used in testsuites) and .stab values.
820
a6dbf402
L
8212020-05-27 H.J. Lu <hongjiu.lu@intel.com>
822
823 PR ld/22909
824 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
825 Check bfd_link_dll when issue a DT_TEXTREL warning.
826 * elfxx-x86.c (maybe_set_textrel): Likewise.
827 (_bfd_x86_elf_size_dynamic_sections): Likewise.
828
9e7cb4c3
NC
8292020-05-26 Nick Clifton <nickc@redhat.com>
830
831 * plugin.c (try_load_plugin): Extend error message when a plugin
832 fails to open.
833
c892b447
AM
8342020-05-23 Alan Modra <amodra@gmail.com>
835
836 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
837
6f3fe02b
AM
8382020-05-22 Alan Modra <amodra@gmail.com>
839
840 PR 25882
841 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
842 attributes from shared libraries, and do not return an error if
843 they don't match.
844
0490dd41
AM
8452020-05-21 Alan Modra <amodra@gmail.com>
846
847 PR 25993
848 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
849 filename.
850 (_bfd_delete_bfd): Free the copy.
851 (_bfd_new_bfd): Free nbfd->memory on error.
852
c9594989
AM
8532020-05-21 Alan Modra <amodra@gmail.com>
854
855 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
856 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
857 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
858 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
859 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
860 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
861 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
862 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
863 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
864 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
865 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
866 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
867 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
868 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
869 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
870 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
871 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
872 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
873 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
874 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
875
8f595e9b
NC
8762020-05-20 Nelson Chu <nelson.chu@sifive.com>
877
878 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
879 get_default_version. It is used to find the default version for
880 the specific extension.
881 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
882 default_major_version and default_minor_version. Add new bfd_boolean
883 parameter *use_default_version. Set it to TRUE if we need to call
884 the callback rps->get_default_version to find the default version.
885 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
886 the default version in riscv_parsing_subset_version, and then call
887 riscv_add_subset to add the subset into subset list.
888 (riscv_parse_prefixed_ext): Likewise.
889 (riscv_std_z_ext_strtab): Support Zicsr extensions.
890 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
891 strings rather than characters.
892 riscv_merge_arch_attr_info): The callback function get_default_version
893 is only needed for assembler, so set it to NULL int the linker.
894 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
895 * elfxx-riscv.h: Updated.
896
7b958a48
AM
8972020-05-20 Alan Modra <amodra@gmail.com>
898
899 PR 25993
900 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
901 use bfd_set_filename.
902 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
903 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
904 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
905 (bfd_create): Likewise.
906 (_bfd_delete_bfd): Don't free filename.
907 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
908 return pointer to the copy or NULL on alloc fail.
909 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
910 result of bfd_set_filename.
911 * bfd-in2.h: Regenerate.
912
3c568b8a
AM
9132020-05-20 Alan Modra <amodra@gmail.com>
914
915 PR 26011
916 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
917 section size against file size.
918 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
919
6fd1d259
GN
9202020-05-19 Gunther Nikl <gnikl@justmail.de>
921
922 PR 26005
11c0dd51
NC
923 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
924 and memset when allocating memory for the sections_being_created
925 array.
6fd1d259 926
7e94cf6c
SH
9272020-05-19 Stafford Horne <shorne@gmail.com>
928
929 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
930 to relgot.
931 (or1k_elf_relocate_section): Access srelgot via
932 htab->root.srelgot. Add assertions for srelgot->contents.
933 Introduce local variable for srelgot to not reuse global
934 sreloc.
935 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
936 (or1k_set_got_and_rela_sizes): New function.
937 (or1k_initial_exec_offset): New function.
938 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
939 (or1k_elf_relocate_section): Allow for TLS to handle multiple
940 model access.
941 (or1k_elf_check_relocs): Use OR to set TLS access.
942 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
943 sizes.
944 (or1k_elf_size_dynamic_sections): Use
945 or1k_set_got_and_rela_sizes to set sizes.
946 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
947 (TCB_SIZE): New macro.
948 (tpoff): Use TCB_SIZE and alignment to calculate offset.
949 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
950 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
951 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
952 (tpoff): Add dynamic boolean argument.
953 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
954
7e057737
SP
9552020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
956
957 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
958 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
959 cases with BFD_RELOC_AARCH64_JUMP26.
960 (elfNN_aarch64_check_relocs): Likewise.
961
765cf5f6
AM
9622020-05-19 Alan Modra <amodra@gmail.com>
963
964 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
965 bfd_get_filename rather than accessing bfd->filename directly.
966 * aout-target.h (MY (object_p)): Likewise.
967 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
968 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
969 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
970 (_bfd_archive_bsd44_construct_extended_name_table),
971 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
972 (_bfd_bsd_write_armap): Likewise.
973 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
974 * cache.c (bfd_open_file): Likewise.
975 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
976 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
977 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
978 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
979 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
980 * elf32-nds32.c (nds32_elf_output_symbol_hook),
981 (patch_tls_desc_to_ie): Likewise.
982 * elf32-spu.c (sort_bfds, print_one_overlay_section),
983 (spu_elf_auto_overlay): Likewise.
984 * elf64-hppa.c (elf_hppa_final_link): Likewise.
985 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
986 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
987 * elflink.c (bfd_elf_size_dynamic_sections),
988 (elf_link_input_bfd): Likewise.
989 * linker.c (_bfd_generic_link_output_symbols): Likewise.
990 * mach-o.c (bfd_mach_o_follow_dsym),
991 (bfd_mach_o_close_and_cleanup): Likewise.
992 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
993 (find_separate_debug_file, get_build_id_name): Likewise.
994 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
995 * plugin.c (bfd_plugin_open_input): Likewise.
996 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
997 * som.c (som_write_armap): Likewise.
998 * srec.c (srec_write_record, srec_write_symbols): Likewise.
999 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
1000 (_bfd_vms_lib_write_archive_contents): Likewise.
1001 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
1002
39a1432c
AM
10032020-05-19 Alan Modra <amodra@gmail.com>
1004
1005 PR 25713
1006 * bfdio.c (_bfd_real_fopen): Typo fix.
1007
ed02cdb5
NC
10082020-05-18 Nick Clifton <nickc@redhat.com>
1009
1010 PR 26005
1011 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
1012 for the sections_being_created array.
1013
7a87e9c8
AM
10142020-05-18 Alan Modra <amodra@gmail.com>
1015
1016 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
1017 they can be freed without also freeing internal_relocs.
1018
ca859a89
JC
10192020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1020
1021 PR 25713
1022 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
1023 separators into DOS style when creating a WIN32 fullpath.
1024
fc46e8bd
NC
10252020-05-14 Nelson Chu <nelson.chu@sifive.com>
1026
1027 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
1028 to initialize RISC-V tdata.
1029
533f049e
GN
10302020-05-12 Gunther Nikl <gnikl@justmail.de>
1031
1032 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
1033 relocation size.
1034
94ba9882
AM
10352020-05-11 Alan Modra <amodra@gmail.com>
1036
1037 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
1038
7c1f4227
AM
10392020-05-11 Alan Modra <amodra@gmail.com>
1040
1041 * elf64-ppc.c: Rename powerxx to power10 throughout.
1042
4d5acb1e
AM
10432020-05-11 Alan Modra <amodra@gmail.com>
1044
1045 PR 25961
1046 * coffgen.c (coff_get_normalized_symtab): Check that buffer
1047 contains required number of auxents before processing any auxent.
1048 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
1049 file name from auxents for PE.
1050
7242fa8a
GN
10512020-05-04 Gunther Nikl <gnikl@justmail.de>
1052
1053 * aout-cris.c (DEFAULT_ARCH): Delete define.
1054 (MY_set_arch_mach): Likewise.
1055 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
1056 of bfd_arch_cris.
1057 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
1058 of r_type before the shift.
1059
10602020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
cff69cf4
WD
1061
1062 PR ld/25665
1063 * elfnn-aarch64.c (group_sections): Copy implementation from
1064 elf32-arm.c.
1065
a2714d6c
AM
10662020-05-01 Alan Modra <amodra@gmail.com>
1067
1068 PR 25900
1069 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
1070 accessing root.u.def of symbols. Also check root.u.def.section
1071 is non-NULL. Reverse tests so as to make the logic positive.
1072
a8acd6ee
AM
10732020-05-01 Alan Modra <amodra@gmail.com>
1074
1075 PR 25882
1076 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
1077 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
1078
6b728d32
AM
10792020-05-01 Alan Modra <amodra@gmail.com>
1080
1081 PR 25882
1082 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
1083 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1084 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1085 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
1086 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
1087 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
1088 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
1089 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
1090 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
1091 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
1092
91ed9b71
AM
10932020-05-01 Alan Modra <amodra@gmail.com>
1094
1095 PR 25882
1096 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
1097 from shared libraries.
1098
d548f47d
MF
10992020-04-29 Max Filippov <jcmvbkbc@gmail.com>
1100
1101 * elf32-xtensa.c (relax_section): Don't negate diff_value for
1102 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
1103 equals 0. Report overflow when the result has negative sign but
1104 all significant bits are zero.
1105
dfa85db1
GN
11062020-04-29 Gunther Nikl <gnikl@justmail.de>
1107
1108 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
1109 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
1110
48e5bada
AM
11112020-04-28 Alan Modra <amodra@gmail.com>
1112
1113 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
1114 Emit warning message.
1115
251dae91
TC
11162020-04-27 Tamar Christina <tamar.christina@arm.com>
1117
1118 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
1119 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
1120 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
1121 to x86_64_pe_big_vec as it not a big-endian format.
1122 (vec i386_pe_big_vec): New.
1123 * configure.ac: Likewise.
1124 * targets.c: Likewise.
1125 * configure: Regenerate.
1126 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
1127 COFF_WITH_PE_BIGOBJ): New.
1128 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
1129 New.
1130 (x86_64_pe_be_vec): Moved.
1131
27456742
AK
11322020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
1133
1134 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
1135 * elf.c (elfcore_grok_arc_v2): New function.
1136 (elfcore_grok_note): Call the new function to handle the corresponding
1137 note.
1138 (elfcore_write_arc_v2): New function.
1139 (elfcore_write_register_note): Call the new function to handle the
1140 corresponding pseudo-sections.
1141
30ce8e47
MF
11422020-04-22 Max Filippov <jcmvbkbc@gmail.com>
1143
1144 PR ld/25861
1145 * bfd-in2.h: Regenerated.
1146 * elf32-xtensa.c (elf_howto_table): New entries for
1147 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
1148 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
1149 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
1150 R_XTENSA_NDIFF{8,16,32}.
1151 * libbfd.h (bfd_reloc_code_real_names): Add names for
1152 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
1153 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1154 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
1155 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1156
c36876fe
TC
11572020-04-21 Tamar Christina <tamar.christina@arm.com>
1158
1159 PR binutils/24753
1160 * compress.c (bfd_get_full_section_contents): Exclude sections with no
1161 content.
1162
6f6fd151
L
11632020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1164
1165 PR ld/25849
1166 * elf-bfd.h (elf_backend_data): Add
1167 elf_backend_strip_zero_sized_dynamic_sections.
1168 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
1169 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
1170 New macro.
1171 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
1172 function.
1173 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
1174 New macro.
1175 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
1176
1f7f2abb
L
11772020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1178
1179 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
1180 sec.
1181 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
1182 DT_TEXTREL with -M.
1183 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
1184
e04f33c0
NC
11852020-04-21 Nick Clifton <nickc@redhat.com>
1186
1187 * po/sr.po: Updated Serbian translation.
1188
fad3d2c1
AM
11892020-04-21 Alan Modra <amodra@gmail.com>
1190
1191 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
1192 processing.
1193
23c8270e
SC
11942020-04-20 Stephen Casner <casner@acm.org>
1195
1196 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
1197 causing globals from linker script to be treated as debug symbols.
1198 (translate_symbol_table): Don't sign-extend symbol values from 16
1199 to 64 bits in nm output.
1200
2efec98b
AM
12012020-04-20 Alan Modra <amodra@gmail.com>
1202
1203 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
1204
18f97353
AM
12052020-04-18 Alan Modra <amodra@gmail.com>
1206
1207 * section.c (bfd_is_const_section): Correct test for special
1208 sections.
1209 * bfd-in2.h: Regenerate.
1210
8d55d10a
AM
12112020-04-17 Alan Modra <amodra@gmail.com>
1212
1213 PR 25842
1214 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
1215 NULL nodename.
1216
8e4979ac
NC
12172020-04-16 Nick Clifton <nickc@redhat.com>
1218
1219 PR 25803
1220 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
1221 abort with a more helpful error message.
1222
aec72fda
AM
12232020-04-16 Alan Modra <amodra@gmail.com>
1224
1225 PR 25827
1226 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
1227 strdup(0).
1228
95a51568
FS
12292020-04-15 Fangrui Song <maskray@google.com>
1230
1231 PR binutils/24613
1232 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
1233 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
1234 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
1235 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
1236 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1237 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
1238 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1239 * elf32-sh.c (sh_elf_relocate_section): Likewise.
1240 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1241 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
1242 * elflink.c (elf_link_output_extsym): Likewise.
1243 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
1244
7ecb5154
AM
12452020-04-15 Alan Modra <amodra@gmail.com>
1246
1247 PR 25823
1248 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
1249 pointer into strings that may be freed for section name, always
1250 allocate a new string.
1251
f717994f
JMG
12522020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1253 Jan W. Jagersma <jwjagersma@gmail.com>
1254
1255 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
1256 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1257 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
1258 (_bfd_go32_mkobject): New functions.
1259 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
1260 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1261 (go32exe_mkobject): Call _bfd_go32_mkobject.
1262 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
1263 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
1264 and COFF_GO32.
1265 (coff_write_relocs): Enable extended reloc counter code if
1266 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
1267 (coff_write_object_contents): Likewise. Pad section headers
1268 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
1269 instead of coff_swap_scnhdr_out.
1270 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
1271 enable extended reloc counter.
1272 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
1273 Declare with ATTRIBUTE_UNUSED.
1274 * libcoff-in.h: (struct coff_tdata): New field go32.
1275 (obj_go32): Define.
1276 * libcoff.h: Regenerate.
1277
34ca5531
FS
12782020-04-14 Fangrui Song <maskray@google.com>
1279
1280 PR gas/25768
1281 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
1282 12.
1283
fa1477dc
SC
12842020-04-14 Stephen Casner <casner@acm.org>
1285
1286 PR ld/25677
1287 * pdp11.c: Add implementation of --imagic option.
1288 (adjust_o_magic): Fix objcopy --extract-symbol test.
1289 * libaout.h (enum aout_magic): Add i_magic.
1290
a0543b0b
RO
12912020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1292 Nick Clifton <nickc@redhat.com>
1293
1294 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
1295 <0>: Ignore.
1296 <default>: Error rather than abort.
1297
3349112e
L
12982020-04-03 H.J. Lu <hongjiu.lu@intel.com>
1299
1300 PR ld/25767
1301 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
1302 relocation section from section group.
1303
4d095f5b
JJ
13042020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
1305
1306 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
1307 bfd->origin to file offset.
1308 * bfdwin.c (bfd_get_file_window): Likewise.
1309 * bfd.c: Clarify the use of the bfd->origin field.
1310 * bfd-in2.h: Regenerate.
1311 * coff-i386.c: Don't include go32exe.h. Allow overriding
1312 coff_write_object_contents via COFF_WRITE_CONTENTS.
1313 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
1314 (go32exe_write_object_contents): New functions.
1315 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
1316 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
1317 (create_go32_stub): Remove check for 2k size limit. Read stub
1318 from go32exe_temp_stub if present.
1319 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
1320 copy variable-length stub.
1321 (go32_check_format): Read stub to go32exe_temp_stub, set
1322 origin, return go32exe_cleanup.
1323 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
1324 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
1325 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
1326 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
1327 Remove functions and their associated #defines.
1328 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
1329 * libcoff-in.h: (struct coff_tdata): New field stub_size.
1330 Rename field go32stub to stub.
1331 * libcoff.h: Regenerate.
1332 * coff-stgo32.c (go32_check_format): Rename to...
1333 (go32exe_check_format): ...this.
1334 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
1335 (go32exe_copy_private_bfd_data): ...this.
1336 (stub_bytes): Rename to...
1337 (go32exe_default_stub): ...this.
1338 (create_go32_stub): Rename to...
1339 (go32exe_create_stub): ...this.
1340 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
1341 when possible.
1342
382aae06
L
13432020-04-01 H.J. Lu <hongjiu.lu@intel.com>
1344
1345 PR ld/25749
1346 PR ld/25754
1347 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
1348 relocation to R_386_32 for relocation against non-preemptible
1349 absolute symbol.
1350 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
1351 allocate dynamic relocation for non-preemptible absolute symbol.
1352 (elf_i386_relocate_section): Pass sec to
1353 GENERATE_DYNAMIC_RELOCATION_P.
1354 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
1355 (elf_x86_64_convert_load_reloc): Covert load relocation to
1356 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
1357 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
1358 for non-preemptible absolute symbol if they overflow.
1359 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
1360 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
1361 symbol. Don't allocate dynamic relocation for non-preemptible
1362 absolute symbol.
1363 (elf_x86_64_relocate_section): Don't generate relative relocation
1364 for GOTPCREL relocations aganst local absolute symbol. Pass sec
1365 to GENERATE_DYNAMIC_RELOCATION_P.
1366 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
1367 against non-preemptible absolute symbol.
1368 (_bfd_elf_x86_valid_reloc_p): New function.
1369 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
1370 GOT_ABS GOT slot.
1371 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
1372 argument. Don't generate dynamic relocation against
1373 non-preemptible absolute symbol.
1374 (ABS_SYMBOL_P): New.
1375 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
1376 against non-preemptible absolute symbol.
1377 (GOT_ABS): New.
1378 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
1379 (_bfd_elf_x86_valid_reloc_p): New.
1380
a7618269
TC
13812020-04-01 Tamar Christina <tamar.christina@arm.com>
1382
1383 PR ld/16017
1384 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
1385 address in the GOT if in thumb only mode.
1386
15ccbdd7
TC
13872020-04-01 Tamar Christina <tamar.christina@arm.com>
1388
1389 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
1390
7b948a25
HPN
13912020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
1392
1393 * mmo.c (mmo_scan): Create .text section only when needed, not
1394 from the start.
1395
89b599df
AM
13962020-03-31 Alan Modra <amodra@gmail.com>
1397
1398 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
1399 return value check.
1400
81699544
AM
14012020-03-31 Alan Modra <amodra@gmail.com>
1402
1403 * vms-alpha.c (image_write): Check bounds for sections without
1404 contents too. Error on non-zero write to section without
1405 contents.
1406 (_bfd_vms_slurp_etir): Check return of image_write* functions.
1407
b3b360de
AM
14082020-03-31 Alan Modra <amodra@gmail.com>
1409
1410 * tekhex.c (pass_over): Check is_eof before reading buffer.
1411
00386881
NC
14122020-03-30 Nick Clifton <nickc@redhat.com>
1413
1414 PR binutils/pr25662
1415 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
1416 field to timestamp and make it an integer.
1417 * libcoff.h: Regenerate.
1418 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
1419 field in the pe_data structure rather than the insert_timestamp
1420 field.
1421
988b7300
AM
14222020-03-30 Alan Modra <amodra@gmail.com>
1423
1424 PR 25745
1425 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
1426 statistics message.
1427
aa49fc22
NC
14282020-03-26 Nick Clifton <nickc@redhat.com>
1429
1430 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
1431 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
1432 prototype.
1433 * libbfd.h: Regenerate.
1434
ff768510
AM
14352020-03-26 Alan Modra <amodra@gmail.com>
1436
1437 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
1438
f75fbe8a
AM
14392020-03-26 Alan Modra <amodra@gmail.com>
1440
1441 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
1442 array.
1443 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
1444
aac88046
NC
14452020-03-25 Nick Clifton <nickc@redhat.com>
1446
1447 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
1448 function.
1449 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
1450 * libbfd.h: Regenerate.
1451
cf2611fe
SV
14522020-03-25 Shahab Vahedi <shahab@synopsys.com>
1453
1454 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
1455 correct field name in the output string.
1456
d16e3d2e
AM
14572020-03-25 Alan Modra <amodra@gmail.com>
1458
1459 PR 25662
1460 * elf.c (assign_file_positions_for_load_sections): Adjust offset
1461 for SHT_NOBITS section if first in segment.
1462
1081065c
L
14632020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1464
1465 PR binutils/25708
1466 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
1467 (_bfd_elf_get_symbol_version_string): This.
1468 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
1469 (_bfd_elf_get_symbol_version_string): This.
1470 (bfd_elf_print_symbol): Pass TRUE to
1471 _bfd_elf_get_symbol_version_string.
1472 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
1473 bfd_boolean argument.
1474 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
1475 * targets.c (_bfd_get_symbol_version_string): Likewise.
1476 (bfd_get_symbol_version_string): Likewise.
1477 * bfd-in2.h: Regenerated.
1478
0b8448af 14792020-03-24 Nick Clifton <nickc@redhat.com>
e11cd7c4 1480 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
0b8448af
NC
1481
1482 PR 25713
1483 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
1484 Win32 systems.
1485
ec2e748a
NC
14862020-03-24 Nick Clifton <nickc@redhat.com>
1487
1488 PR 25681
1489 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
1490 segment to use for PT_GNU_RELRO, ignore empty sections in a
1491 segment's current list.
1492
cda7e560
L
14932020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1494
1495 PR binutils/25717
1496 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
1497
7e6e972f
L
14982020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1499
1500 PR binutils/25708
1501 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
1502 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
1503 on the previous _bfd_elf_get_symbol_version_string.
1504 (_bfd_elf_get_symbol_version_string): Use it.
1505
65109548
AM
15062020-03-24 Alan Modra <amodra@gmail.com>
1507
1508 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
1509 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
1510 struct areltdata.
1511
fdde2fb6
SH
15122020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
1513
1514 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
1515
cf28cfef
AM
15162020-03-23 Alan Modra <amodra@gmail.com>
1517
1518 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
1519 symbol count. Allocate an extra byte to ensure name strings
1520 are terminated. Sanity check name offsets. Release memory on
1521 error return.
1522
5e737279
AM
15232020-03-23 Alan Modra <amodra@gmail.com>
1524
1525 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
1526 field hasn't been read. Remove unnecessary casts.
1527
c15a8f17
AM
15282020-03-22 Alan Modra <amodra@gmail.com>
1529
1530 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
1531 enough to read number of symbols.
1532
3d98c460
L
15332020-03-20 H.J. Lu <hongjiu.lu@intel.com>
1534
1535 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
1536 (EXECUTABLE_SUFFIX): Likewise.
1537 * config.in: Regenerated.
1538 * configure: Likewise.
1539 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
1540 _bfd_generic_close_and_cleanup.
1541 (plugin_list_entry): Remove resolution_file, resolution_option,
1542 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
1543 lto_wrapper, gcc_env and initialized,
1544 (need_lto_wrapper_p): Removed.
1545 (get_lto_wrapper): Likewise.
1546 (setup_lto_wrapper_env): Likewise.
1547 (register_all_symbols_read): Likewise.
1548 (egister_cleanup): Likewise.
1549 (get_symbols): Likewise.
1550 (add_input_file): Likewise.
1551 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
1552 (add_symbols): Updated.
1553 (try_claim): Likewise.
1554 (try_load_plugin): Likewise.
1555 (bfd_plugin_canonicalize_symtab): Likewise.
1556 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
1557 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
1558
c3a1714c
L
15592020-03-19 H.J. Lu <hongjiu.lu@intel.com>
1560
1561 PR binutils/25640
1562 * plugin.c (plugin_list_entry): Add has_symbol_type.
1563 (add_symbols_v2): New function.
1564 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
1565 provides symbol type.
1566 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
1567 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
1568 available.
1569
67338173
AM
15702020-03-20 Alan Modra <amodra@gmail.com>
1571
1572 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
1573 enough to read number of symbols.
1574
a859124d
AM
15752020-03-20 Alan Modra <amodra@gmail.com>
1576
1577 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
1578 backend functions for NULL before calling.
1579 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
1580 (bfd_section_from_shdr, assign_section_numbers): Likewise.
1581 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
1582 * elfnn-ia64.c (ignore_errors): New function.
1583 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
1584
f3a08f77
NC
15852020-03-19 Nick Clifton <nickc@redhat.com>
1586
1587 PR 25676
1588 * dwarf2.c (struct varinfo): Add unit_offset field to record the
1589 location of the varinfo in the unit's debug info data. Change the
1590 type of the stack field to a boolean.
1591 (lookup_var_by_offset): New function. Returns the varinfo
1592 structure for the variable described at the given offset in the
1593 unit's debug info.
1594 (scan_unit_for_symbols): Add support for variables which have the
1595 DW_AT_specification attribute.
1596
6a541707
NC
15972020-03-19 Nick Clifton <nickc@redhat.com>
1598
1599 PR 25699
1600 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
1601 error return.
1602
effc14f5
SH
16032020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
1604
1605 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
1606
ac4bf06c
NC
16072020-03-18 Nick Clifton <nickc@redhat.com>
1608
1609 PR 25673
1610 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
1611 memory access when processing a corrupt secondary reloc section.
1612
53215f21
CL
16132020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
1614
1615 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
1616 instead of calling abort.
1617 * elf32-csky.c (csky_build_one_stub): Likewise.
1618 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1619 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1620 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1621 * elf32-metag.c (metag_build_one_stub): Likewise.
1622 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1623 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1624 (ppc_size_one_stub): Likewise.
1625 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1626
327ef784
NC
16272020-03-17 Nick Clifton <nickc@redhat.com>
1628
d3c3c542 1629 PR 25688
327ef784
NC
1630 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
1631 with error messages.
1632
ecbbbdba
NC
16332020-03-17 Nick Clifton <nickc@redhat.com>
1634
1635 PR 25687
1636 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
1637 free. Add free on another failure path.
1638
4b3ecb3b
AM
16392020-03-16 Alan Modra <amodra@gmail.com>
1640
1641 PR 25675
1642 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
1643 we have a non-zero section count. Do lma comparison in octets.
1644
7bac4137
AM
16452020-03-16 Alan Modra <amodra@gmail.com>
1646
1647 * vms-alpha.c (dst_restore_location): Validate index into
1648 dst_ptr_offsets array before accessing. Return status.
1649 (dst_retrieve_location): Similarly, making "loc" parameter a
1650 pointer to return value.
1651 (_bfd_vms_slurp_etir): Update calls to above functions.
1652
8b5d0a4f
KR
16532020-03-14 Kamil Rytarowski <n54@gmx.com>
1654
1655 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
1656 targets.
1657 * configure: Regenerated.
1658
48e81d7f
AM
16592020-03-14 Alan Modra <amodra@gmail.com>
1660
1661 * section.c (BFD_FAKE_SECTIONS): Formatting.
1662 * bfd-in2.h: Regenerate.
1663
06d949ec
KR
16642020-03-13 Kamil Rytarowski <n54@gmx.com>
1665
1666 * elf.c (elfcore_grok_netbsd_note): Add support for
1667 NT_NETBSDCORE_LWPSTATUS notes.
1668
abf874aa
CL
16692020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
1670
1671 * bfd-in2.h: Regenerate.
1672 * section.c (asection): Add already_assigned field.
1673 (BFD_FAKE_SECTION): Add default initializer for it.
1674 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
1675 * elf32-arm.c (arm_build_one_stub): Add support for
1676 non_contiguous_regions.
1677 * elf32-csky.c (csky_build_one_stub): Likewise.
1678 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1679 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1680 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1681 * elf32-metag.c (metag_build_one_stub): Likewise.
1682 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1683 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1684 (ppc_size_one_stub): Likewise.
1685 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1686 * elflink.c (elf_link_input_bfd): Likewise.
1687
74e10d17
L
16882020-03-13 H.J. Lu <hongjiu.lu@intel.com>
1689
1690 PR ld/24920
1691 * elf-linker-x86.h (elf_linker_x86_params): Add
1692 static_before_all_inputs and has_dynamic_linker.
1693 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
1694 dynamic input objects if -static is passed at command-line
1695 before all input files without --dynamic-linker unless
1696 --no-dynamic-linker is used.
1697
015ec493
KR
16982020-03-13 Kamil Rytarowski <n54@gmx.com>
1699
1700 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
1701
66631823
CE
17022020-03-13 Christian Eggers <ceggers@gmx.de>
1703
1704 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
1705 "p_paddr" from "at".
1706 * elfcode.h (bfd_from_remote_memory): Add units to several
1707 parameters. New local "opb". Fix usage of p_align. Fix
1708 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
1709 call of target_read_memory.
1710 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
1711 calculation of "offset" and "output_offset".
1712 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
1713 from "offset" and fix calculation of "end" from "vma+size". Fix
1714 comparison between "sh_addr" and "vma"/"output_offset".
1715 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
1716 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
1717 member.
1718 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
1719 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
1720 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
1721 assignment of p_paddr from phdr_lma. Fix comparison between
1722 "lma+size" and "next->lma".
1723 (elf_sort_segments): Fix assignment from p_paddr to lma.
1724 (assign_file_positions_for_load_sections): Add unit (bytes) to
1725 local "align". Fix calculation of local "off_adjust". Fix
1726 calculation of local "filehdr_vaddr".
1727 (assign_file_positions_for_non_load_sections): New local "opb".
1728 Fix calculation of "end" from "p_size". Fix comparison between
1729 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
1730 from "end" and "p_vaddr".
1731 (rewrite_elf_program_header): Fix comparison between p_vaddr and
1732 vma. Fix assignment to p_paddr from lma. Fix comparison between
1733 p_paddr and lma. Fix assignment to p_paddr from lma.
1734 * merge.c (sec_merge_emit): New local "opb". Convert
1735 "alignment_power" to octets.
1736 (_bfd_add_merge_section): New locals "alignment_power" and
1737 "opb". Fix comparison between "alignment_power" and
1738 "sizeof(align)".
1739 (_bfd_merge_sections): New local "opb". Divide size by opb
1740 before checking align mask.
1741
502794d4
CE
17422020-03-13 Christian Eggers <ceggers@gmx.de>
1743
1744 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
1745 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
1746 section LMA/VMA.
1747 (_bfd_elf_make_section_from_phdr): Similarly.
1748 (elf_fake_sections): Fix calculation of
1749 Elf_Internal_shdr::sh_addr from section VMA.
1750 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
1751 and bytes.
1752 (assign_file_positions_for_load_sections): Fix calculations of
1753 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
1754 comparison between program header address and section LMA.
1755 (assign_file_positions_for_non_load_sections): Likewise.
1756 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
1757 (IS_CONTAINED_BY_VMA): Add parameter opb.
1758 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
1759 INCLUDE_SECTION_IN_SEGMENT): Likewise.
1760 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
1761 Fix calculations of p_addr_valid and p_vaddr_offset.
1762 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
1763 with octets per byte when comparing against p_vaddr.
1764
8248d21a
AM
17652020-03-11 Alan Modra <amodra@gmail.com>
1766
1767 * som.c (setup_sections): Sanity check subspace.name.
1768
435edf0b
AM
17692020-03-11 Alan Modra <amodra@gmail.com>
1770
1771 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
1772
6b5e16ff
AM
17732020-03-10 Alan Modra <amodra@gmail.com>
1774
1775 PR 25648
1776 * ihex.c (ihex_write_object_contents): Don't assume ordering of
1777 addresses here.
1778
2f57795b
AM
17792020-03-09 Alan Modra <amodra@gmail.com>
1780
1781 * wasm-module.c (wasm_scan): Sanity check file name length
1782 before allocating memory. Move common section setup code. Do
1783 without bfd_tell to calculate section size.
1784
a0dcf297
NC
17852020-03-06 Nick Clifton <nickc@redhat.com>
1786
1787 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
1788 with error messages and failure return values.
1789
e15a8da9
MF
17902020-03-05 Max Filippov <jcmvbkbc@gmail.com>
1791
1792 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
1793 relocation sections for any removed reference to a dynamic symbol.
1794
a8e14f4c
NC
17952020-03-05 Nick Clifton <nickc@redhat.com>
1796
1797 * elf-bfd.h (struct elf_backend_data): Add new fields:
1798 init_secondary_reloc_section, slurp_secondary_reloc_section,
1799 write_secondary_reloc_section.
1800 (_bfd_elf_init_secondary_reloc_section): Prototype.
1801 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
1802 (_bfd_elf_write_secondary_reloc_section): Prototype.
1803 * elf.c ( bfd_section_from_shdr): Invoke the new
1804 init_secondary_reloc_section backend function, if defined, when a
1805 second reloc section is encountered.
1806 (swap_out_syms): Invoke the new symbol_section_index function, if
1807 defined, when computing the section index of an OS/PROC specific
1808 symbol.
1809 (_bfd_elf_init_secondary_reloc_section): New function.
1810 (_bfd_elf_slurp_secondary_reloc_section): New function.
1811 (_bfd_elf_write_secondary_reloc_section): New function.
1812 (_bfd_elf_copy_special_section_fields): New function.
1813 * elfcode.h (elf_write_relocs): Invoke the new
1814 write_secondary_relocs function, if defined, in order to emit
1815 secondary relocs.
1816 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
1817 function, if defined, in order to read in secondary relocs.
1818 * elfxx-target.h (elf_backend_copy_special_section_fields):
1819 Provide a non-NULL default definition.
1820 (elf_backend_init_secondary_reloc_section): Likewise.
1821 (elf_backend_slurp_secondary_reloc_section): Likewise.
1822 (elf_backend_write_secondary_reloc_section): Likewise.
1823 (struct elf_backend_data elfNN_bed): Add initialisers for the new
1824 fields.
1825 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
1826 * configure: Regenerate.
1827
6f8f95b4
AM
18282020-03-05 Alan Modra <amodra@gmail.com>
1829
1830 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
1831 against file size before allocating memory. Use bfd_alloc rather
1832 than bfd_zalloc for carsym/strings memory.
1833
233bf4f8
AM
18342020-03-04 Alan Modra <amodra@gmail.com>
1835
1836 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
1837 sh_addr mod sh_addalign is zero.
1838
1039fd9a
AM
18392020-03-04 Alan Modra <amodra@gmail.com>
1840
1841 * format.c (bfd_check_format_matches): Call cleanup on error exit.
1842
f5714099
AM
18432020-03-03 Alan Modra <amodra@gmail.com>
1844
1845 * format.c (struct bfd_preserve): Add cleanup field.
1846 (bfd_preserve_save): Add cleanup param and save.
1847 (bfd_preserve_restore): Return cleanup.
1848 (bfd_preserve_finish): Call the cleanup for the discarded match.
1849 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
1850 and clear when preserving a match. Restore cleanup too when
1851 restoring that match.
1852
40b35c78
AM
18532020-03-02 Alan Modra <amodra@gmail.com>
1854
1855 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
1856 * hpux-core.c (hpux_core_core_file_p): Update prototype.
1857 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
1858 (core_sco5_vec): Correct initialisers.
1859
601b73d5
AM
18602020-03-02 Alan Modra <amodra@gmail.com>
1861
1862 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
1863 * aix5ppc-core.c (xcoff64_core_p): Likewise.
1864 * cisco-core.c (cisco_core_file_validate): Likewise.
1865 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
1866 * hpux-core.c (hpux_core_core_file_p): Likewise.
1867 * irix-core.c (irix_core_core_file_p): Likewise.
1868 * lynx-core.c (lynx_core_file_p): Likewise.
1869 * netbsd-core.c (netbsd_core_file_p): Likewise.
1870 * osf-core.c (osf_core_core_file_p): Likewise.
1871 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1872 * sco5-core.c (sco5_core_file_p): Likewise.
1873
728d32c4
L
18742020-03-02 H.J. Lu <hongjiu.lu@intel.com>
1875
1876 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
1877
cb001c0d
AM
18782020-03-02 Alan Modra <amodra@gmail.com>
1879
1880 * targets.c (bfd_cleanup): New typedef.
1881 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
1882 * libbfd-in.h (_bfd_no_cleanup): Define.
1883 * format.c (bfd_reinit): Add cleanup parameter, call it.
1884 (bfd_check_format_matches): Set cleanup from _bfd_check_format
1885 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
1886 * aout-target.h (callback, object_p): Return bfd_cleanup.
1887 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
1888 * archive.c (bfd_generic_archive_p): Likewise.
1889 * binary.c (binary_object_p): Likewise.
1890 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
1891 * coff-ia64.c (ia64coff_object_p): Likewise.
1892 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
1893 * coff-sh.c (coff_small_object_p): Likewise.
1894 * coff-stgo32.c (go32_check_format): Likewise.
1895 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
1896 (xcoff64_core_p): Likewise.
1897 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
1898 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
1899 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
1900 * elfcode.h (elf_object_p): Likewise.
1901 * elfcore.h (elf_core_file_p): Likewise.
1902 * i386msdos.c (msdos_object_p): Likewise.
1903 * ihex.c (ihex_object_p): Likewise.
1904 * libaout.h (some_aout_object_p): Likewise.
1905 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
1906 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
1907 * libbfd.c (_bfd_dummy_target): Likewise.
1908 * libcoff-in.h (coff_object_p): Likewise.
1909 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
1910 (bfd_mach_o_arm64_core_p): Likewise.
1911 * mach-o-arm.c (bfd_mach_o_arm_object_p),
1912 (bfd_mach_o_arm_core_p): Likewise.
1913 * mach-o-i386.c (bfd_mach_o_i386_object_p),
1914 (bfd_mach_o_i386_core_p): Likewise.
1915 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
1916 (bfd_mach_o_x86_64_core_p): Likewise.
1917 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
1918 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
1919 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
1920 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
1921 * mmo.c (mmo_object_p): Likewise.
1922 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
1923 * peicode.h (coff_real_object_p, pe_ILF_object_p),
1924 (pe_bfd_object_p): Likewise.
1925 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
1926 * ppcboot.c (ppcboot_object_p): Likewise.
1927 * rs6000-core.c (rs6000coff_core_p): Likewise.
1928 * som.c (som_object_setup, som_object_p): Likewise.
1929 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
1930 * tekhex.c (tekhex_object_p): Likewise.
1931 * vms-alpha.c (alpha_vms_object_p): Likewise.
1932 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
1933 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
1934 * wasm-module.c (wasm_object_p): Likewise.
1935 * xsym.c (bfd_sym_object_p): Likewise.
1936 * xsym.h (bfd_sym_object_p): Likewise.
1937 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
1938 return type.
1939 * pdp11.c (some_aout_object_p): Likewise.
1940 * plugin.c (register_ld_plugin_object_p): Update object_p
1941 parameter type.
1942 * plugin.h (register_ld_plugin_object_p): Likewise.
1943 * bfd-in2.h: Regenerate.
1944 * libbfd.h: Regenerate.
1945 * libcoff.h: Regenerate.
1946
a4dd6c97
AM
19472020-03-02 Alan Modra <amodra@gmail.com>
1948
1949 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
1950 applicable section flags.
1951 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
1952 (mips_ecoff_bele_vec): Likewise.
1953 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
1954 and .sbss sections.
1955 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
1956 (_bfd_ecoff_styp_to_sec_flags): Likewise.
1957
bf577467
AM
19582020-03-02 Alan Modra <amodra@gmail.com>
1959
1960 * elf32-m32r.c (m32r_elf_section_flags): New function.
1961 (elf_backend_section_flags): Define.
1962 * elf32-nds32.c (nds32_elf_section_flags): New function.
1963 (elf_backend_section_flags): Define.
1964 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
1965 .sbss and .sdata sections.
1966 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
1967 for SHF_V850_GPREL sections.
1968 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
1969 FIXME.
1970 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
1971 for SHF_PARISC_SHORT sections.
1972 * elf64-ppc.c (ppc64_elf_section_flags): New function.
1973 (elf_backend_section_flags): Define.
1974 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
1975 for SHF_MIPS_GPREL sections. Delete FIXME.
1976
8c803a2d
AM
19772020-03-02 Alan Modra <amodra@gmail.com>
1978
1979 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
1980 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
1981 calling elf_backend_section_flags with adjusted params. Use
1982 newsect->flags past that point.
1983 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
1984 special sections.
1985 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
1986 to have their type overridden, and all sh_flags but processor and
1987 os specific.
1988 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
1989 * elf32-mep.c (mep_elf_section_flags): Likewise.
1990 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
1991 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
1992 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
1993 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
1994 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
1995 stub BFD and non-aarch64 input files when scanning for stubs.
1996
7d4b2d2d
AM
19972020-03-02 Alan Modra <amodra@gmail.com>
1998
1999 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
2000 limit to decompressed element size.
2001
26f60d59
AM
20022020-03-02 Alan Modra <amodra@gmail.com>
2003
2004 * vms-lib.c (vms_traverse_index): Add recur_count param and
2005 update calls. Fail on excessive recursion.
2006
9cb56943
AM
20072020-03-02 Alan Modra <amodra@gmail.com>
2008
2009 * vms-alpha.c (vms_get_remaining_object_record): Use
2010 bfd_realloc_or_free rather than bfd_realloc.
2011 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
2012 (dst_define_location, parse_module): Likewise, and check realloc
2013 return status before using memory. Return status from function
2014 adjusting all callers.
2015
182ec670
AM
20162020-02-28 Alan Modra <amodra@gmail.com>
2017
2018 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
2019
1b088c82
AM
20202020-02-28 Alan Modra <amodra@gmail.com>
2021
2022 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
2023 Remove duplicate undersize check.
2024
5f602802
AM
20252020-02-27 Alan Modra <amodra@gmail.com>
2026
2027 PR 24511
2028 * mmo.c (mmo_scan): Set SEC_DATA for .data.
2029
49d9fd42
AM
20302020-02-27 Alan Modra <amodra@gmail.com>
2031
2032 PR 24511
2033 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
2034 (coff_section_type): Adjust comment.
2035 (decode_section_type): Likewise. Call coff_section_type before
2036 decode_section_type.
2037 (bfd_decode_symclass): Use 'c' for common sections other than
2038 the standard one.
2039
05f52dc2
AM
20402020-02-27 Alan Modra <amodra@gmail.com>
2041
2042 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
2043 malloc'd block.
2044
ff69a894
AM
20452020-02-27 Alan Modra <amodra@gmail.com>
2046
2047 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
2048 if file is an archive element.
2049 * bfd-in2.h: Regenerate.
2050
02f7e7ee
AM
20512020-02-26 Alan Modra <amodra@gmail.com>
2052
2053 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
2054 bfd_set_error on failing test. Don't bother changing bfd_error on
2055 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
2056 Check sym name is within string buffer. Use size_t for some vars.
2057 (do_slurp_coff_armap): Use size_t for some variables, fix size of
2058 int_buf. Don't change bfd_error on file read error. Use
2059 _bfd_mul_overflow when calculating carsym buffer size. Reorder
2060 calculations to catch overflows before they occur. malloc and
2061 free raw armap rather than using bfd_alloc. Read raw armap before
2062 allocating carsym+strings buffer.
2063 (_bfd_slurp_extended_name_table): Localize variables. Check
2064 name size against file size.
2065
cc4c4f40
AM
20662020-02-26 Alan Modra <amodra@gmail.com>
2067
2068 * vms-lib.c (vms_lib_read_index): Release correct buffer.
2069
e0b317de
AM
20702020-02-26 Alan Modra <amodra@gmail.com>
2071
2072 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
2073 malloc. Check for NULL return from bfd_malloc.
2074 (rx_table_find, rx_table_map): Likewise.
2075 (rx_set_section_contents): Check bfd_alloc return.
2076 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
2077
dc1e8a47
AM
20782020-02-26 Alan Modra <amodra@gmail.com>
2079
2080 * aoutx.h: Indent labels correctly. Format error strings.
2081 * archive.c: Likewise.
2082 * archive64.c: Likewise.
2083 * coff-arm.c: Likewise.
2084 * coff-rs6000.c: Likewise.
2085 * coff-stgo32.c: Likewise.
2086 * cpu-arm.c: Likewise.
2087 * dwarf2.c: Likewise.
2088 * elf-ifunc.c: Likewise.
2089 * elf-properties.c: Likewise.
2090 * elf-s390-common.c: Likewise.
2091 * elf-strtab.c: Likewise.
2092 * elf.c: Likewise.
2093 * elf32-arm.c: Likewise.
2094 * elf32-bfin.c: Likewise.
2095 * elf32-cr16.c: Likewise.
2096 * elf32-csky.c: Likewise.
2097 * elf32-i386.c: Likewise.
2098 * elf32-m68k.c: Likewise.
2099 * elf32-msp430.c: Likewise.
2100 * elf32-nds32.c: Likewise.
2101 * elf32-nios2.c: Likewise.
2102 * elf32-pru.c: Likewise.
2103 * elf32-xtensa.c: Likewise.
2104 * elf64-ia64-vms.c: Likewise.
2105 * elf64-x86-64.c: Likewise.
2106 * elfcode.h: Likewise.
2107 * elfcore.h: Likewise.
2108 * elflink.c: Likewise.
2109 * elfnn-aarch64.c: Likewise.
2110 * elfnn-ia64.c: Likewise.
2111 * elfnn-riscv.c: Likewise.
2112 * elfxx-mips.c: Likewise.
2113 * elfxx-sparc.c: Likewise.
2114 * elfxx-x86.c: Likewise.
2115 * i386lynx.c: Likewise.
2116 * merge.c: Likewise.
2117 * pdp11.c: Likewise.
2118 * plugin.c: Likewise.
2119 * reloc.c: Likewise.
2120
e310298c
AM
21212020-02-26 Alan Modra <amodra@gmail.com>
2122
2123 PR 25593
2124 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
2125 "dyn_loaded".
2126 (bfd_elf_add_dt_needed_tag): Declare.
2127 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
2128 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
2129 from elf_add_dt_needed_tag. Remove soname and doit param.
2130 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
2131 to see whether as-needed lib is already loaded, use dyn_loaded
2132 list instead. When saving and restoring around as-needed lib
2133 handle possibility that dynstr has not been initialised. Don't
2134 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
2135 Mark libs loaded via DT_NEEDED entries of other libs with
2136 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
2137 the output.
2138 (elf_link_check_versioned_symbol): Remove now unneccesary
2139 DYNAMIC check when traversing dyn_loaded list.
2140
b570b954
AM
21412020-02-26 Alan Modra <amodra@gmail.com>
2142
2143 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
2144
ecda9016
L
21452020-02-25 H.J. Lu <hongjiu.lu@intel.com>
2146
2147 PR binutils/25584
2148 * plugin.c (need_lto_wrapper_p): New.
2149 (bfd_plugin_set_program_name): Add an int argument to set
2150 need_lto_wrapper_p.
2151 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
2152 set.
2153 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
2154
a98c743f
AM
21552020-02-24 Alan Modra <amodra@gmail.com>
2156
2157 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
2158
c893ce36
AM
21592020-02-24 Alan Modra <amodra@gmail.com>
2160
2161 * vms-lib.c (struct carsym_mem): Add limit.
2162 (vms_add_index): Heed limit.
2163 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
2164 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
2165 Always return actual number read.
2166 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
2167 assertion with error exit.
2168
7b3c2715
AM
21692020-02-22 Alan Modra <amodra@gmail.com>
2170
2171 PR 25585
2172 * elf.c (assign_file_positions_for_load_sections): Continue linking
2173 on "PHDR segment not covered by LOAD segment" errors.
2174
a4425a57
AM
21752020-02-21 Alan Modra <amodra@gmail.com>
2176
2177 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
2178 overflow check.
2179 (bfd_mach_o_canonicalize_reloc): Likewise.
2180 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
2181 counts and offsets against file size.
2182 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
2183 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
2184 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
2185 against file size. Delete symbol table error message.
2186 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
2187 against file size.
2188 (bfd_mach_o_read_symtab): Likewise.
2189 (bfd_mach_o_read_command): Pass file size.
2190 (bfd_mach_o_scan): Sanity check command count against file size.
2191
dda2980f
AM
21922020-02-21 Alan Modra <amodra@gmail.com>
2193
2194 PR 25569
2195 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
2196 "text", "data" and "bss" section pointer vars. Don't update
2197 section size, just exec header sizes.
2198 (adjust_sizes_and_vmas): Don't update text section size. Set
2199 initial exec header a_text. Print exec headers sizes.
2200 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
2201 (adjust_sizes_and_vmas): Similarly. Formatting.
2202 (final_link): Correct final file extension.
2203
00e49dff
NC
22042020-02-20 Nick Clifton <nickc@redhat.com>
2205
2206 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
2207 callback.
2208 * elfxx-target.h (elf_backend_symbol_section_index): Provide
2209 default definition.
2210 (elfNN_bed): Initialise the symbol_section_index field.
2211 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
2212 OS and PROC specific section indicies. Warn if converting other
2213 reserved incidies to SHN_ABS.
2214
fcaaac0a
SB
22152020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
2216
2217 PR 25537
2218 * cpu-z80.c: Add machine type compatibility checking.
2219
dcf06b89
L
22202020-02-19 H.J. Lu <hongjiu.lu@intel.com>
2221
2222 PR binutils/25355
2223 * plugin.c (plugin_list_entry): Remove handle.
2224 (try_load_plugin): Call dlclose before return.
2225
2c7c5554
AM
22262020-02-19 Alan Modra <amodra@gmail.com>
2227
2228 * libbfd-in.h (_bfd_constant_p): Define.
2229 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
2230 file size before allocating memory.
2231 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
2232 * elf.c (bfd_elf_get_str_section): Likewise.
2233 (_bfd_elf_slurp_version_tables): Likewise.
2234 * libbfd.h: Regenerate.
2235
2bb3687b
AM
22362020-02-19 Alan Modra <amodra@gmail.com>
2237
2238 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
2239 * aoutx.h (aout_get_external_symbols): Replace calls to
2240 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
2241 (slurp_reloc_table): Likewise.
2242 * archive.c (do_slurp_bsd_armap): Likewise.
2243 (do_slurp_coff_armap): Likewise.
2244 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
2245 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
2246 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
2247 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
2248 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
2249 (_bfd_coff_get_external_symbols): Likewise.
2250 * ecoff.c (ecoff_slurp_symbolic_header),
2251 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
2252 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
2253 (ecoff_indirect_link_order): Likewise.
2254 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
2255 (_bfd_elf_slurp_version_tables): Likewise.
2256 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2257 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2258 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2259 * elf64-alpha.c (READ): Likewise.
2260 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
2261 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
2262 * elfcode.h (elf_slurp_symbol_table),
2263 (elf_slurp_reloc_table_from_section): Likewise.
2264 * elflink.c (elf_link_add_object_symbols),
2265 (elf_link_check_versioned_symbol): Likewise.
2266 * elfxx-mips.c (READ): Likewise.
2267 * i386lynx.c (slurp_reloc_table): Likewise.
2268 * lynx-core.c (lynx_core_file_p): Likewise.
2269 * mach-o.c (bfd_mach_o_canonicalize_relocs),
2270 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
2271 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
2272 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
2273 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
2274 (bfd_pef_parse_symbols): Likewise.
2275 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
2276 * som.c (setup_sections, som_slurp_string_table),
2277 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2278 (som_bfd_fill_in_ar_symbols): Likewise.
2279 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
2280 (evax_bfd_print_image): Likewise.
2281 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
2282 * wasm-module.c (wasm_scan): Likewise.
2283 * xcofflink.c (xcoff_link_add_symbols): Likewise.
2284 * xsym.c (bfd_sym_read_name_table),
2285 (bfd_sym_print_type_information_table_entry): Likewise.
2286 * libbfd.h: Regenerate.
2287
806470a2
AM
22882020-02-19 Alan Modra <amodra@gmail.com>
2289
2290 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
2291 reading external relocs.
2292 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
2293 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
2294 after bfd_bread.
2295 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
2296 bfd_release.
2297 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
2298 (m32c_elf_relax_section): Likewise.
2299 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
2300 (rl78_elf_relax_section): Likewise.
2301 * elf32-rx.c (rx_offset_for_reloc): Likewise.
2302 (elf32_rx_relax_section): Likewise.
2303 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
2304 parameter types and use..
2305 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
2306 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
2307 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
2308 being read from file, just the extra.
2309 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
2310 after reading external syms. Free on failure.
2311
1f4361a7
AM
23122020-02-19 Alan Modra <amodra@gmail.com>
2313
2314 * coffcode.h (buy_and_read, coff_slurp_line_table),
2315 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
2316 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
2317 corresponding bfd_alloc call. Adjust variables to suit.
2318 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2319 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
2320 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
2321 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
2322 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
2323 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2324 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2325 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2326 * elf64-alpha.c (READ): Likewise.
2327 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
2328 (elf_slurp_symbol_table, elf_slurp_reloc_table),
2329 (bfd_from_remote_memory): Likewise.
2330 * elfcore.h (core_find_build_id): Likewise.
2331 * elfxx-mips.c (READ): Likewise.
2332 * mach-o.c (bfd_mach_o_mangle_sections),
2333 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
2334 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
2335 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
2336 * som.c (setup_sections, som_prep_for_fixups)
2337 (som_build_and_write_symbol_table, som_slurp_symbol_table),
2338 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2339 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
2340 (som_bfd_ar_write_symbol_stuff): Likewise.
2341 * vms-alpha.c (vector_grow1): Likewise.
2342 * vms-lib.c (vms_add_index): Likewise.
2343 * wasm-module.c (wasm_scan_name_function_section): Likewise.
2344 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
2345 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
2346 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
2347 (bfd_alloc2, bfd_zalloc2): Delete.
2348 (_bfd_mul_overflow): Define.
2349 * libbfd.h: Regenerate.
2350
446f7ed5
AM
23512020-02-19 Alan Modra <amodra@gmail.com>
2352
2353 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
2354 bfd_zalloc2.
2355 (assign_section_numbers): Likewise.
2356 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
2357 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
2358 bfd_malloc2, size_t amt, and unsigned tls_count.
2359 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
2360 * elflink.c (elf_create_symbuf): Use bfd_malloc.
2361 (elf_output_implib): Use bfd_alloc.
2362
b03202e3
AM
23632020-02-19 Alan Modra <amodra@gmail.com>
2364
2365 * bfd.c (struct bfd): Move format and direction to other
2366 bitfields. Add "size".
2367 * bfdio.c (bfd_get_size): Cache size when not writing file.
2368 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
2369 returning zero, ie. unknown.
2370 (bfd_get_alt_debug_link_info): Likewise.
2371 * bfd-in2.h: Regenerate.
2372
7c5fa58e
AM
23732020-02-19 Alan Modra <amodra@gmail.com>
2374
2375 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
2376 bfd_get_file_size twice.
2377 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
2378 zero, ie. unknown, return.
2379 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
2380 * elfcode.h (elf_swap_shdr_in): Likewise.
2381 (elf_object_p): Don't call bfd_get_file_size twice and correct
2382 file size check.
2383
96d3b80f
AM
23842020-02-19 Alan Modra <amodra@gmail.com>
2385
2386 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
2387 FALSE if memory alloc fails. Adjust calls.
2388 * som.c (som_prep_for_fixups): Likewise.
2389 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
2390 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
2391 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
2392 * som.c (som_build_and_write_symbol_table): Return via error_return
2393 on seek failure.
2394 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
2395 (VEC_APPEND_EL): Delete.
2396 (vector_grow1): Return pointer to element. Catch overflow.
2397 Return NULL on memory allocation failure.
2398 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
2399 (alpha_vms_add_fixup_ca): Likewise.
2400 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
2401 before using.
2402 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
2403
986f0783
AM
24042020-02-19 Alan Modra <amodra@gmail.com>
2405
2406 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
2407 * aout-target.h (object_p): Likewise.
2408 * aout-tic30.c (tic30_aout_object_p): Likewise.
2409 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
2410 (emit_stringtab, write_syms, link_hash_table_create),
2411 (aout_link_write_other_symbol): Likewise.
2412 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
2413 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
2414 (_bfd_compute_and_write_armap): Likewise.
2415 * archures.c (bfd_arch_list): Likewise.
2416 * bfd.c (bfd_record_phdr): Likewise.
2417 * binary.c (binary_canonicalize_symtab): Likewise.
2418 * cisco-core.c (cisco_core_file_validate): Likewise.
2419 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
2420 (find_arm_glue, record_arm_to_thumb_glue),
2421 (record_thumb_to_arm_glue): Likewise.
2422 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
2423 (ppc_allocate_toc_section): Likewise.
2424 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
2425 * coff-sh.c (sh_relax_section): Likewise.
2426 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
2427 * coffcode.h (handle_COMDAT, coff_new_section_hook),
2428 (coff_set_alignment_hook, coff_mkobject),
2429 (coff_compute_section_file_positions): Likewise.
2430 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
2431 (coff_find_nearest_line_with_names),
2432 ( bfd_coff_set_symbol_class): Likewise.
2433 * cofflink.c (_bfd_coff_link_hash_table_create),
2434 (_bfd_coff_link_input_bfd): Likewise.
2435 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
2436 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
2437 (build_line_info_table, sort_line_sequences),
2438 (line_info_add_include_dir, line_info_add_file_name),
2439 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
2440 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
2441 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
2442 (_bfd_ecoff_find_nearest_line),
2443 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
2444 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
2445 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
2446 * elf-m10300.c (mn10300_elf_relax_section),
2447 (elf32_mn10300_link_hash_table_create): Likewise.
2448 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
2449 * elf.c (make_mapping, copy_elf_program_header): Likewise.
2450 * elf32-arm.c (elf32_arm_link_hash_table_create),
2451 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
2452 (elf32_arm_new_section_hook): Likewise.
2453 * elf32-avr.c (elf_avr_new_section_hook),
2454 (elf32_avr_link_hash_table_create, get_local_syms),
2455 (elf32_avr_setup_section_lists): Likewise.
2456 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
2457 (bfin_link_hash_table_create): Likewise.
2458 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
2459 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
2460 * elf32-csky.c (csky_elf_link_hash_table_create),
2461 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
2462 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
2463 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
2464 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
2465 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2466 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
2467 * elf32-m32r.c (m32r_elf_link_hash_table_create),
2468 (m32r_elf_check_relocs): Likewise.
2469 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
2470 (elf32_m68hc11_setup_section_lists),
2471 (elf32_m68hc11_size_stubs): Likewise.
2472 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
2473 * elf32-metag.c (elf_metag_link_hash_table_create),
2474 (elf_metag_setup_section_lists): Likewise.
2475 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
2476 (microblaze_elf_check_relocs): Likewise.
2477 * elf32-nds32.c (nds32_elf_link_hash_table_create),
2478 (nds32_elf_check_relocs): Likewise.
2479 * elf32-nios2.c (nios2_elf32_setup_section_lists),
2480 (get_local_syms, nios2_elf32_check_relocs),
2481 (nios2_elf32_link_hash_table_create): Likewise.
2482 * elf32-or1k.c (or1k_elf_link_hash_table_create),
2483 (or1k_elf_check_relocs): Likewise.
2484 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
2485 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
2486 * elf32-s390.c (elf_s390_link_hash_table_create),
2487 (elf_s390_check_relocs): Likewise.
2488 * elf32-score.c (score_elf_create_got_section),
2489 (s3_elf32_score_new_section_hook),
2490 (elf32_score_link_hash_table_create): Likewise.
2491 * elf32-score7.c (score_elf_create_got_section),
2492 (s7_elf32_score_new_section_hook): Likewise.
2493 * elf32-sh.c (sh_elf_link_hash_table_create),
2494 (sh_elf_check_relocs): Likewise.
2495 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
2496 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
2497 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
2498 (tilepro_elf_check_relocs): Likewise.
2499 * elf32-v850.c (remember_hi16s_reloc): Likewise.
2500 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
2501 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
2502 (elf_xtensa_new_section_hook): Likewise.
2503 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
2504 (get_got_entry, elf64_alpha_check_relocs): Likewise.
2505 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
2506 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
2507 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
2508 * elf64-ppc.c (ppc64_elf_new_section_hook),
2509 (ppc64_elf_link_hash_table_create, update_local_sym_info),
2510 (update_plt_info, ppc64_elf_check_relocs): Likewise.
2511 * elf64-s390.c (elf_s390_link_hash_table_create),
2512 (elf_s390_check_relocs): Likewise.
2513 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2514 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
2515 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
2516 (elf_link_add_archive_symbols, compute_bucket_count),
2517 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
2518 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
2519 (bfd_elf_final_link): Likewise.
2520 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
2521 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
2522 (elfNN_aarch64_new_section_hook): Likewise.
2523 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
2524 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
2525 (riscv_elf_check_relocs): Likewise.
2526 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
2527 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
2528 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
2529 (_bfd_mips_elf_link_hash_table_create): Likewise.
2530 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
2531 (_bfd_sparc_elf_check_relocs),
2532 (_bfd_sparc_elf_new_section_hook): Likewise.
2533 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
2534 (tilegx_elf_check_relocs): Likewise.
2535 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
2536 * format.c (bfd_check_format_matches): Likewise.
2537 * hash.c (_bfd_stringtab_init): Likewise.
2538 * ihex.c (ihex_scan): Likewise.
2539 * irix-core.c (irix_core_core_file_p): Likewise.
2540 * linker.c (bfd_wrapped_link_hash_lookup),
2541 (_bfd_generic_link_hash_table_create),
2542 (_bfd_generic_reloc_link_order): Likewise.
2543 * lynx-core.c (lynx_core_file_p): Likewise.
2544 * netbsd-core.c (netbsd_core_file_p): Likewise.
2545 * osf-core.c (osf_core_core_file_p): Likewise.
2546 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
2547 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
2548 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
2549 * peicode.h (pe_mkobject): Likewise.
2550 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
2551 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2552 * sco5-core.c (read_uarea): Likewise.
2553 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
2554 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
2555 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
2556 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
2557 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
2558 * srec.c (srec_scan): Likewise.
2559 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
2560 * targets.c (bfd_target_list): Likewise.
2561 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
2562 * trad-core.c (trad_unix_core_file_p): Likewise.
2563 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
2564 (vms_new_section_hook): Likewise.
2565 * wasm-module.c (wasm_make_empty_symbol): Likewise.
2566 * xcofflink.c (xcoff_get_section_contents),
2567 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
2568 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
2569 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
2570
2d0e1217
AM
25712020-02-19 Alan Modra <amodra@gmail.com>
2572
2573 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
2574
99845b3b
L
25752020-02-13 H.J. Lu <hongjiu.lu@intel.com>
2576
2577 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
2578 and use it if it isn't NULL. Remove has_plugin_p argument. Add
2579 a build_list_p argument. Don't search plugin_list. Short circuit
2580 when building the plugin list.
2581 (has_plugin): Renamed to has_plugin_list.
2582 (bfd_plugin_set_plugin): Don't set has_plugin.
2583 (bfd_plugin_specified_p): Check plugin_list instead.
2584 (build_plugin_list): New function.
2585 (load_plugin): Call build_plugin_list and use plugin_list.
2586
22fe7df8
L
25872020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2588
2589 PR binutils/25355
2590 * plugin.c (try_claim): Always clean up for LTO wrapper.
2591 (try_load_plugin): Treat each object as independent. Create a
2592 copy for plugin name.
2593
c675ec1e
NC
25942020-02-11 Nick Clifton <nickc@redhat.com>
2595
2596 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
2597 for addresses in print statements.
2598 (msp430_elf_relax_delete_bytes): Likewise.
2599 (msp430_elf_relax_add_words): Likewise.
2600 (msp430_elf_relax_section): Likewise.
2601
1d07a805
L
26022020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2603
2604 * plugin.c (add_symbols): Clear plugin_data memory.
2605
0aa99dcd
L
26062020-02-10 H.J. Lu <hongjiu.lu@intel.com>
2607
2608 PR binutils/25355
2609 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
2610 (EXECUTABLE_SUFFIX): Likewise.
2611 * config.in: Regenerated.
2612 * configure: Likewise.
2613 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
2614 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
2615 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
2616 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
2617 (get_lto_wrapper): New.
2618 (setup_lto_wrapper_env): Likewise.
2619 (current_plugin): Likewise.
2620 (register_all_symbols_read): Likewise.
2621 (register_cleanup): Likewise.
2622 (get_symbols): Likewise.
2623 (add_input_file): Likewise.
2624 (bfd_plugin_close_and_cleanup): Likewise.
2625 (claim_file): Removed.
2626 (register_claim_file): Set current_plugin->claim_file.
2627 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
2628 lto_syms in current_plugin.
2629 (try_claim): Use current_plugin->claim_file. Call LTO plugin
2630 all_symbols_read handler. Copy real symbols to plugin_data.
2631 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
2632 (try_load_plugin): Don't reuse the previous plugin for LTO
2633 wrapper. Set up GCC LTO wrapper if possible. Don't set
2634 plugin_list_iter->claim_file.
2635 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
2636 possible.
2637 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
2638 real_syms.
2639
ac4280da
JL
26402020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2641
2642 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
2643 check if previous instruction matches a conditional jump inserted
2644 earlier. Invert conditional jump and delete branch in this case.
2645
8d6cb116
JL
26462020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2647
2648 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
2649 msp430_elf_relax_add_words. Support insertion of either one or two
2650 words.
2651 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
2652 needs to be grown. Handle insertion of branch instruction to replace
2653 jump.
2654
d60f5448
JL
26552020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2656
2657 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
2658 debugging relocations.
2659 (msp430_elf_relax_delete_bytes): Likewise.
2660 (msp430_elf_relax_add_two_words): Likewise.
2661 (msp430_elf_relax_section): Likewise.
2662
e1f85e11
AM
26632020-02-10 Alan Modra <amodra@gmail.com>
2664
2665 * archures.c: Wrap overlong z80 comments.
2666 * bfd-in2.h: Regenerate.
2667
9fc0b501
SB
26682020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
2669
2670 PR 25469
2671 * archures.c: Add GBZ80 and Z80N machine values.
2672 * reloc.c: Add BFD_RELOC_Z80_16_BE.
2673 * coff-z80.c: Add support for new reloc.
2674 * coffcode.h: Add support for new machine values.
2675 * cpu-z80.c: Add support for new machine names.
2676 * elf32-z80.c: Add support for new reloc.
2677 * bfd-in2.h: Regenerate.
2678 * libbfd.h: Regenerate.
2679
9984857c
NC
26802020-02-07 Nick Clifton <nickc@redhat.com>
2681
2682 PR 23932
2683 * elf.c (rewrite_elf_program_header): Do not complain if no
2684 sections are mapped to a segment.
2685
5242a0a0
L
26862020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2687
2688 PR ld/25490
2689 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
2690 for garbage collection on __patchable_function_entries section
2691 without linked-to section.
2692
b7d07216
L
26932020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2694
2695 PR gas/25381
2696 * bfd-in2.h: Regenerated.
2697 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
2698 on section if gc_mark of any of its linked-to sections is set
2699 and don't set gc_mark again.
2700 * section.c (asection): Add linked_to_symbol_name to map_head
2701 union.
2702
b93a662b
MR
27032020-02-06 Maciej W. Rozycki <macro@wdc.com>
2704
2705 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
2706 reporting an unrecognized instruction with R_V850_LONGJUMP.
2707
6df4c9c2
AM
27082020-02-05 Alan Modra <amodra@gmail.com>
2709
2710 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
2711
24872cb3
AM
27122020-02-04 Alan Modra <amodra@gmail.com>
2713
2714 * elf32-ppc.c (ppc_elf_relocate_section): After applying
2715 R_PPC_VLE_ADDR20, goto copy_reloc.
2716
ef4627fa
L
27172020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2718
2719 * bfd-in2.h: Regenerated.
2720 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
2721
a8c4d40b
L
27222020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2723
2724 PR gas/25380
2725 * bfd-in2.h: Regenerated.
2726 * ecoff.c (bfd_debug_section): Add section_id.
2727 * section.c (bfd_section): Add section_id.
2728 (SEC_ASSEMBLER_SECTION_ID): New.
2729 (BFD_FAKE_SECTION): Add section_id.
2730
5a9212a1
NC
27312020-02-01 Nick Clifton <nickc@redhat.com>
2732
2733 * config.bfd: Move the c30-aout and tic30-aout targets onto the
2734 obsolete list.
2735
e7cbe0c4
SL
27362020-01-31 Sandra Loosemore <sandra@codesourcery.com>
2737
2738 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
2739 encodings are relative to the GOT on nios2, too.
2740
72ebe8c5
AM
27412020-01-31 Alan Modra <amodra@gmail.com>
2742
2743 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
2744 file. Use $< and $@ in rules.
2745 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
2746 (elf32-ia64.c, elf64-ia64.c): Likewise.
2747 (elf32-riscv.c, elf64-riscv.c): Likewise.
2748 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2749 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
2750 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
2751 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
2752 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2753 * Makefile.in: Regenerate.
2754
327301a4
AM
27552020-01-31 Alan Modra <amodra@gmail.com>
2756
2757 PR 4110
2758 * elf.c (setup_group): Don't clear entire section contents,
2759 just the padding after group flags. Release alloc'd memory
2760 after a seek or read failure.
2761
b5d36aaa
JT
27622020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2763
2764 * peXXigen.c (pe_is_repro): New function.
2765 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
2766 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
2767
1957ab10
JT
27682020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2769
2770 * peXXigen.c (debug_type_names): Add names for new debug data type
2771 values.
2772
87b2920f
JT
27732020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2774
2775 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
2776 inner loop. Fix a memory leak.
2777
72913831
AM
27782020-01-30 Alan Modra <amodra@gmail.com>
2779
2780 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
2781 or obj_coff_keep_strings here.
2782 (coff_get_normalized_symtab): Free external syms directly.
2783 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
2784 on error exit path.
2785
c35d018b
JW
27862020-01-27 Jim Wilson <jimw@sifive.com>
2787
2788 * cpu-riscv.c (riscv_scan): New.
2789 (N): Change bfd_default_scan to riscv_scan.
2790
086b06f3
AS
27912020-01-27 Andreas Schwab <schwab@suse.de>
2792
2793 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
2794 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
2795 * Makefile.in: Regenerate.
2796 * cpu-plugin.c: Remove.
2797 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
2798 (bfd_plugin_arch): Remove declaration.
2799 * bfd-in2.h: Regenerate.
2800 * po/SRC-POTFILES.in: Regenerate.
2801
3024a17a
AM
28022020-01-27 H.J. Lu <hongjiu.lu@intel.com>
2803 Alan Modra <amodra@gmail.com>
2804
2805 PR ld/25458
2806 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
2807
b5f998b2
JW
28082020-01-24 Jim Wilson <jimw@sifive.com>
2809
2810 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
2811 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
2812 avoid over long line.
2813
caa31cfa
NC
28142020-01-24 Nick Clifton <nickc@redhat.com>
2815
2816 PR 25447
2817 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
2818 syms and keep strings flags as these may have been set in order to
2819 prevent a bogus call to free.
2820
24e648d4
NC
28212020-01-23 Nick Clifton <nickc@redhat.com>
2822
2823 * po/fr.po: Updated French translation.
2824
67641dd3
AM
28252020-01-23 Alan Modra <amodra@gmail.com>
2826
2827 PR 25444
2828 * elf.c (assign_file_positions_for_load_sections): Avoid divide
2829 by zero when p_align is zero.
2830
403d1bd9
JW
28312020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
2832
2833 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
2834 (riscv_prefix_cmp): Likewise.
2835 (riscv_non_std_ext_p): Deleted.
2836 (riscv_std_sv_ext_p): Likewise.
2837 (riscv_non_std_sv_ext_p): Likewise.
2838 (riscv_merge_non_std_and_sv_ext): Rename to...
2839 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
2840 (riscv_merge_arch_attr_info): Replace 3 calls to
2841 riscv_merge_non_std_and_sv_ext with single call to
2842 riscv_merge_multi_letter_ext.
2843 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
2844 encounter a 'z' prefix.
2845 (riscv_get_prefix_class): New function, return prefix class based
2846 on first few characters of input string.
2847 (riscv_parse_config): New structure to factor out minor differences
2848 in extension class parsing behaviour.
2849 (riscv_parse_sv_or_non_std_ext): Rename to...
2850 (riscv_parse_prefixed_ext): and parameterise with
2851 riscv_parse_config.
2852 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
2853 (riscv_multi_letter_ext_valid_p): New.
2854 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
2855 (riscv_parse_subset): Delegate all non-single-letter parsing work
2856 to riscv_parse_prefixed_ext.
2857 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
2858 (riscv_get_prefix_class): Declare.
2859
a804e476
AM
28602020-01-22 Alan Modra <amodra@gmail.com>
2861
2862 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
2863 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
2864 __tls_get_addr_desc.
2865 (ppc64_elf_size_stubs): Add section for linker generated
2866 __tls_get_addr_desc wrapper function. Loop at least once if
2867 generating this function.
2868 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
2869 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
2870
9e7028aa
AM
28712020-01-22 Alan Modra <amodra@gmail.com>
2872
2873 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
2874 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
2875 tga_desc_fd.
2876 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
2877 (STDU_R1_0R1, ADDI_R1_R1): Define.
2878 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
2879 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
2880 tga_desc_fd to opt_fd, and tga_desc to opt. Set
2881 no_tls_get_addr_regsave.
2882 (branch_reloc_hash_match): Add hash3 and hash4.
2883 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
2884 (ppc64_elf_size_dynamic_sections): Likewise.
2885 (ppc64_elf_relocate_section): Likewise.
2886 (plt_stub_size, build_plt_stub): Likewise. Size regsave
2887 __tls_get_addr stub.
2888 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
2889 eh_frame.
2890 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
2891 eh_frame for regsave __tls_get_addr.
2892
abc489c6
AM
28932020-01-22 Alan Modra <amodra@gmail.com>
2894
2895 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
2896 which __tls_get_addr calls will be eliminated.
2897
26916852
NC
28982020-01-20 Nick Clifton <nickc@redhat.com>
2899
2900 * po/pt.po: Updates Portuguese translation.
2901 * po/ru.po: Updated Russian translation.
2902 * po/uk.po: Updated Ukranian translation.
2903
14470f07
L
29042020-01-20 H.J. Lu <hongjiu.lu@intel.com>
2905
2906 PR ld/25416
2907 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
2908 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
2909 X32 mode.
2910 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
2911 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
2912 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
2913 "rex leal x@tlsdesc(%rip), %reg" to
2914 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
2915 "call *(%eax)" to "nopl (%rax)".
2916
b9ca1af6
AM
29172020-01-20 Alan Modra <amodra@gmail.com>
2918
2919 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
2920 (MTLR_R11): Don't define.
2921 (LD_R0_0R3, CMPDI_R0_0): Define.
2922 (build_tls_get_addr_stub): Don't use r11 in stub.
2923
ed7007c1
AM
29242020-01-20 Alan Modra <amodra@gmail.com>
2925
2926 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
2927 (defined_sym_val, is_tls_get_addr): Likewise.
2928
1b1bb2c6
NC
29292020-01-18 Nick Clifton <nickc@redhat.com>
2930
2931 * version.m4 (BFD_VERSION): Set to 2.34.50.
2932 * configure: Regenerate.
2933 * po/bfd.pot: Regenerate.
2934
ae774686
NC
29352020-01-18 Nick Clifton <nickc@redhat.com>
2936
2937 Binutils 2.34 branch created.
2938
07f1f3aa
CB
29392020-01-17 Christian Biesinger <cbiesinger@google.com>
2940
2941 * coff-arm.c: Fix spelling error (seperate).
2942 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
2943 error (seperate).
2944 * sysdep.h (strnlen): Fix spelling error (seperate).
2945
0d1cc75d
LB
29462020-01-15 Lars Brinkhoff <lars@nocrew.org>
2947
2948 PR 20694
2949 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
2950
e1c6cf61
AM
29512020-01-15 Alan Modra <amodra@gmail.com>
2952
2953 PR 25384
2954 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
2955 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
2956 of function symbols unless dot symbols are present. Do warn
2957 whenever one is created, regardles of whether a PLT entry is
2958 also emitted for the function symbol.
2959
ef4e5ba5
AM
29602020-01-14 Alan Modra <amodra@gmail.com>
2961
2962 * som.c (som_bfd_count_ar_symbols): Error when file position
2963 of symbols on chains is not strictly increasing.
2964
8ab484c2
AM
29652020-01-14 Alan Modra <amodra@gmail.com>
2966
2967 * vms.h (VMS_DEBUG): Define as 0.
2968 * vms-alpha.c (image_write): Move debug output after bounds check.
2969 Tidy bounds check.
2970 (_bfd_vms_slurp_eihd): Warning fix.
2971 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
2972
b50ef514
AM
29732020-01-13 Alan Modra <amodra@gmail.com>
2974
2975 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
2976 for "ignored" records.
2977
0c0adcc5
AM
29782020-01-13 Alan Modra <amodra@gmail.com>
2979
2980 * wasm-module.c (wasm_scan_name_function_section): Formatting.
2981 Delete asect name check. Move asect NULL check to wasm_object_p.
2982 Correct bounds check of sizes against end. Replace uses of
2983 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
2984 just one bfd_release.
2985 (wasm_scan): Don't use malloc/strdup for section names,
2986 bfd_alloc instead. Simplify code prefixing section name.
2987 Formatting. Don't attempt to free memory here..
2988 (wasm_object_p): ..do so here.
2989
7f026732
SN
29902020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
2991
2992 PR ld/22269
2993 * elf32-arm.c (elf32_arm_final_link_relocate): Use
2994 UNDEFWEAK_NO_DYNAMIC_RELOC.
2995 (allocate_dynrelocs_for_symbol): Likewise.
2996
8cd0e5e9
TC
29972020-01-10 Tamar Christina <tamar.christina@arm.com>
2998
2999 PR 25210
3000 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
3001
71780f45
AM
30022020-01-10 Alan Modra <amodra@gmail.com>
3003
3004 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
3005
b899eb3b
NC
30062020-01-09 Nick Clifton <nickc@redhat.com>
3007
3008 PR 25221
3009 * bfd.c (bfd_convert_section_contents): Check for a compress
3010 header size that is larger than the actual section size.
3011
4c6ee646
AM
30122020-01-08 Alan Modra <amodra@gmail.com>
3013
3014 PR 25351
3015 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
3016 after removing sections.
3017
85f78364
JW
30182020-01-06 Jim Wilson <jimw@sifive.com>
3019
3020 PR 25205
3021 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
3022 check for !bfd_link_pic (info).
3023 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
3024 <R_RISCV_JAL>: Add comment.
3025 (_bfd_riscv_relax_section): For plt.offset check, add check for
3026 bfd_link_pic (info). Add comment.
3027
49078ece
AM
30282020-01-06 Alan Modra <amodra@gmail.com>
3029
3030 * format.c (bfd_check_format_matches): Ignore bfd_error on target
3031 match failures. Don't init to bfd_error_wrong_format before
3032 calling _bfd_check_format.
3033
ab356be7
AM
30342020-01-06 Alan Modra <amodra@gmail.com>
3035
3036 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
3037 status rather than exiting on stack overflow or underflow.
3038 (_bfd_vms_slurp_etir): Adjust to suit.
3039
85d86817
AM
30402020-01-06 Alan Modra <amodra@gmail.com>
3041
3042 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
3043
3e6aa775
AM
30442020-01-06 Alan Modra <amodra@gmail.com>
3045
3046 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
3047 command. Check name offset is within command.
3048 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
3049 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
3050 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
3051 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
3052 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
3053 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
3054 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
3055 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
3056 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
3057 (bfd_mach_o_read_segment): Similarly.
3058 (bfd_mach_o_read_thread): Properly bound check thread struct.
3059 Don't repeat checks on second loop.
3060 (bfd_mach_o_read_command): Fail on invalid command length.
3061
ea933f17
AM
30622020-01-04 Alan Modra <amodra@gmail.com>
3063
3064 * format.c (bfd_check_format_matches): Add preserve_match.
3065 Save initial bfd state in "preserve", matched bfd state in
3066 "preserve_match". Save just the first match. Release
3067 bfd_alloc memory. Restore and finish preserved state as
3068 appropriate on all function exit paths.
3069
f24bdec4
AM
30702020-01-04 Alan Modra <amodra@gmail.com>
3071
3072 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
3073
991fb595
AM
30742020-01-04 Alan Modra <amodra@gmail.com>
3075
3076 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
3077 match too.
3078
f2a3559d
NC
30792020-01-03 Nick Clifton <nickc@redhat.com>
3080
3081 PR 25307
3082 (bfd_pef_parse_function_stubs): Correct the test that ensures that
3083 there is enough data remaining in the code buffer before
3084 attempting to read a function stub.
3085
7a0fb7be
NC
30862020-01-03 Nick Clifton <nickc@redhat.com>
3087
3088 PR 25308
3089 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
3090 return value from bfd_malloc.
3091 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
3092 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
3093 (elf32_arm_filter_cmse_symbols): Likewise.
3094 (elf32_arm_write_section): Likewise.
3095 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
3096 (bfd_mach_o_follow_dsym): Likewise.
3097 * pef.c (bfd_pef_print_loader_section): Likewise.
3098 (bfd_pef_scan_start_address): Likewise.
3099 (bfd_pef_parse_function_stubs): Likewise.
3100 (bfd_pef_parse_symbols): Likewise.
3101
b26a3d58
ST
31022020-01-03 Sergei Trofimovich <siarheit@google.com>
3103
3104 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
3105 on binary inputs ld/PR25316.
3106 (is_ia64_elf): new helper to filter on ia64 objects.
3107
4bb7a87e
JB
31082020-01-03 Jan Beulich <jbeulich@suse.com>
3109
3110 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
3111 in parameter names.
3112 (bfd_mach_o_scan): Insert underscore in two variable names.
3113
6655dba2
SB
31142020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
3115
3116 * Makefile.am: Add z80-elf target support.
3117 * configure.ac: Likewise.
3118 * targets.c: Likewise.
3119 * Makefile.in: Regenerate.
3120 * configure: Regenerate.
3121 * config.bfd: Add z80-elf target support and new arches: ez80 and
3122 z180.
3123 * elf32-z80.c: New file.
3124 * archures.c: Add new z80 architectures: eZ80 and Z180.
3125 * coffcode.h: Likewise.
3126 * cpu-z80.c: Likewise.
3127 * coff-z80.c: Add new relocations for Z80 target and local label
3128 check.
3129 * reloc.c: Add new relocs.
3130 * bfd-in2.h: Regenerate.
3131 * libbfd.h: Regenerate.
3132
0db131fb
TC
31332020-01-02 Tamar Christina <tamar.christina@arm.com>
3134
3135 PR 25210
3136 PR 24753
3137 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
3138
b14ce8bf
AM
31392020-01-01 Alan Modra <amodra@gmail.com>
3140
3141 Update year range in copyright notice of all files.
3142
0b114740 3143For older changes see ChangeLog-2019
3499769a 3144\f
0b114740 3145Copyright (C) 2020 Free Software Foundation, Inc.
3499769a
AM
3146
3147Copying and distribution of this file, with or without modification,
3148are permitted in any medium without royalty provided the copyright
3149notice and this notice are preserved.
3150
3151Local Variables:
3152mode: change-log
3153left-margin: 8
3154fill-column: 74
3155version-control: never
3156End:
This page took 0.430956 seconds and 4 git commands to generate.