ARM cmse_scan segfault
[deliverable/binutils-gdb.git] / bfd / ChangeLog
1 2019-11-21 Alan Modra <amodra@gmail.com>
2
3 * elf32-arm.c (elf32_arm_size_stubs): Exclude dynamic library
4 BFDs that have not been loaded.
5
6 2019-11-19 Alan Modra <amodra@gmail.com>
7
8 PR 25197
9 * coffgen.c (coff_find_nearest_line_with_names): Check that C_FILE
10 u.syment.n_value does point at another C_FILE sym and not into
11 some auxent that happens to look like a C_FILE. Properly check
12 for integer overflow and avoid possible pointer wrap-around.
13 Simplify pr17512 checks.
14
15 2019-11-19 Alan Modra <amodra@gmail.com>
16
17 PR 25200
18 * reloc.c (bfd_default_reloc_type_lookup): Don't BFD_FAIL.
19 * elf.c (_bfd_elf_validate_reloc): Don't segfault on NULL howto.
20
21 2019-11-18 Alan Modra <amodra@gmail.com>
22
23 * elf-bfd.h (struct elf_backend_data <elf_backend_init_file_header>):
24 Rename from elf_backend_post_process_headers.
25 (_bfd_elf_post_process_headers): Delete.
26 (_bfd_elf_init_file_header): Declare.
27 * elf.c (_bfd_elf_compute_section_file_positions): Call new function
28 in place of prep_headers and elf_backend_post_process_headers.
29 (_bfd_elf_init_file_header): Renamed from prep_headers with
30 updated args and made global. Delete dead code.
31 (_bfd_elf_post_process_headers): Delete.
32 * elf32-arm.c (elf32_arm_init_file_header): Rename from
33 elf32_arm_post_process_headers and call _bfd_elf_init_file_header.
34 Return status.
35 (elf_backend_init_file_header): Define.
36 (elf_backend_post_process_headers): Don't define.
37 * elf32-i386.c (elf_i386_fbsd_init_file_header): Similarly.
38 * elf32-m68hc1x.c (elf32_m68hc11_init_file_header): Similarly.
39 * elf32-metag.c (elf_metag_init_file_header): Similarly.
40 * elf32-spu.c (spu_elf_init_file_header
41 * elf32-visium.c (visium_elf_init_file_header
42 * elf64-alpha.c (elf64_alpha_fbsd_init_file_header
43 * elf64-hppa.c (elf64_hppa_init_file_header
44 * elf64-ia64-vms.c (elf64_vms_init_file_header
45 * elfnn-aarch64.c (elfNN_aarch64_init_file_header
46 * elfnn-ia64.c (elfNN_hpux_init_file_header
47 * elfxx-mips.c (_bfd_mips_init_file_header
48 * elfxx-mips.h (_bfd_mips_post_process_headers): Delete.
49 (_bfd_mips_init_file_header): Declare.
50 (elf_backend_post_process_headers): Delete.
51 (elf_backend_init_file_header): Define.
52 * elfxx-target.h (elf_backend_post_process_headers): Delete.
53 (elf_backend_init_file_header): Define and use.
54 * elf32-m68hc12.c (elf_backend_init_file_header): Define.
55 (elf_backend_post_process_headers): Don't define.
56 * elf32-m68hc1x.h (elf32_m68hc11_post_process_headers): Delete.
57 (elf32_m68hc11_init_file_header): Declare.
58 * elf32-ppc.c (elf_backend_post_process_headers): Remove
59 unnecessary undef.
60
61 2019-11-18 Alan Modra <amodra@gmail.com>
62
63 * elf-bfd.h (struct elf_backend_data <elf_backend_modify_headers>):
64 Rename from elf_backend_modify_program_headers.
65 (_bfd_elf_modify_headers): Declare.
66 * elf.c (assign_file_positions_except_relocs): Set
67 elf_program_header_size. Always call elf_backend_modify_headers.
68 Extract code modifying file header..
69 (_bfd_elf_modify_headers): ..to here. New function.
70 * elf32-arm.c (elf_backend_modify_headers): Renamed from
71 elf_backend_modify_program_headers.
72 * elf32-i386.c: Similarly.
73 * elf64-x86-64.c: Similarly.
74 * elfxx-target.h: Similarly. Default elf_backend_modify_headers
75 to _bfd_elf_modify_headers.
76 * elf-nacl.h (nacl_modify_headers): Rename from
77 nacl_modify_program_headers.
78 * elf-nacl.c (nacl_modify_headers): Rename from
79 nacl_modify_program_headers and call _bfd_elf_modify_headers.
80 * elf32-rx.c (elf32_rx_modify_headers): Similarly.
81 * elf32-spu.c (spu_elf_modify_headers): Similarly.
82 * elfnn-ia64.c (elfNN_ia64_modify_headers): Similarly.
83 * elf32-sh.c (elf_backend_modify_program_headers): Don't undef.
84
85 2019-11-18 Alan Modra <amodra@gmail.com>
86
87 PR 25196
88 * bfd.c (bfd_error_type): Add bfd_error_sorry.
89 (bfd_errmsgs): Likewise.
90 * elf.c (rewrite_elf_program_header): Don't abort on confused
91 lma/alignment. Replace bfd_error_bad_value with bfd_error_sorry.
92 (_bfd_elf_validate_reloc): Use bfd_error_sorry.
93 (_bfd_elf_final_write_processing): Likewise.
94 * bfd-in2.h: Regenerate.
95
96 2019-11-12 Jim Wilson <jimw@sifive.com>
97
98 PR 25181
99 * elfnn-riscv.c (_bfd_riscv_relax_call): Always add max_alignment to
100 foff. If sym_sec->output_section and sec->output_section are the same
101 and not *ABS* then set max_alignment to that section's alignment.
102
103 2019-11-07 Alan Modra <amodra@gmail.com>
104
105 * cpu-cr16c.c: Delete.
106 * elf32-cr16c.c: Delete.
107 * Makefile.am,
108 * archures.c,
109 * config.bfd,
110 * configure.ac,
111 * reloc.c,
112 * targets.c: Remove cr16c support.
113 * Makefile.in,
114 * bfd-in2.h,
115 * configure,
116 * libbfd.h,
117 * po/SRC-POTFILES.in: Regenerate.
118
119 2019-11-05 Tim Rühsen <tim.ruehsen@gmx.de>
120
121 * doc/chew.c (add_to_definition): Use correct type when
122 calculating size of array reallocation.
123 (nextword): Always initialise the word return parameter.
124 (compile): Check return value of nextword().
125
126 2019-10-30 Keith Seitz <keiths@redhat.com>
127
128 * elf-bfd.h (elf_backend_data) <elf_backend_core_find_build_id>:
129 New field.
130 (_bfd_elf32_core_find_build_id, _bfd_elf64_core_find_build_id):
131 New functions.
132 (elf_read_notes): Add declaration.
133 * elf.c (elf_read_notes): Move elf-bfd.h.
134 (_bfd_elf_core_find_build_id): New function.
135 (bfd_section_from_phdr): Scan core file PT_LOAD segments for
136 build-id if none is known.
137 (elf_parse_notes): For core files, scan for notes.
138 * elfcore.h (elf_core_file_matches_executable_p): If both
139 BFDs have identical build-ids, then they match.
140 (_bfd_elf_core_find_build_id): New function.
141 * elfxx-target.h (elf_backend_core_find_build_id): Define.
142 (elfNN_bed): Add elf_backend_core_find_build_id.
143
144 2019-10-29 Andrew Eikum <aeikum@codeweavers.com>
145
146 * libcoff-in.h (struct pe_tdata): Add dos_message field.
147 * libcoff.h: Regenerate.
148 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Copy the
149 dos_message field rather than initialising it.
150 (_bfd_XX_bfd_copy_private_bfd_data_common): Copy the dos_message
151 field.
152 * peicode.h (pe_mkobject): Initialise the dos_message field.
153 (pe_mkobject_hook): Copy the dos_message field.
154 (pe_bfd_object_p): Copy the dos_message field.
155
156 2019-10-25 Alan Modra <amodra@gmail.com>
157
158 PR 4499
159 * elf-nacl.c (nacl_modify_segment_map): Set no_sort_lma for all
160 PT_LOAD segments.
161 * elf32-spu.c (spu_elf_modify_segment_map): Likewise on overlay
162 PT_LOAD segments.
163 * elf.c (elf_sort_segments): New function.
164 (assign_file_positions_except_relocs): Use shortcuts to elfheader
165 and elf_tdata. Seek to e_phoff not sizeof_ehdr to write program
166 headers. Move PT_PHDR check..
167 (assign_file_positions_for_non_load_sections): ..and code setting
168 PT_PHDR p_vaddr and p_paddr, and code setting __ehdr_start value..
169 (assign_file_positions_for_load_sections): ..to here. Sort
170 PT_LOAD headers. Delete header_pad code. Use actual number of
171 headers rather than allocated in calculating size for program
172 headers. Don't assume program headers follow ELF file header.
173 Simplify pt_load_count code. Only set "off" for PT_LOAD or
174 PT_NOTE in cores.
175 (rewrite_elf_program_header): Set p_vaddr_offset for segments
176 that include file and program headers.
177 (copy_elf_program_header): Likewise, replacing header_size code.
178
179 2019-10-21 Alan Modra <amodra@gmail.com>
180
181 PR 452
182 * archive.c (normalize): Return file unchanged when
183 BFD_ARCHIVE_FULL_PATH.
184 (_bfd_construct_extended_name_table): Pass abfd, the output
185 bfd, to normalize.
186 (_bfd_archive_bsd44_construct_extended_name_table): Likewise.
187 * bfd.c (struct bfd): Make flags a full flagword.
188 (BFD_ARCHIVE_FULL_PATH): Define.
189 * bfd-in2.h: Regenerate.
190
191 2019-10-20 John David Anglin <danglin@gcc.gnu.org>
192
193 * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Provide 8-byte
194 minimum alignment for .plt section.
195
196 2019-10-19 John David Anglin <danglin@gcc.gnu.org>
197
198 * elf32-hppa.c: Revise import stub sequences.
199 (LONG_BRANCH_STUB_SIZE): Define.
200 (LONG_BRANCH_SHARED_STUB_SIZE): Define.
201 (IMPORT_STUB_SIZE): Define.
202 (IMPORT_SHARED_STUB_SIZE): Define.
203 (EXPORT_STUB_SIZE): Define.
204 (plt_stub): Revise to not use register %r22.
205 (LDO_R1_R22): Define.
206 (LDW_R22_R21): Define.
207 (LDW_R22_R19): Define.
208 (hppa_build_one_stub): Update stub generation and use new defines.
209 (hppa_size_one_stub): Likewise.
210
211 2019-10-17 Nelson Chu <nelson.chu@sifive.com>
212
213 * elfnn-riscv.c (riscv_elf_relocate_section): Report the error message
214 that user should recompile their code with `fPIC` when linking non-pic
215 code into shared library.
216
217 * elfnn-riscv.c (riscv_elf_relocate_section): Use asprintf to extend
218 the error message if needed, and then store the result into the
219 `msg_buf`. Finally, remember to free the unused `msg_buf`. All error
220 message for the dangerous relocation should be set before we call the
221 callback function. If we miss the error message since linker runs out
222 of memory, we should set the default error message for the error.
223
224 2019-10-16 Alan Modra <amodra@gmail.com>
225
226 PR 13616
227 * cpu-powerpc.c (bfd_arch_ppc_nop_fill): New function, use it
228 for all ppc arch info.
229 * linker.c (default_data_link_order): Pass info->big_endian to
230 arch_info->fill function.
231
232 2019-10-15 Alan Modra <amodra@gmail.com>
233
234 * elf32-m68hc1x.c (reloc_warning): Add printf attribute.
235 (elf32_m68hc11_relocate_section): Don't use a variable for format
236 strings. Delete some unnecessary xgettext:c-format comments.
237
238 2019-10-15 Alan Modra <amodra@gmail.com>
239
240 PR 24955
241 * elf32-arm.c (set_cmse_veneer_addr_from_implib): Use bfd_malloc
242 rather than xmalloc.
243 * elf32-m68hc1x.c (reloc_warning): New function.
244 (elf32_m68hc11_relocate_section): Use it here. Cast bfd_vma values
245 corresponding to %lx in format strings.
246 * elf32-nds32.c (nds32_insertion_sort): Use a stack temporary.
247
248 2019-10-15 Alan Modra <amodra@gmail.com>
249
250 PR 25100
251 * elf64-ppc.c (sfpr_define): Delete dead code that triggered a warning.
252
253 2019-10-15 Alan Modra <amodra@gmail.com>
254
255 * bfd.c (bfd_check_compression_header): Check for powers of two
256 with x == (x & -x).
257
258 2019-10-14 Alan Modra <amodra@gmail.com>
259
260 * syms.c (struct indexentry): Add idx field.
261 (cmpindexentry): Final sort on idx.
262 (_bfd_stab_section_find_nearest_line): Set idx.
263
264 2019-10-14 Alan Modra <amodra@gmail.com>
265
266 * dwarf2.c (struct lookup_funcinfo): Add idx field.
267 (compare_lookup_funcinfos): Perform final sort on idx.
268 (build_lookup_funcinfo_table): Set idx.
269 (compare_sequences): Perform final sort on num_lines.
270 (build_line_info_table): Set num_lines and line_info_lookup earlier.
271 (sort_line_sequences): Set num_lines for sort.
272
273 2019-10-14 Alan Modra <amodra@gmail.com>
274
275 * elflink.c (elf_sort_symbol): Sort on type and name as well.
276 (elf_link_add_object_symbols): Style fix.
277
278 2019-10-14 Alan Modra <amodra@gmail.com>
279
280 * elf.c (_bfd_elf_map_sections_to_segments): Init target_index
281 for sections about to be sorted.
282 (assign_file_positions_for_load_sections): Likewise.
283 (elf_sort_sections): Don't bother optimising both TOEND case.
284 * elflink.c (bfd_elf_final_link): Reset target_index.
285
286 2019-10-14 Alan Modra <amodra@gmail.com>
287
288 * elflink.c (elf_get_linked_section_vma): Delete.
289 (compare_link_order): Use elf_linked_to_section and sort by lma,
290 size, and id.
291 (elf_fixup_link_order): Use size_t variables where appropriate.
292 Make use of elf_linked_to_section. Formatting. Properly align
293 sections.
294
295 2019-10-14 Alan Modra <amodra@gmail.com>
296
297 * elf-strtab.c (strrevcmp): Comment.
298 * merge.c (strrevcmp): Likewise.
299 * elf64-ppc.c (compare_symbols): Correct final pointer comparison.
300 Comment on why comparing pointers ensures a stable sort.
301 * elflink.c (struct elf_symbol): Add void* to union.
302 (elf_sort_elf_symbol): Ensure a stable sort with pointer comparison.
303 (elf_sym_name_compare): Likewise.
304 (bfd_elf_match_symbols_in_sections): Style fix.
305 (elf_link_sort_cmp1): Comment.
306
307 2019-10-14 Alan Modra <amodra@gmail.com>
308
309 PR 24955
310 * elflink.c (elf_output_implib): Don't use xmalloc. Don't ignore
311 return value of bfd_alloc2.
312 * peXXigen.c (_bfd_XXi_write_codeview_record): Don't use xmalloc.
313 * pef.c (bfd_pef_print_symbol): Likewise. Don't ignore return
314 value of bfd_get_section_contents.
315 * som.c (som_write_space_strings): Don't use xmalloc.
316 (som_write_symbol_strings): Likewise.
317
318 2019-10-11 Max Filippov <jcmvbkbc@gmail.com>
319
320 * dwarf2.c (stash_maybe_enable_info_hash_tables): Only set
321 stash->info_hash_status = STASH_INFO_HASH_ON when
322 stash_maybe_update_info_hash_tables succeeds.
323
324 2019-10-09 Alan Modra <amodra@gmail.com>
325
326 PR 25070
327 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Catch overflow of
328 total_size calculation.
329
330 2019-10-08 Alan Modra <amodra@gmail.com>
331
332 PR 25078
333 * dwarf2.c (find_abstract_instance): Delete orig_info_ptr, add
334 recur_count. Error on recur_count reaching 100 rather than
335 info_ptr matching orig_info_ptr. Adjust calls.
336
337 2019-10-07 Jozef Lawrynowicz <jozef.l@mittosystems.com>
338
339 * elf32-msp430.c (elf32_msp430_merge_mspabi_attributes): Rename to..
340 (elf32_msp430_merge_msp430_attributes): Add support for merging
341 the GNU object attribute for data region.
342
343 2019-10-07 Alan Modra <amodra@gmail.com>
344
345 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Do allocate
346 space for local got non-tls relocs when PIE.
347
348 2019-10-07 Alan Modra <amodra@gmail.com>
349
350 * elflink.c (elf_fixup_link_order): Don't attempt to find
351 an elf_section for linker created bfd sections.
352
353 2019-10-07 Alan Modra <amodra@gmail.com>
354
355 * elf32-ppc.c (ppc_elf_tls_optimize): Don't process R_PPC_TLSLD
356 with non-local symbol. Don't double count __tls_get_addr calls
357 with marker relocs.
358 * elf64-ppc.c (ppc64_elf_tls_optimize): Likewise.
359
360 2019-10-07 Alan Modra <amodra@gmail.com>
361
362 * elf32-ppc.c (nomark_tls_get_addr): Rename from has_tls_get_addr_call
363 throughout.
364 * elf64-ppc.c (nomark_tls_get_addr): Likewise.
365
366 2019-10-04 Alan Modra <amodra@gmail.com>
367
368 * elf64-ppc.c (ppc64_elf_check_relocs): Move initialisation of vars.
369 (ppc64_elf_tls_optimize): Correct is_local condition.
370 (allocate_got): Don't reserve dynamic relocations for any of the
371 tls got relocs in PIEs when the symbol is local.
372 (allocate_dynrelocs): Correct validity test for local sym using
373 tlsld_got slot.
374 (ppc64_elf_size_dynamic_sections): Don't reserve dynamic relocations
375 for any of the tls got relocs in PIEs.
376 (ppc64_elf_layout_multitoc): Likewise.
377 (ppc64_elf_relocate_section): Correct validity test for local sym
378 using tlsld_got slot. Don't emit dynamic relocations for any of
379 the tls got relocs in PIEs when the symbol is local.
380 * elf32-ppc.c (ppc_elf_tls_optimize): Correct is_local condition.
381 (got_relocs_needed): Delete.
382 (allocate_dynrelocs): Correct validity test for local sym using
383 tlsld_got slot. Don't reserve dynamic relocations for any of the
384 tls got relocs in PIEs when the symbol is local.
385 (ppc_elf_size_dynamic_sections): Don't reserve dynamic relocations
386 for any of the tls got relocs in PIEs.
387 (ppc_elf_relocate_section): Correct validity test for local sym
388 using tlsld_got slot. Don't emit dynamic relocations for any of
389 the tls got relocs in PIEs when the symbol is local.
390
391 2019-10-04 Szabolcs Nagy <szabolcs.nagy@arm.com>
392
393 PR ld/22263
394 PR ld/25056
395 * elf32-arm.c (elf32_arm_tls_transition): Use bfd_link_dll instead of
396 bfd_link_pic for TLS checks.
397 (elf32_arm_final_link_relocate): Likewise.
398 (allocate_dynrelocs_for_symbol): Likewise.
399
400 2019-10-04 Szabolcs Nagy <szabolcs.nagy@arm.com>
401
402 PR ld/25062
403 * elf32-arm.c (elf32_arm_final_link_relocate): Sign extend data.
404
405 2019-09-30 Nick Alcock <nick.alcock@oracle.com>
406
407 * elf-bfd.h (bfd_section_is_ctf): New inline function.
408 * elf.c (special_sections_c): Add ".ctf".
409 (assign_file_positions_for_non_load_sections): Note that
410 compressed debugging sections etc are not assigned here. Treat
411 CTF sections like SEC_ELF_COMPRESS sections when is_linker_output:
412 sh_offset -1.
413 (assign_file_positions_except_relocs): Likewise.
414 (find_section_in_list): Note that debugging and CTF sections, as
415 well as reloc sections, are assigned later.
416 (_bfd_elf_assign_file_positions_for_non_load): CTF sections get
417 their size and contents updated.
418 (_bfd_elf_set_section_contents): Skip CTF sections: unlike
419 compressed sections, they have no uncompressed content to copy at
420 this stage.
421 * elflink.c (elf_link_swap_symbols_out): Call the examine_strtab
422 callback right before the strtab is written out.
423 (bfd_elf_final_link): Don't cache the section contents of CTF
424 sections: they are not populated yet. Call the emit_ctf callback
425 right at the end, after all the symbols and strings are flushed
426 out.
427
428 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
429
430 * elf-strtab.c (_bfd_elf_strtab_len): New.
431 (_bfd_elf_strtab_str): Likewise.
432 * bfd-elf.h: Declare them.
433
434 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
435
436 * elf-bfd.h (bfd_elf_get_str_section): Add.
437 * elf.c (bfd_elf_get_str_section): No longer static.
438
439 2019-09-26 Alan Modra <amodra@gmail.com>
440
441 PR 24262
442 * Makefile.am (AM_CPPFLAGS): Add -DLIBDIR.
443 * plugin.c (load_plugin): Search both ${libdir}/bfd-plugins and
444 ${bindir}/../lib/bfd-plugins if different.
445 * Makefile.in: Regenerate.
446
447 2019-09-23 Alan Modra <amodra@gmail.com>
448
449 * elf64-ppc.c (ppc64_elf_check_relocs): Use bfd_link_executable
450 in choosing between different actions for shared library and
451 non-shared library cases. Delete ELIMINATE_COPY_RELOCS test.
452 (dec_dynrel_count): Likewise. Account for ifunc special case.
453 (ppc64_elf_adjust_dynamic_symbol): Copy relocs are for executables,
454 not non-pic.
455 (allocate_dynrelocs): Comment fixes. Delete ELIMINATE_COPY_RELOCS
456 test.
457
458 2019-09-23 Alan Modra <amodra@gmail.com>
459
460 * Makefile.am (SOURCE_HFILES): Add many missing .h files.
461 * Makefile.in: Regenerate.
462 * po/SRC-POTFILES.in: Regenerate.
463
464 2019-09-23 Alan Modra <amodra@gmail.com>
465
466 * bfd-in.h (bfd_symbol, bfd_section_already_linked),
467 (bfd_elf_version_tree): Delete forward declarations.
468 Move other forward decls and remaining elf function decl later.
469 (bfd_section_already_linked_table_init),
470 (bfd_section_already_linked_table_free),
471 (_bfd_handle_already_linked, _bfd_nearby_section),
472 (_bfd_fix_excluded_sec_syms): Move to bfdlink.h.
473
474 2019-09-23 Alan Modra <amodra@gmail.com>
475
476 * bfd-in.h: Move ecoff function declarations..
477 * ecoff-bfd.h: ..to here, new file.
478 * ecoff.c: Include ecoff-bfd.h.
479 * ecofflink.c: Likewise.
480 * elf64-alpha.c: Likewise.
481 * elfxx-mips.c: Likewise.
482 * bfd-in2.h: Regenerate.
483
484 2019-09-23 Alan Modra <amodra@gmail.com>
485
486 * bfd-in.h (enum notice_asneeded_action): Move to bfdlink.h.
487 Move most other elf declarations..
488 * elf-bfd.h: ..to here.
489 * bfd-in2.h: Regenerate.
490
491 2019-09-23 Alan Modra <amodra@gmail.com>
492
493 * bfd-in.h: Move m68k function declaration..
494 * cpu-m68k.h: ..to here, new file..
495 * elf32-m68k.h: ..and here, new file.
496 * elf32-m68k.c: Include cpu-m68k.h and elf32-m68k.h.
497 * bfd-in2.h: Regenerate.
498
499 2019-09-23 Alan Modra <amodra@gmail.com>
500
501 * bfd-in.h: Move bfin function declaration..
502 * elf32-bfin.h: ..to here, new file.
503 * elf32-bfin.c: Include elf32-bfin.h.
504 * bfd-in2.h: Regenerate.
505
506 2019-09-23 Alan Modra <amodra@gmail.com>
507
508 * bfd-in.h: Move cr16 function declaration..
509 * elf32-cr16.h: ..to here, new file.
510 * elf32-cr16.c: Include elf32-cr16.h.
511 * bfd-in2.h: Regenerate.
512
513 2019-09-23 Alan Modra <amodra@gmail.com>
514
515 * bfd-in.h (bfd_sunos_get_needed_list),
516 (bfd_sunos_record_link_assignment),
517 (bfd_sunos_size_dynamic_sections),
518 (bfd_i386linux_size_dynamic_sections),
519 (bfd_sparclinux_size_dynamic_sections): Delete obsolete decls.
520 * bfd-in2.h: Regenerate.
521
522 2019-09-23 Alan Modra <amodra@gmail.com>
523
524 * bfd-in.h: Move xcoff function declarations..
525 * xcofflink.h: ..to here, new file.
526 * xcofflink.c: Include xcofflink.h.
527 * coff-rs6000.c (bfd_xcoff_ar_archive_set_magic): Delete unused func.
528 * bfd-in2.h: Regenerate.
529
530 2019-09-23 Alan Modra <amodra@gmail.com>
531
532 * bfd-in.h: Delete coff forward refs and move coff declaration..
533 * coff-bfd.h: ..to here.
534 * bfd-in2.h: Regenerate.
535
536 2019-09-23 Alan Modra <amodra@gmail.com>
537
538 * bfd-in.h: Move arm declaraions..
539 * cpu-arm.h: ..to here, new file..
540 * coff-arm.h: ..and here, new file..
541 * elf32-arm.h: ..and here, new file.
542 * cpu-arm.c: Include cpu-arm.h.
543 * coff-arm.c: Include cpu-arm.h and coff-arm.h.
544 * elf32-arm.c: Include cpu-arm.h and elf32-arm.h.
545 * pe-arm.c: Move function rename defines later.
546 * pe-arm-wince.c: Likewise and include sysdep.h and bfd.h early.
547 * bfd-in2.h: Regenerate.
548
549 2019-09-23 Alan Modra <amodra@gmail.com>
550
551 * bfd-in.h: Move tic6x function declaration..
552 * elf32-tic6x.h: ..to here.
553 * bfd-in2.h: Regenerate.
554
555 2019-09-23 Alan Modra <amodra@gmail.com>
556
557 * bfd-in.h: Move aarch64 declarations and defines..
558 * cpu-aarch64.h: ..to here, new file..
559 * elfxx-aarch64.h: ..and here.
560 * cpu-aarch64.c: Include cpu-aarch64.h.
561 * elfnn-aarch64.c: Likewise.
562 * bfd-in2.h: Regenerate.
563
564 2019-09-23 Alan Modra <amodra@gmail.com>
565
566 * bfd-in.h: Delete ticoff function declarations.
567 * coff-tic54x.c (bfd_ticoff_set_section_load_page),
568 (bfd_ticoff_get_section_load_page): Make static.
569 * bfd-in2.h: Regenerate.
570
571 2019-09-23 Alan Modra <amodra@gmail.com>
572
573 * bfd-in.h: Move h8300 function declaration to..
574 * cpu-h8300.h: ..here, new file.
575 * cpu-h8300.c: Include cpu-h8300.h.
576 * elf32-h8300.c: Likewise.
577 * bfd-in2.h: Regenerate.
578
579 2019-09-23 Alan Modra <amodra@gmail.com>
580
581 * bfd-in.h: Move ia64 function declarations..
582 * elfxx-ia64.h: ..to here.
583 * bfd-in2.h: Regenerate.
584
585 2019-09-23 Alan Modra <amodra@gmail.com>
586
587 * bfd-in.h: Move v850 function declarations..
588 * elf32-v850.h: ..to here, new file.
589 * elf32-v850.c: Include elf32-v850.h.
590 * bfd-in2.h: Regenerate.
591
592 2019-09-23 Alan Modra <amodra@gmail.com>
593
594 * bfd-in.h: Move mips function declaration to..
595 * elfxx-mips.h: ..here.
596 * bfd-in2.h: Regenerate.
597
598 2019-09-23 Alan Modra <amodra@gmail.com>
599
600 * bfd-in.h: Move csky function declarations to..
601 * elf32-csky.h: ..here, new file.
602 * elf32-csky.c: Include elf32-csky.h.
603 * bfd-in2.h: Regenerate.
604
605 2019-09-20 Nelson Chu <nelson.chu@sifive.com>
606
607 * elfnn-riscv.c (riscv_pcgp_hi_reloc): Add new field undefined_weak.
608 (riscv_record_pcgp_hi_reloc): New parameter undefined_weak.
609 Set undefined_weak field from it.
610 (relax_func_t): New parameter undefined_weak.
611 (_bfd_riscv_relax_call): New ignored parameter undefined_weak.
612 (_bfd_riscv_relax_tls_le): Likewise.
613 (_bfd_riscv_relax_align): Likewise.
614 (_bfd_riscv_relax_delete): Likewise.
615 (_bfd_riscv_relax_lui): New parameter undefined_weak. If true,
616 allow relaxing. For LO12* relocs, set rs1 to x0 when undefined_weak.
617 (_bfd_riscv_relax_pc): New parameter undefined_weak. For LO12* relocs,
618 set undefined_weak from hi_reloc. If true, allow relaxing. For LO12*
619 relocs, set rs1 to x0 when undefined_weak and change to non-pcrel
620 reloc.
621 (_bfd_riscv_relax_section): New local undefined_weak. Set for
622 undef weak relocs that can be relaxed. Pass to relax_func call.
623
624 2019-09-20 Alan Modra <amodra@gmail.com>
625
626 * bfd-in.h (bfd_section_name, bfd_section_size, bfd_section_vma),
627 (bfd_section_lma, bfd_section_alignment, bfd_section_flags),
628 (bfd_section_userdata, bfd_is_com_section, discarded_section),
629 (bfd_get_section_limit_octets, bfd_get_section_limit): Delete macros.
630 * bfd.c (bfd_get_section_limit_octets, bfd_get_section_limit),
631 (bfd_section_list_remove, bfd_section_list_append),
632 (bfd_section_list_prepend, bfd_section_list_insert_after),
633 (bfd_section_list_insert_before, bfd_section_removed_from_list):
634 New inline functions.
635 * section.c (bfd_is_und_section, bfd_is_abs_section),
636 (bfd_is_ind_section, bfd_is_const_section, bfd_section_list_remove),
637 (bfd_section_list_append, bfd_section_list_prepend),
638 (bfd_section_list_insert_after, bfd_section_list_insert_before),
639 (bfd_section_removed_from_list): Delete macros.
640 (bfd_section_name, bfd_section_size, bfd_section_vma),
641 (bfd_section_lma, bfd_section_alignment, bfd_section_flags),
642 (bfd_section_userdata, bfd_is_com_section, bfd_is_und_section),
643 (bfd_is_abs_section, bfd_is_ind_section, bfd_is_const_section),
644 (discarded_section): New inline functions.
645 * bfd-in2.h: Regenerate.
646
647 2019-09-20 Alan Modra <amodra@gmail.com>
648
649 * bfd-in.h (bfd_asymbol_section, bfd_asymbol_value, bfd_asymbol_name),
650 (bfd_asymbol_bfd, bfd_asymbol_flavour, bfd_set_asymbol_name): Delete.
651 * bfd.c (bfd_asymbol_section, bfd_asymbol_value, bfd_asymbol_name),
652 (bfd_asymbol_bfd, bfd_set_asymbol_name): New inline functions.
653 * targets.c (bfd_asymbol_flavour): Likewise.
654 * bfd-in2.h: Regenerate.
655
656 2019-09-20 Alan Modra <amodra@gmail.com>
657
658 * archive.c (bfd_generic_archive_p): Use bfd_set_thin_archive.
659 * bfd-in.h (bfd_get_filename, bfd_get_cacheable, bfd_get_format),
660 (bfd_get_target, bfd_get_flavour, bfd_family_coff, bfd_big_endian),
661 (bfd_little_endian, bfd_header_big_endian, bfd_header_little_endian),
662 (bfd_get_file_flags, bfd_applicable_file_flags),
663 (bfd_applicable_section_flags, bfd_has_map, bfd_is_thin_archive),
664 (bfd_valid_reloc_types, bfd_usrdata, bfd_get_start_address),
665 (bfd_get_symcount, bfd_get_outsymbols, bfd_count_sections),
666 (bfd_get_dynamic_symcount, bfd_get_symbol_leading_char): Delete.
667 * bfd/bfd.c (bfd_get_filename, bfd_get_cacheable, bfd_get_format),
668 (bfd_get_file_flags, bfd_get_start_address, bfd_get_symcount),
669 (bfd_get_dynamic_symcount, bfd_get_outsymbols, bfd_count_sections),
670 (bfd_has_map, bfd_is_thin_archive, bfd_set_thin_archive),
671 (bfd_usrdata, bfd_set_usrdata): New inline functions.
672 * targets.c (bfd_get_target, bfd_get_flavour),
673 (bfd_applicable_file_flags, bfd_family_coff, bfd_big_endian),
674 (bfd_little_endian, bfd_header_big_endian),
675 (bfd_header_little_endian, bfd_applicable_section_flags),
676 (bfd_get_symbol_leading_char): New inline functions.
677 * bfd-in2.h: Regenerate.
678
679 2019-09-20 Alan Modra <amodra@gmail.com>
680
681 * elf64-ppc.c (ppc64_glibc_dynamic_reloc): New function.
682 (ppc64_elf_relocate_section): Warn if emitting unsupported dynamic
683 relocations.
684
685 2019-09-18 Alan Modra <amodra@gmail.com>
686
687 * bfd-in.h (bfd_get_section_name, bfd_get_section_vma),
688 (bfd_get_section_lma, bfd_get_section_alignment),
689 (bfd_get_section_size, bfd_get_section_flags),
690 (bfd_get_section_userdata): Delete.
691 (bfd_section_name, bfd_section_size, bfd_section_vma),
692 (bfd_section_lma, bfd_section_alignment): Lose bfd parameter.
693 (bfd_section_flags, bfd_section_userdata): New.
694 (bfd_is_com_section): Rename parameter.
695 * section.c (bfd_set_section_userdata, bfd_set_section_vma),
696 (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section),
697 (bfd_set_section_size): Delete bfd parameter, rename section parameter.
698 (bfd_set_section_lma): New.
699 * bfd-in2.h: Regenerate.
700 * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param,
701 update callers.
702 * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c,
703 * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
704 * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h,
705 * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c,
706 * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c,
707 * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c,
708 * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c,
709 * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c,
710 * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c,
711 * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c,
712 * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c,
713 * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c,
714 * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
715 * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c,
716 * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c,
717 * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
718 * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c,
719 * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
720 * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c,
721 * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
722 * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c,
723 * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c,
724 * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c,
725 * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c,
726 * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c,
727 * xcofflink.c: Update throughout for bfd section macro and function
728 changes.
729
730 2019-09-18 Alan Modra <amodra@gmail.com>
731
732 * bfd-in.h (bfd_asymbol_section): Rename from bfd_get_section.
733 (bfd_get_output_section): Delete.
734 (bfd_asymbol_base): Delete.
735 (bfd_asymbol_section, bfd_asymbol_value, bfd_asymbol_name),
736 (bfd_asymbol_bfd, bfd_asymbol_flavour): Tidy.
737 (bfd_set_asymbol_name): New macro.
738 * bfd-in2.h: Regenerate.
739 * aout-cris.c: Update throughout to use bfd_asymbol_section.
740 * aoutx.h: Likewise.
741 * cofflink.c: Likewise.
742 * dwarf2.c: Likewise.
743 * ecoff.c: Likewise.
744 * elf.c: Likewise.
745 * elf32-arm.c: Likewise.
746 * elf32-mips.c: Likewise.
747 * elf32-score.c: Likewise.
748 * elf32-score7.c: Likewise.
749 * elfn32-mips.c: Likewise.
750 * elfnn-aarch64.c: Likewise.
751 * elfxx-mips.c: Likewise.
752 * linker.c: Likewise.
753 * pdp11.c: Likewise.
754 * elf64-mmix.c (mmix_elf_reloc): Part expand bfd_get_output_section.
755
756 2019-09-18 Simon Marchi <simon.marchi@polymtl.ca>
757
758 * Makefile.in: Re-generate.
759 * configure: Re-generate.
760 * doc/Makefile.in: Re-generate.
761
762 2019-09-18 Alan Modra <amodra@gmail.com>
763
764 * aoutx.h (slurp_symbol_table): Don't set symcount using bfd_get
765 macros.
766 * pdp11.c (slurp_symbol_table): Likewise.
767 * som.c (som_slurp_symbol_table): Likewise.
768 * coff-ppc.c (ppc_bfd_coff_final_link): Likewise.
769 * coffcode.h (coff_slurp_symbol_table): Likewise.
770 * cofflink.c (_bfd_coff_final_link): Likewise.
771 * ecoff.c (ecoff_slurp_symbolic_header): Likewise.
772 (_bfd_ecoff_slurp_symbolic_info): Likewise.
773 (_bfd_ecoff_slurp_symbol_table): Likewise.
774 (_bfd_ecoff_bfd_final_link): Likewise.
775 * elf.c (_bfd_elf_canonicalize_symtab): Likewise.
776 * elflink.c (elf_link_output_symstrtab): Likewise.
777 (bfd_elf_final_link): Likewise.
778 * peicode.h (pe_ILF_build_a_bfd): Likewise.
779 * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise.
780 * aoutx.h (some_aout_object_p, slurp_symbol_table): Don't set
781 start_address or symcount using bfd_get macros.
782 * coffgen.c (coff_real_object_p): Likewise.
783 * pdp11.c (some_aout_object_p, slurp_symbol_table): Likewise.
784 * som.c (som_object_setup, som_slurp_symbol_table): Likewise.
785 * elfcore.h (elf_core_file_p): Don't set start_address using
786 bfd_get macro.
787 * elf.c (_bfd_elf_canonicalize_dynamic_symtab): Don't set dynsymcount
788 using bfd_get macro.
789 * bfd.c (bfd_set_file_flags): Don't set flags using bfd_get macro.
790 * linker.c (bfd_generic_link_read_symbols): Don't set outsymbols
791 or symcount using bfd_get macros.
792 (_bfd_generic_final_link, generic_add_output_symbol): Likewise.
793 * syms.c (bfd_set_symtab): Likewise.
794 * vms-alpha.c (alpha_vms_bfd_final_link): Likewise.
795 * archive.c (do_slurp_bsd_armap): Don't set has_armap using
796 bfd_has_map macro.
797 (do_slurp_coff_armap, bfd_slurp_armap): Likewise.
798 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
799 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
800 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
801 * ecoff.c (_bfd_ecoff_slurp_armap): Likewise.
802 * som.c (som_slurp_armap): Likewise.
803
804 2019-09-18 Alan Modra <amodra@gmail.com>
805
806 * archures.c (bfd_get_arch): Make param const.
807 (bfd_get_mach, bfd_arch_bits_per_byte): Likewise.
808 (bfd_arch_bits_per_address, bfd_octets_per_byte): Likewise.
809 * bfd-in2.h: Regenerate.
810
811 2019-09-18 Alan Modra <amodra@gmail.com>
812
813 * bfd-in.h (carsym.name): Make const.
814 * reloc.c (struct reloc_howto_struct.name): Likewise.
815 * targets.c (bfd_target.name): Likewise.!
816 * bfd.c (bfd_get_sign_extend_vma): Make variable const.
817 * som.c (som_bfd_fill_in_ar_symbols): Use an intermediary variable
818 when setting carsym.name.
819 * bfd-in2.h: Regenerate.
820
821 2019-09-18 Alan Modra <amodra@gmail.com>
822
823 * mach-o.c (bfd_mach_o_fat_member_init): Likewise. Replace
824 xstrdup and xmalloc with bfd_strdup and bfd_malloc. Return an
825 error status. Adjust calls.
826 * vms-lib.c (_bfd_vms_lib_get_module): Test mhd->id earlier.
827 Close bfd on failure. Replace xstrdup/bfd_alloc use with
828 bfd_malloc. Use bfd_set_filename.
829
830 2019-09-18 Alan Modra <amodra@gmail.com>
831
832 * elf64-ppc.c (must_be_dyn_reloc): Return 0 for TOC16 relocs.
833 (ppc64_elf_check_relocs): Support dynamic/copy relocs for TOC16.
834 (ppc64_elf_adjust_dynamic_symbol): Don't keep dynamic reloc when
835 needs_copy even if all relocs are in rw sections.
836 (dec_dynrel_count): Handle TOC16 relocs.
837 (ppc64_elf_relocate_section): Support dynamic relocs for TOC16.
838 (ppc64_elf_finish_dynamic_symbol): Adjust to handle needs_copy
839 semantic change.
840
841 2019-09-16 Phil Blundell <pb@pbcl.net>
842
843 * version.m4: Set version to 2.33.50.
844 * Makefile.in, configure, doc/Makefile.in: Regenerated.
845
846 2019-09-11 Tom Tromey <tom@tromey.com>
847
848 * opncls.c (bfd_set_filename): New function.
849 * bfd-in2.h: Regenerate.
850
851 2019-09-11 Alan Modra <amodra@gmail.com>
852
853 * targets.c (struct bfd_target): Add _bfd_group_name.
854 (BFD_JUMP_TABLE): Likewise.
855 * coffgen.c (bfd_coff_group_name): New function.
856 * elf.c (bfd_elf_group_name): New function.
857 * linker.c (_bfd_nolink_bfd_group_name): New function.
858 * section.c (bfd_generic_group_name): New function.
859 * elf-bfd.h (bfd_elf_group_name): Declare.
860 * libbfd-in.h (_bfd_nolink_bfd_group_name): Declare.
861 * libcoff-in.h (bfd_coff_group_name): Declare.
862 * aout-target.h (MY_bfd_group_name): Define.
863 * aout-tic30.c (MY_bfd_group_name): Define.
864 * bfd.c (bfd_group_name): Define.
865 * binary.c (binary_bfd_group_name): Define.
866 * coff-alpha.c (_bfd_ecoff_bfd_group_name): Define.
867 * coff-mips.c (_bfd_ecoff_bfd_group_name): Define.
868 * coff-rs6000.c (_bfd_xcoff_bfd_group_name): Define.
869 * coffcode.h (coff_bfd_group_name): Define.
870 * elfxx-target.h (bfd_elfNN_bfd_group_name): Define.
871 * i386msdos.c (msdos_bfd_group_name): Define.
872 * ihex.c (ihex_bfd_group_name): Define.
873 * mach-o-target.c (bfd_mach_o_bfd_group_name): Define.
874 * mmo.c (mmo_bfd_group_name): Define.
875 * pef.c (bfd_pef_bfd_group_name): Define.
876 * plugin.c (bfd_plugin_bfd_group_name): Define.
877 * ppcboot.c (ppcboot_bfd_group_name): Define.
878 * som.c (som_bfd_group_name): Define.
879 * srec.c (srec_bfd_group_name): Define.
880 * tekhex.c (tekhex_bfd_group_name): Define.
881 * verilog.c (verilog_bfd_group_name): Define.
882 * vms-alpha.c (vms_bfd_group_name, alpha_vms_bfd_group_name): Define.
883 * xsym.c (bfd_sym_bfd_group_name): Define.
884 * coff64-rs6000.c (rs6000_xcoff64_vec): Init new field.
885 (rs6000_xcoff64_aix_vec): Likewise.
886 * bfd-in2.h: Regenerate.
887 * libbfd.h: Regenerate.
888 * libcoff.h: Regenerate.
889
890 2019-09-10 Nick Clifton <nickc@redhat.com>
891
892 PR 24907
893 * archures.c (bfd_arch_info_type): Add max_reloc_offset_into_insn
894 field.
895 (bfd_default_arch_struct): Initialise the new field.
896 * bfd-in2.h: Regenerate.
897 * cpu-aarch64.c: Initialise the new field.
898 * cpu-alpha.c: Likewise.
899 * cpu-arc.c: Likewise.
900 * cpu-arm.c: Likewise.
901 * cpu-avr.c: Likewise.
902 * cpu-bfin.c: Likewise.
903 * cpu-bpf.c: Likewise.
904 * cpu-cr16.c: Likewise.
905 * cpu-cr16c.c: Likewise.
906 * cpu-cris.c: Likewise.
907 * cpu-crx.c: Likewise.
908 * cpu-csky.c: Likewise.
909 * cpu-d10v.c: Likewise.
910 * cpu-d30v.c: Likewise.
911 * cpu-dlx.c: Likewise.
912 * cpu-epiphany.c: Likewise.
913 * cpu-fr30.c: Likewise.
914 * cpu-frv.c: Likewise.
915 * cpu-ft32.c: Likewise.
916 * cpu-h8300.c: Likewise.
917 * cpu-hppa.c: Likewise.
918 * cpu-i386.c: Likewise.
919 * cpu-ia64.c: Likewise.
920 * cpu-iamcu.c: Likewise.
921 * cpu-ip2k.c: Likewise.
922 * cpu-iq2000.c: Likewise.
923 * cpu-k1om.c: Likewise.
924 * cpu-l1om.c: Likewise.
925 * cpu-lm32.c: Likewise.
926 * cpu-m10200.c: Likewise.
927 * cpu-m10300.c: Likewise.
928 * cpu-m32c.c: Likewise.
929 * cpu-m32r.c: Likewise.
930 * cpu-m68hc11.c: Likewise.
931 * cpu-m68hc12.c: Likewise.
932 * cpu-m68k.c: Likewise.
933 * cpu-m9s12x.c: Likewise.
934 * cpu-m9s12xg.c: Likewise.
935 * cpu-mcore.c: Likewise.
936 * cpu-mep.c: Likewise.
937 * cpu-metag.c: Likewise.
938 * cpu-microblaze.c: Likewise.
939 * cpu-mips.c: Likewise.
940 * cpu-mmix.c: Likewise.
941 * cpu-moxie.c: Likewise.
942 * cpu-msp430.c: Likewise.
943 * cpu-mt.c: Likewise.
944 * cpu-nds32.c: Likewise.
945 * cpu-nfp.c: Likewise.
946 * cpu-nios2.c: Likewise.
947 * cpu-ns32k.c: Likewise.
948 * cpu-or1k.c: Likewise.
949 * cpu-pdp11.c: Likewise.
950 * cpu-pj.c: Likewise.
951 * cpu-plugin.c: Likewise.
952 * cpu-powerpc.c: Likewise.
953 * cpu-pru.c: Likewise.
954 * cpu-riscv.c: Likewise.
955 * cpu-rl78.c: Likewise.
956 * cpu-rs6000.c: Likewise.
957 * cpu-rx.c: Likewise.
958 * cpu-s12z.c: Likewise.
959 * cpu-s390.c: Likewise.
960 * cpu-score.c: Likewise.
961 * cpu-sh.c: Likewise.
962 * cpu-sparc.c: Likewise.
963 * cpu-spu.c: Likewise.
964 * cpu-tic30.c: Likewise.
965 * cpu-tic4x.c: Likewise.
966 * cpu-tic54x.c: Likewise.
967 * cpu-tic6x.c: Likewise.
968 * cpu-tic80.c: Likewise.
969 * cpu-tilegx.c: Likewise.
970 * cpu-tilepro.c: Likewise.
971 * cpu-v850.c: Likewise.
972 * cpu-v850_rh850.c: Likewise.
973 * cpu-vax.c: Likewise.
974 * cpu-visium.c: Likewise.
975 * cpu-wasm32.c: Likewise.
976 * cpu-xc16x.c: Likewise.
977 * cpu-xgate.c: Likewise.
978 * cpu-xstormy16.c: Likewise.
979 * cpu-xtensa.c: Likewise.
980 * cpu-z80.c: Likewise.
981 * cpu-z8k.c: Likewise.
982
983 2019-09-09 Phil Blundell <pb@pbcl.net>
984
985 binutils 2.33 branch created.
986
987 2019-09-06 Alan Modra <amodra@gmail.com>
988
989 * aout-target.h (object_p): Formatting.
990 * bfd-in.h (bfd_get_filename): Don't cast to char*.
991 * corefile.c (generic_core_file_matches_executable_p): Constify
992 variables and remove cast.
993 * bfd-in2.h: Regenerate.
994
995 2019-09-05 Alan Modra <amodra@gmail.com>
996
997 * elf64-ppc.c (ppc64_elf_check_relocs): Interpret an addend in
998 GOT_PCREL and PLT_PCREL relocs as affecting the value stored
999 in the GOT/PLT entry rather than affecting the offset to that
1000 GOI/PLT entry.
1001 (ppc64_elf_edit_toc, ppc64_elf_relocate_section): Likewise.
1002
1003 2019-09-05 Alan Modra <amodra@gmail.com>
1004
1005 * elf64-ppc.c (xlate_pcrel_opt): Handle prefix loads and stores
1006 in second instruction.
1007 (ppc64_elf_relocate_section): Likewise.
1008
1009 2019-09-05 Alan Modra <amodra@gmail.com>
1010
1011 PR 24955
1012 * libbfd-in.h (bfd_strdup): New inline function.
1013 * archive.c (_bfd_get_elt_at_filepos): Use bfd_strdup. Close
1014 bfd on error.
1015 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Use bfd_strdup.
1016 * opncls.c (bfd_fopen): Use bfd_strdup. Close fd and stream
1017 on error.
1018 (bfd_openstreamr): Use bfd_strdup.
1019 (bfd_openr_iovec, bfd_openw, bfd_create): Likewise.
1020 * plugin.c (try_load_plugin): Use bfd_malloc.
1021 * libbfd.h: Regenerate.
1022
1023 2019-09-02 Alan Modra <amodra@gmail.com>
1024
1025 PR 11983
1026 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Free debug_filename
1027 on success. Tidy.
1028 (read_alt_indirect_string): Likewise.
1029 (read_alt_indirect_ref): Likewise.
1030
1031 2019-08-31 Jim Wilson <jimw@sifive.com>
1032
1033 PR 23825
1034 * elfnn-riscv.c (riscv_elf_create_dynamic_sections): Add SEC_LOAD,
1035 SEC_DATA, and SEC_HAS_CONTENTS to .tdata.dyn section.
1036
1037 2019-08-30 Jim Wilson <jimw@sifive.com>
1038
1039 * elfnn-riscv.c (riscv_elf_relocate_section): For unresolvable reloc
1040 error, call bfd_set_error, set ret to FALSE, and goto out label.
1041
1042 2019-08-30 H.J. Lu <hongjiu.lu@intel.com>
1043
1044 PR ld/24951
1045 * archive.c (_bfd_get_elt_at_filepos): Copy BFD_COMPRESS,
1046 BFD_DECOMPRESS and BFD_COMPRESS_GABI flags for thin archive.
1047
1048 2019-08-29 Alan Modra <amodra@gmail.com>
1049
1050 PR 24697
1051 * elf32-ppc.c (ppc_elf_check_relocs): Call bad_shared_reloc
1052 when !bfd_link_executable for R_PPC_EMB_SDA2I16 and
1053 R_PPC_EMB_SDA2REL. Don't call bad_shared_reloc for any other
1054 reloc.
1055
1056 2019-08-29 Alan Modra <amodra@gmail.com>
1057
1058 * elf64-ppc.c (xlate_pcrel_opt): Add poff parameter. Allow offset
1059 on second insn, return it in poff.
1060 (ppc64_elf_relocate_section): Add offset to paddi addend for
1061 PCREL_OPT.
1062
1063 2019-08-28 Jim Wilson <jimw@sifive.com>
1064
1065 * elfnn-riscv.c (_bfd_riscv_relax_lui): Add check to exclude abs
1066 section when setting max_alignment. Update comment.
1067 (_bfd_riscv_relax_pc): Likewise.
1068
1069 2019-08-29 Alan Modra <amodra@gmail.com>
1070
1071 PR 24891
1072 * bfd.c (struct bfd): Add no_element_cache.
1073 * archive.c (_bfd_get_elt_at_filepos): Don't add element to
1074 archive cache when no_element_cache.
1075 (bfd_generic_archive_p): Set no_element_cache when opening first
1076 element to check format. Close first element too.
1077 (do_slurp_bsd_armap): Don't zero ardata->cache here.
1078 * bfd-in2.h: Regenerate.
1079
1080 2019-08-24 Alan Modra <amodra@gmail.com>
1081
1082 * elf64-ppc.c (ppc64_elf_edit_toc): Exclude undefined weak
1083 symbols from GOT optimisation.
1084
1085 2019-08-23 Stafford Horne <shorne@gmail.com>
1086
1087 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Use correct value for
1088 PLT GOT entries.
1089
1090 2019-08-23 Nick Clifton <nickc@redhat.com>
1091
1092 PR 24456
1093 * elf.c (bfd_section_from_shdr): Issue an informative warning
1094 message and continue processing other sections after encountering
1095 a reloc section for a section which already has other relocs
1096 associated with it.
1097
1098 2019-08-23 Alan Modra <amodra@gmail.com>
1099
1100 PR 24933
1101 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Don't exit
1102 on error without freeing plts[] contents.
1103
1104 2019-08-22 Dennis Zhang <dennis.zhang@arm.com>
1105
1106 * cpu-arm.c: New entries for Cortex-M35P, Cortex-A77, Cortex-A76AE.
1107
1108 2019-08-22 Nick Clifton <nickc@redhat.com>
1109
1110 PR 24922
1111 * pei-x86_64.c (pex64_xdata_print_uwd_codes): Add checks before
1112 reading data from extra records.
1113
1114 2019-08-22 Tamar Christina <tamar.christina@arm.com>
1115
1116 PR ld/24601
1117 * elfnn-aarch64.c (aarch64_relocate): Handle weak TLS and undefined TLS.
1118 Also Pass input_bfd to _bfd_aarch64_elf_resolve_relocation.
1119 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Use it.
1120 * elfxx-aarch64.h (_bfd_aarch64_elf_resolve_relocation): Emit warning
1121 for weak TLS.
1122
1123 2019-08-22 Alan Modra <amodra@gmail.com>
1124
1125 * elf32-arm.c (cmse_scan): Don't use ARM_GET_SYM_CMSE_SPCL,
1126 instead recognize CMSE_PREFIX in symbol name.
1127 (elf32_arm_gc_mark_extra_sections): Likewise.
1128 (elf32_arm_filter_cmse_symbols): Don't test ARM_GET_SYM_CMSE_SPCL.
1129 (elf32_arm_swap_symbol_in): Don't invoke ARM_SET_SYM_CMSE_SPCL.
1130
1131 2019-08-20 Dennis Zhang <dennis.zhang@arm.com>
1132
1133 * cpu-aarch64.c: New entries for Cortex-A34, Cortex-A65,
1134 Cortex-A77, cortex-A65AE, and Cortex-A76AE.
1135
1136 2019-08-20 Tamar Christina <tamar.christina@arm.com>
1137
1138 * elf32-arm.c (elf32_thumb2_plt_entry, elf32_arm_plt_thumb_stub,
1139 elf32_arm_stub_long_branch_v4t_thumb_thumb,
1140 elf32_arm_stub_long_branch_v4t_thumb_arm,
1141 elf32_arm_stub_short_branch_v4t_thumb_arm,
1142 elf32_arm_stub_long_branch_v4t_thumb_arm_pic,
1143 elf32_arm_stub_long_branch_v4t_thumb_thumb_pic,
1144 elf32_arm_stub_long_branch_v4t_thumb_tls_pic): Change nop to branch to
1145 previous instruction.
1146
1147 2019-08-19 Tom Tromey <tromey@adacore.com>
1148
1149 * dwarf2.c (_bfd_dwarf2_find_symbol_bias): Create hash table
1150 holding symbols.
1151
1152 2019-08-19 Alan Modra <amodra@gmail.com>
1153
1154 * elf64-ppc.c (struct ppc64_elf_obj_tdata): Rename has_gotrel
1155 to has_optrel.
1156 (struct _ppc64_elf_section_data): Likewise.
1157 (ppc64_elf_check_relocs): Set has_optrel for more relocs.
1158 (ppc64_elf_edit_toc): Do ha/lo insn checks in GOT loop rather
1159 than TOC loop. Check PLT16 insns too.
1160
1161 2019-08-16 H.J. Lu <hongjiu.lu@intel.com>
1162
1163 PR ld/24905
1164 * elf64-x86-64.c (elf_x86_64_check_relocs): Move PIC check for
1165 PC-relative relocations back to ...
1166 (elf_x86_64_relocate_section): Here.
1167
1168 2019-08-16 Martin Liska <mliska@suse.cz>
1169
1170 PR ld/24912
1171 * elflink.c: Report error only for not relocatable.
1172 * linker.c (_bfd_generic_link_add_one_symbol): Do not handle
1173 here lto_slim_object as it's handled in caller.
1174
1175 2019-08-16 Alan Modra <amodra@gmail.com>
1176
1177 * elf32-ppc.c (ppc_elf_relocate_section): Optimize unaligned relocs.
1178
1179 2019-08-15 Jim Wilson <jimw@sifive.com>
1180
1181 * elfnn-riscv.c (perform_relocation) <R_RISCV_RVC_LUI>: If
1182 RISCV_CONST_HIGH_PART (value) is zero, then convert c.lui instruction
1183 to c.li instruction, and use ENCODE_RVC_IMM to set value.
1184
1185 2019-08-15 Tom Tromey <tromey@adacore.com>
1186
1187 * dwarf2.c (scan_unit_for_symbols): Check for end of CU, not end
1188 of section.
1189
1190 2019-08-14 Alan Modra <amodra@gmail.com>
1191
1192 PR 24623
1193 * dwarf2.c (stash_comp_unit): New function, extracted from..
1194 (_bfd_dwarf2_find_nearest_line): ..here.
1195 (find_abstract_instance): Parse comp units and decode line info
1196 as needed.
1197
1198 2019-08-14 Alan Modra <amodra@gmail.com>
1199
1200 * dwarf2.c (comp_unit_maybe_decode_line_info): Declare.
1201 (comp_unit_find_nearest_line): Use it here..
1202 (_bfd_dwarf2_find_symbol_bias): ..and here.
1203
1204 2019-08-14 Alan Modra <amodra@gmail.com>
1205
1206 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Remove addr_size parameter.
1207 * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype.
1208 * coffgen.c (coff_find_nearest_line_with_names): Adjust
1209 _bfd_dwarf2_find_nearest_line calls.
1210 * elf.c (_bfd_elf_find_nearest_line, _bfd_elf_find_line): Likewise.
1211 * elf32-arm.c (elf32_arm_find_nearest_line): Likewise.
1212 * elf64-alpha.c (elf64_alpha_find_nearest_line): Likewise.
1213 * elfnn-aarch64.c (elfNN_aarch64_find_nearest_line): Likewise.
1214 * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Likewise.
1215 * mach-o.c (bfd_mach_o_find_nearest_line): Likewise.
1216 * libbfd.h: Regenerate.
1217
1218 2019-08-09 Mihailo Stojanovic <mihailo.stojanovic@rt-rk.com>
1219
1220 * elf-bfd.h (struct elf_backend_data): New members.
1221 * elflink.c (_bfd_elf_link_create_dynamic_sections): Create
1222 .gnu.hash section if necessary.
1223 (struct collect_gnu_hash_codes): New member.
1224 (elf_gnu_hash_process_symidx): New function name.
1225 (elf_renumber_gnu_hash_syms): Ignore local and undefined
1226 symbols. Record xlat location for every symbol which should have
1227 a .MIPS.xhash entry.
1228 (bfd_elf_size_dynamic_sections): Add DT_GNU_HASH dynamic tag to
1229 dynamic section if necessary.
1230 (GNU_HASH_SECTION_NAME): New define.
1231 (bfd_elf_size_dynsym_hash_dynstr): Get .MIPS.xhash section.
1232 Update the section size info.
1233 * elfxx-mips.c (struct mips_elf_hash_sort_data): New members.
1234 (struct mips_elf_link_hash_entry): New member.
1235 (mips_elf_link_hash_newfunc): Initialize .MIPS.xhash translation
1236 table location.
1237 (mips_elf_sort_hash_table): Initialize the pointer to the
1238 .MIPS.xhash section.
1239 (mips_elf_sort_hash_table_f): Populate the .MIPS.xhash
1240 translation table entry with the symbol dynindx.
1241 (_bfd_mips_elf_section_from_shdr): Add SHT_MIPS_XHASH.
1242 (_bfd_mips_elf_fake_sections): Initialize .MIPS.xhash section
1243 info.
1244 (_bfd_mips_elf_create_dynamic_sections): Create .MIPS.xhash
1245 section.
1246 (_bfd_mips_elf_size_dynamic_sections): Add DT_MIPS_XHASH tag to
1247 dynamic section.
1248 (_bfd_mips_elf_finish_synamic_sections): Add DT_MIPS_XHASH.
1249 (_bfd_mips_elf_final_write_processing): Set .MIPS.xhash section
1250 sh_link info.
1251 (_bfd_mips_elf_get_target_dtag): Get DT_MIPS_XHASH tag.
1252 (MIPS_LIBC_ABI_XHASH): New ABI version enum value.
1253 (_bfd_mips_post_process_headers): Mark the ABI version as
1254 MIPS_LIBC_ABI_XHASH if there exists a .MIPS.xhash section,
1255 but not a .hash section.
1256 (_bfd_mips_elf_record_xhash_symbol): New function. Record a
1257 position in the translation table, associated with the hash
1258 entry.
1259 * elfxx-mips.h (literal_reloc_p): Define
1260 elf_backend_record_xhash_symbol backend hook.
1261 * elfxx-target.h: Initialize elf_backend_record_xhash_symbol
1262 backend hook.
1263
1264 2019-08-07 Jose E. Marchesi <jose.marchesi@oracle.com>
1265
1266 * elf64-bpf.c (bpf_elf_relocate_section): New function.
1267 (bpf_elf_insn_disp_reloc): Delete function.
1268 (elf_backend_relocate_section): Define.
1269
1270 2019-08-07 Alan Modra <amodra@gmail.com>
1271
1272 PR 24644
1273 * archive64.c (_bfd_archive_64_bit_slurp_armap): Properly check
1274 for overflow in expressions involving nsymz.
1275
1276 2019-08-01 Ilia Diachkov <ilia.diachkov@optimitech.com>
1277
1278 * elfnn-riscv.c (_bfd_riscv_relax_lui): Set lui relax safety area to
1279 two pages in relro presence.
1280
1281 2019-08-01 Max Filippov <jcmvbkbc@gmail.com>
1282
1283 * elf32-xtensa.c (insn_num_slots, get_rsr_lend_opcode)
1284 (get_wsr_lbeg_opcode): New functions.
1285 (check_loop_aligned): Detect relaxed loops and adjust loop_len
1286 and insn_len for the first actual instruction of the loop.
1287
1288 2019-07-30 Alan Modra <amodra@gmail.com>
1289
1290 PR 24768
1291 * bfd.c (struct bfd): Add lto_slim_object flag.
1292 * bfd-in2.h: Regenerate.
1293
1294 2019-07-29 Martin Liska <mliska@suse.cz>
1295
1296 PR 24768
1297 * archive.c (_bfd_compute_and_write_armap): Come up with
1298 report_plugin_err variable.
1299 * bfd-in2.h (struct bfd): Add lto_slim_object flag.
1300 * elf.c (struct lto_section): New.
1301 (_bfd_elf_make_section_from_shdr): Parse content of
1302 .gnu_lto_.lto section.
1303 * elflink.c: Report error for a missing LTO plugin.
1304 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
1305
1306 2019-07-28 Alan Modra <amodra@gmail.com>
1307
1308 PR 24857
1309 PR 24339
1310 * elflink.c (elf_link_add_object_symbols): Report an informative
1311 error on finding local symbols with index equal or greater than
1312 symbol table sh_info. Correct comment. Allow such symbols in
1313 dynamic objects. Abort on NULL section for symbol.
1314
1315 2019-07-26 Alan Modra <amodra@gmail.com>
1316
1317 * elf-bfd.h (struct output_elf_obj_tdata): Delete "linker" field.
1318 (elf_linker): Don't define.
1319 * elflink.c (bfd_elf_final_link): Don't set elf_linker.
1320
1321 2019-07-25 YunQiang Su <syq@debian.org>
1322
1323 PR 24832
1324 * elfxx-mips.c (mips_set_isa_flags): Default to MIPS 3 for 64-bit
1325 mips inputs.
1326
1327 2019-07-24 Claudiu Zissulescu <claziss@synopsys.com>
1328
1329 * elf32-arc.c (bfd_get_32_me): Add a small description, fix
1330 formating.
1331 (reloc_type_to_name): Fix formating.
1332 (arc_elf_object_p): Likewise.
1333 (debug_arc_reloc): Likewise.
1334 (arc_do_relocation): Likewise.
1335
1336 2019-07-24 Claudiu Zissulescu <claziss@synopsys.com>
1337
1338 * elf32-arc.c (bfd_get_32_me): New function.
1339 (bfd_put_32_me): Likewise.
1340 (arc_elf_relax_section): Likewise.
1341 (bfd_elf32_bfd_relax_section): Define.
1342
1343 2019-07-24 Alan Modra <amodra@gmail.com>
1344
1345 * elf-bfd.h (struct elf_backend_data): Return bfd_boolean from
1346 elf_backend_final_write_processing, don't pass linker arg.
1347 (_bfd_elf_final_write_processing): Update prototype.
1348 * elf.c (_bfd_elf_write_object_contents): Adjust call.
1349 (_bfd_elf_final_write_processing): Return error on incompatible
1350 OSABI and has_gnu_osabi. Remove linker arg.
1351 * elf-nacl.h (nacl_final_write_processing): Update prototype.
1352 * elf-vxworks.h (elf_vxworks_final_write_processing): Likewise.
1353 * elfxx-mips.h (_bfd_mips_final_write_processing): Likewise.
1354 (_bfd_mips_elf_final_write_processing): Likewise.
1355 * elf-hppa.h (elf_hppa_final_write_processing): Return status
1356 and remove linker arg.
1357 * elf-m10300.c (_bfd_mn10300_elf_final_write_processing): Likewise.
1358 * elf-nacl.c (nacl_final_write_processing): Likewise.
1359 * elf-vxworks.c (elf_vxworks_final_write_processing): Likewise.
1360 * elf32-arc.c (arc_elf_final_write_processing): Likewise.
1361 * elf32-arm.c (arm_final_write_processing): Likewise.
1362 (elf32_arm_final_write_processing): Likewise.
1363 (elf32_arm_nacl_final_write_processing): Likewise.
1364 (elf32_arm_vxworks_final_write_processing): Likewise.
1365 * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise.
1366 * elf32-bfin.c (elf32_bfin_final_write_processing): Likewise.
1367 * elf32-cr16.c (_bfd_cr16_elf_final_write_processing): Likewise.
1368 * elf32-cris.c (cris_elf_final_write_processing): Likewise.
1369 * elf32-h8300.c (elf32_h8_final_write_processing): Likewise.
1370 * elf32-lm32.c (lm32_elf_final_write_processing): Likewise.
1371 * elf32-m32r.c (m32r_elf_final_write_processing): Likewise.
1372 * elf32-m68k.c (elf_m68k_final_write_processing): Likewise.
1373 * elf32-mips.c (mips_vxworks_final_write_processing): Likewise.
1374 * elf32-msp430.c (bfd_elf_msp430_final_write_processing): Likewise.
1375 * elf32-nds32.c (nds32_elf_final_write_processing): Likewise.
1376 * elf32-or1k.c (or1k_elf_final_write_processing): Likewise.
1377 * elf32-pj.c (pj_elf_final_write_processing): Likewise.
1378 * elf32-ppc.c (ppc_final_write_processing): Likewise.
1379 (ppc_elf_final_write_processing): Likewise.
1380 (ppc_elf_vxworks_final_write_processing): Likewise.
1381 * elf32-sparc.c (sparc_final_write_processing): Likewise.
1382 (elf32_sparc_final_write_processing): Likewise.
1383 (elf32_sparc_vxworks_final_write_processing): Likewise.
1384 * elf32-v850.c (v850_elf_final_write_processing): Likewise.
1385 * elf32-xc16x.c (elf32_xc16x_final_write_processing): Likewise.
1386 * elf32-xtensa.c (elf_xtensa_final_write_processing): Likewise.
1387 * elf64-ia64-vms.c (elf64_vms_final_write_processing): Likewise.
1388 * elfnn-ia64.c (elfNN_ia64_final_write_processing): Likewise.
1389 * elfxx-mips.c (_bfd_mips_final_write_processing): Likewise.
1390 (_bfd_mips_elf_final_write_processing): Likewise.
1391
1392 2019-07-24 Alan Modra <amodra@gmail.com>
1393
1394 * elf-vxworks.c (elf_vxworks_final_write_processing): Don't return
1395 early.
1396 * elf32-arc.c (arc_elf_final_write_processing): Likewise.
1397 * elf32-xtensa.c (elf_xtensa_final_write_processing): Likewise.
1398
1399 2019-07-24 Alan Modra <amodra@gmail.com>
1400
1401 * elf32-visium.c (visium_elf_post_process_headers): Don't set
1402 EI_OSABI header byte here.
1403 (ELF_OSABI): Define.
1404
1405 2019-07-23 Alan Modra <amodra@gmail.com>
1406
1407 * elf-bfd.h (enum elf_gnu_osabi): Add elf_gnu_osabi_mbind.
1408 * elf.c (_bfd_elf_make_section_from_shdr): Set elf_gnu_osabi_mbind.
1409 (get_program_header_size): Formatting. Only test SH_GNU_MBIND
1410 when elf_gnu_osabi_mbind is set.
1411 (_bfd_elf_map_sections_to_segments): Likewise.
1412 (_bfd_elf_init_private_section_data): Likewise.
1413 (_bfd_elf_final_write_processing): Update comment.
1414 * elf64-hppa.c (elf64_hppa_special_sections): Move .tbss entry.
1415 (elf_backend_special_sections): Define without .tbss for linux.
1416
1417 2019-07-23 Alan Modra <amodra@gmail.com>
1418
1419 * elf-bfd.h (enum elf_gnu_osabi): Rename from elf_gnu_symbols.
1420 Remove none, any, all enums.
1421 (struct elf_obj_tdata): Rename has_gnu_symbols field to has_gnu_osabi.
1422 (_bfd_elf_final_write_processing): Declare.
1423 * elf.c (_bfd_elf_write_object_contents): Unconditionally call
1424 elf_backend_final_write_processing.
1425 (_bfd_elf_post_process_headers): Move body of function to..
1426 (_bfd_elf_final_write_processing): ..here, but set EI_OSABI byte
1427 only when not already set. Adjust for rename.
1428 * elfxx-target.h (elf_backend_final_write_processing): Default to
1429 _bfd_elf_final_write_processing.
1430 * elf-hppa.h (elf_hppa_final_write_processing): Call
1431 _bfd_elf_final_write_processing.
1432 * elf-m10300.c (_bfd_mn10300_elf_final_write_processing): Likewise.
1433 * elf-nacl.c (nacl_final_write_processing): Likewise.
1434 * elf-vxworks.c (elf_vxworks_final_write_processing): Likewise.
1435 * elf32-arc.c (arc_elf_final_write_processing): Likewise.
1436 * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise.
1437 * elf32-bfin.c (elf32_bfin_final_write_processing): Likewise.
1438 * elf32-cr16.c (_bfd_cr16_elf_final_write_processing): Likewise.
1439 * elf32-cris.c (cris_elf_final_write_processing): Likewise.
1440 * elf32-h8300.c (elf32_h8_final_write_processing): Likewise.
1441 * elf32-lm32.c (lm32_elf_final_write_processing): Likewise.
1442 * elf32-m32r.c (m32r_elf_final_write_processing): Likewise.
1443 * elf32-m68k.c (elf_m68k_final_write_processing): Likewise.
1444 * elf32-msp430.c (bfd_elf_msp430_final_write_processing): Likewise.
1445 * elf32-nds32.c (nds32_elf_final_write_processing): Likewise.
1446 * elf32-or1k.c (or1k_elf_final_write_processing): Likewise.
1447 * elf32-pj.c (pj_elf_final_write_processing): Likewise.
1448 * elf32-v850.c (v850_elf_final_write_processing): Likewise.
1449 * elf32-xc16x.c (elf32_xc16x_final_write_processing): Likewise.
1450 * elf32-xtensa.c (elf_xtensa_final_write_processing): Likewise.
1451 * elf64-ia64-vms.c (elf64_vms_final_write_processing): Likewise.
1452 * elfnn-ia64.c (elfNN_ia64_final_write_processing): Likewise.
1453 * elf32-arm.c (arm_final_write_processing): Split out from..
1454 (elf32_arm_final_write_processing): ..here. Call
1455 _bfd_elf_final_write_processing.
1456 (elf32_arm_nacl_final_write_processing): Adjust.
1457 * elfxx-mips.c (_bfd_mips_final_write_processing): Split out from..
1458 (_bfd_mips_elf_final_write_processing): ..here. Call
1459 _bfd_elf_final_write_processing.
1460 * elfxx-mips.h (_bfd_mips_final_write_processing): Declare.
1461 * elf32-mips.c (mips_vxworks_final_write_processing): Adjust.
1462 * elf32-ppc.c (ppc_final_write_processing): Split out from..
1463 (ppc_elf_final_write_processing): ..here. Call
1464 _bfd_elf_final_write_processing.
1465 (ppc_elf_vxworks_final_write_processing): Adjust.
1466 * elf32-sparc.c (sparc_final_write_processing): Split out from..
1467 (elf32_sparc_final_write_processing): ..here. Call
1468 _bfd_elf_final_write_processing.
1469 (elf32_sparc_vxworks_final_write_processing): Adjust.
1470 * elf32-d10v.c (elf_backend_final_write_processing): Don't define.
1471 * elf32-d30v.c (elf_backend_final_write_processing): Don't define.
1472 * elf32-m68hc11.c (elf_backend_final_write_processing): Don't define.
1473 * elf32-m68hc12.c (elf_backend_final_write_processing): Don't define.
1474 * elf32-s12z.c (elf_backend_final_write_processing): Don't define.
1475 * elf32-i386.c (elf_i386_check_relocs): Don't set has_gnu_symbols.
1476 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1477 * elflink.c (elf_link_add_object_symbols): Likewise.
1478 (elf_link_output_symstrtab): Set has_gnu_osabi for symbols here
1479 instead.
1480
1481 2019-07-23 Omar Majid <omajid@redhat.com>
1482
1483 * coffcode.h (coff_set_arch_mach_hook): Handle I386_APPLE_MAGIC,
1484 I386_FREEBSD_MAGIC, I386_LINUX_MAGIC, I386_NETBSD_MAGIC,
1485 AMD64_APPLE_MAGIC, AMD64_FREEBSD_MAGIC, AMD64_LINUX_MAGIC,
1486 AMD64_NETBSD_MAGIC.
1487 * peXXigen.c: Add comment about source of .NET magic numbers.
1488
1489 2019-07-19 Alan Modra <amodra@gmail.com>
1490
1491 * reloc.c (BFD_RELOC_PPC64_TPREL34, BFD_RELOC_PPC64_DTPREL34),
1492 (BFD_RELOC_PPC64_GOT_TLSGD34, BFD_RELOC_PPC64_GOT_TLSLD34),
1493 (BFD_RELOC_PPC64_GOT_TPREL34, BFD_RELOC_PPC64_GOT_DTPREL34),
1494 (BFD_RELOC_PPC64_TLS_PCREL): New pcrel tls relocs.
1495 * elf64-ppc.c (ppc64_elf_howto_raw): Add howtos for pcrel tls relocs.
1496 (ppc64_elf_reloc_type_lookup): Translate pcrel tls relocs.
1497 (must_be_dyn_reloc, dec_dynrel_count): Add R_PPC64_TPREL64.
1498 (ppc64_elf_check_relocs): Support pcrel tls relocs.
1499 (ppc64_elf_tls_optimize, ppc64_elf_relocate_section): Likewise.
1500 * bfd-in2.h: Regenerate.
1501 * libbfd.h: Regenerate.
1502
1503 2019-07-18 Alan Modra <amodra@gmail.com>
1504
1505 * elf64-ppc.c (ppc64_elf_relocate_section): Don't bother selecting
1506 a TLS section symbol for edited relocs. Tighten TLS symbol/reloc
1507 match test.
1508
1509 2019-07-18 Alan Modra <amodra@gmail.com>
1510
1511 * elf64-ppc.c (TLS_EXPLICIT): Define as 256.
1512 (ppc64_elf_check_relocs): Don't store TLS_EXPLICIT even if char
1513 is more than 8 bits.
1514 (ppc64_elf_tls_optimize): Likewise. Make tls_set, tls_clear, and
1515 tls_type vars unsigned int.
1516 (ppc64_elf_relocate_section): Use r_type rather than TLS_EXPLICIT
1517 to select r_type edit.
1518
1519 2019-07-18 Alan Modra <amodra@gmail.com>
1520
1521 * elf32-ppc.c (TLS_GDIE): Rename from TLS_TPRELGD throughout file.
1522 Correct comment.
1523 * elf64-ppc.c (TLS_GDIE): Likewise.
1524
1525 2019-07-18 Alan Modra <amodra@gmail.com>
1526
1527 * elf64-ppc.c (ppc64_elf_tls_optimize): Correct test for allowed
1528 range of tp-relative offsets.
1529
1530 2019-07-15 Alan Modra <amodra@gmail.com>
1531
1532 * elflink.c (_bfd_elf_fix_symbol_flags): If the def for an
1533 alias is no longer bfd_link_hash_defined, clear the alias.
1534
1535 2019-07-13 Alan Modra <amodra@gmail.com>
1536
1537 * elflink.c (_bfd_elf_omit_section_dynsym_default): Don't keep
1538 tls_sec.
1539 (_bfd_elf_init_1_index_section): Prefer not using TLS sections.
1540 (_bfd_elf_init_2_index_sections): Likewise.
1541 * elf64-ppc.c (ppc64_elf_relocate_section): When emitting dynamic
1542 relocations for local TLS symbols, use STN_UNDEF as the relocation
1543 symbol.
1544 * elf32-ppc.c (ppc_elf_relocate_section): Likewise, and don't
1545 leave TLS symbol value in the addend.
1546
1547 2019-07-08 Alan Modra <amodra@gmail.com>
1548
1549 PR 24785
1550 * elf32-ppc.c (_bfd_elf_ppc_set_arch): Sanity check .PPC.EMB.apuinfo
1551 size before reading first word.
1552
1553 2019-07-02 Nick Clifton <nickc@redhat.com>
1554
1555 PR 24717
1556 * elf.c (is_debuginfo_file): New function.
1557 (assign_file_positions_for_non_load_sections): Do not warn about
1558 allocated sections outside of loadable segments if they are found
1559 in a debuginfo file.
1560 * elf-bfd.h (is_debuginfo_file): Prototype.
1561
1562 2019-07-02 Nick Clifton <nickc@redhat.com>
1563
1564 PR 24753
1565 * compress.c (bfd_get_full_section_contents): Do not complain
1566 about linker created sections that are larger than the file size.
1567
1568 2019-07-02 Christophe Lyon <christophe.lyon@linaro.org>
1569
1570 * bfd/elf32-arm.c (CMSE_STUB_NAME): New define.
1571 (elf32_arm_get_stub_entry): Do not try to emit long-branch stubs
1572 for CMSE stubs.
1573 (arm_dedicated_stub_output_section_name): Use CMSE_STUB_NAME.
1574
1575 2019-07-02 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
1576
1577 * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Mark debug
1578 sections when .text section contain secure entry functions
1579 is marked.
1580
1581 2019-07-01 Nick Clifton <nickc@redhat.com>
1582
1583 PR 23839
1584 * elf32-arm.c (elf32_arm_update_relocs): Do not include the
1585 section VMA in the offset used to update exidx relocs.
1586
1587 2019-06-28 Nick Clifton <nickc@redhat.com>
1588
1589 PR 24708
1590 * elf.c (_bfd_elf_slurp_version_tables): Check for an excessively
1591 large version reference section.
1592 * compress.c (bfd_get_full_section_contents): Check for an
1593 uncompressed section whose size is larger than the file size.
1594
1595 2019-06-28 Alan Modra <amodra@gmail.com>
1596
1597 * format.c (bfd_check_format_matches): Don't match plugin target
1598 if another target matches. Expand comment.
1599 * targets.c (_bfd_target_vector): Move plugin_vec after all other
1600 non-corefile targets, outside !SELECT_VECS.
1601 * config.bfd: Don't handle targ=plugin here.
1602 * configure.ac: Don't add plugin to enable_targets or handle in
1603 target loop setting selvecs and other target vars.
1604 * configure: Regenerate.
1605
1606 2019-06-26 Nick Clifton <nickc@redhat.com>
1607
1608 PR 24703
1609 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add error
1610 messages for failures.
1611 * mach-o.c (bfd_mach_o_canonicalize_relocs): Set an bfd error code
1612 if returning an error value.
1613
1614 2019-06-25 Jan Beulich <jbeulich@suse.com>
1615
1616 * elf-properties.c (elf_find_and_remove_property): Rename last
1617 parameter. Mention it in comment.
1618
1619 2019-06-24 Ilia Diachkov <ilia.diachkov@optimitech.com>
1620
1621 * elfnn-riscv.c (_bfd_riscv_relax_lui): Delete early exit when
1622 SEC_MERGE or SEC_CODE flags are set.
1623 (_bfd_riscv_relax_section): New local symtype. Set sym_sec and
1624 symtype consistently. Don't include sec_addr (sym_sec) in symval.
1625 Add check for SEC_INFO_TYPE_MERGE and call _bfd_merged_section_offset.
1626 Add sec_addr (sym_sec) after handling merge sections.
1627
1628 2019-06-24 H.J. Lu <hongjiu.lu@intel.com>
1629
1630 PR ld/24721
1631 * elf-properties.c (elf_merge_gnu_property_list): Remove the
1632 property after reporting property removal.
1633
1634 2019-06-23 Alan Modra <amodra@gmail.com>
1635
1636 PR 24704
1637 * elf64-ppc.c (R_PPC64_GOT16_DS): Don't set has_gotrel.
1638 (ppc64_elf_edit_toc): Don't remove R_PPC64_GOT16_DS got entries.
1639 Reduce range of offsets allowed for other GOT relocs.
1640
1641 2019-06-23 Alan Modra <amodra@gmail.com>
1642
1643 PR 24689
1644 * elfcode.h (elf_object_p): Warning fix.
1645
1646 2019-06-21 Alan Modra <amodra@gmail.com>
1647
1648 PR 24689
1649 * elfcode.h (elf_object_p): Check type of e_shstrndx section.
1650
1651 2019-06-19 Alan Modra <amodra@gmail.com>
1652
1653 PR 24697
1654 * elf32-ppc.c (ppc_elf_relocate_section): Don't read insn for
1655 R_PPC_EMB_RELSDA. Mask low bit of R_PPC_EMB_SDA21 r_offset.
1656
1657 2019-06-19 Alan Modra <amodra@gmail.com>
1658
1659 * elf64-ppc.c (ppc64_elf_inline_plt): Correct st_other test for
1660 functions that require r2 valid to use local entry.
1661 (ppc64_elf_size_stubs, ppc64_elf_relocate_section): Likewise.
1662
1663 2019-06-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
1664
1665 * elfnn-aarch64.c (elfNN_aarch64_allocate_local_dynrelocs): Remove.
1666 (elfNN_aarch64_size_dynamic_sections): Remove loc_hash_table traversal
1667 with elfNN_aarch64_allocate_local_dynrelocs.
1668
1669 2019-06-14 Szabolcs Nagy <szabolcs.nagy@arm.com>
1670
1671 * elfnn-aarch64.c: Enable MOVW_PREL relocs for ELF32.
1672
1673 2019-06-14 Alan Modra <amodra@gmail.com>
1674
1675 * Makefile.in: Regenerate.
1676 * configure: Regenerate.
1677
1678 2019-06-14 Alan Modra <amodra@gmail.com>
1679
1680 * elf64-ppc.c: Fix comments involving paddi.
1681
1682 2019-06-12 Adam Lackorzymski <adam@os.inf.tu-dresden.de>
1683
1684 PR 24643
1685 * elf32-arm.c (arm_elf_find_function): Fail if the symol table is
1686 absent, or the bfd is not in the ELF formart.
1687 * elfnn-aarch64.c (aarch64_elf_find_function): Likewise.
1688
1689 2019-06-10 Christos Zoulas <christos@zoulas.com>
1690
1691 PR 24650
1692 * elf.c (elfcore_make_auxv_note_section): New function.
1693 (elfcore_grok_note): Use it.
1694 (elfcore_grok_freebsd_note): Likewise.
1695 (elfcore_grok_openbsd_note): Likewise.
1696 (elfcore_grok_netbsd_note): Likewise. Plus add support for
1697 NT_NETBSDCORE_AUXV notes.
1698
1699 2019-06-06 Sudakshina Das <sudi.das@arm.com>
1700
1701 * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Set
1702 alignment of the new gnu property section.
1703
1704 2019-06-06 Sudakshina Das <sudi.das@arm.com>
1705
1706 * bfd-in.h: Change comment.
1707 * bfd-in2.h: Regenerate.
1708 * elfnn-aarch64.c (elfNN_aarch64_merge_gnu_properties): Update warning.
1709 * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties):
1710 Likwise.
1711
1712 2019-05-28 Faraz Shahbazker <fshahbazker@wavecomp.com>
1713
1714 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_PCHI16>:
1715 Remove overflow check.
1716
1717 2019-05-28 Alan Modra <amodra@gmail.com>
1718
1719 PR 24596
1720 * cofflink.c (coff_link_check_archive_element): Don't assume
1721 element is a coff object file after calling add_archive_element.
1722
1723 2019-05-28 Alan Modra <amodra@gmail.com>
1724
1725 PR 24596
1726 * elf32-microblaze.c (microblaze_elf_finish_dynamic_sections): Don't
1727 attempt to set sh_entsize for excluded PLT section.
1728
1729 2019-05-28 Alan Modra <amodra@gmail.com>
1730
1731 PR 24596
1732 * elf64-alpha.c (elf64_alpha_relocate_section): Don't attempt
1733 to emit R_ALPHA_GOTTPREL in PIEs, for which no space is
1734 allocated in alpha_dynamic_entries_for_reloc.
1735
1736 2019-05-28 Alan Modra <amodra@gmail.com>
1737
1738 PR 24596
1739 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Don't segfault
1740 on NULL output_section.
1741 * elflink.c (elf_final_link_free): Don't free -1 symshndxbuf.
1742
1743 2019-05-28 Alan Modra <amodra@gmail.com>
1744
1745 PR 24596
1746 * elf32-m68k.c (elf_m68k_get_got_entry): Don't create a new
1747 entry when MUST_FIND. Abort when MUST_FIND not found.
1748 (elf_m68k_get_bfd2got_entry): Likewise.
1749 (elf_m68k_relocate_section): Remove now useless assert.
1750
1751 2019-05-28 Alan Modra <amodra@gmail.com>
1752
1753 PR 24596
1754 * elf64-hppa.c (elf64_hppa_finalize_dynreloc): Get the output bfd
1755 from bfd_link_info, not an output section owner.
1756 (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd): Likewise.
1757 (elf_hppa_final_link_relocate): Likewise.
1758
1759 2019-05-28 Alan Modra <amodra@gmail.com>
1760
1761 PR 24596
1762 * aout-tic30.c (MY_bfd_final_link): Don't segfault on missing
1763 create_object_symbols_section, obj_textsec, obj_datasec or
1764 obj_bsssec. Fix other errors in placement.
1765 * config.bfd: Obsolete tic30-aout.
1766
1767 2019-05-28 Alan Modra <amodra@gmail.com>
1768
1769 PR 24596
1770 * dwarf2.c (save_section_vma, section_vma_same): Check for NULL
1771 end of section list as well as section_count.
1772 * xcofflink.c (xcoff_link_add_symbols): Fix temporarily changed
1773 section list before returning error.
1774
1775 2019-05-27 Alan Modra <amodra@gmail.com>
1776
1777 * elf.c (bfd_elf_set_group_contents): Exit on zero size section.
1778
1779 2019-05-27 Alan Modra <amodra@gmail.com>
1780
1781 PR 24596
1782 * linker.c (_bfd_generic_link_output_symbols): Heed BSF_KEEP.
1783
1784 2019-05-24 Szabolcs Nagy <szabolcs.nagy@arm.com>
1785
1786 * elfnn-aarch64.c (elfNN_aarch64_merge_symbol_attribute): New function.
1787 (struct elf_aarch64_link_hash_table): Add variant_pcs member.
1788 (elfNN_aarch64_allocate_dynrelocs): Update variant_pcs.
1789 (elfNN_aarch64_size_dynamic_sections): Add DT_AARCH64_VARIANT_PCS.
1790 (elf_backend_merge_symbol_attribute): Define.
1791
1792 2019-05-24 Alan Modra <amodra@gmail.com>
1793
1794 * po/SRC-POTFILES.in: Regenerate.
1795
1796 2019-05-24 Alan Modra <amodra@gmail.com>
1797
1798 * elf64-ppc.c: Comment on powerxx _notoc stub variants.
1799 (LI_R11_0, LIS_R11, ORI_R11_R11_0, SLDI_R11_R11_34): Define.
1800 (PADDI_R12_PC, PLD_R12_PC, D34, HA34): Define.
1801 (struct ppc_link_hash_table): Add powerxx_stubs.
1802 (ppc64_elf_check_relocs): Set powerxx_stubs.
1803 (build_powerxx_offset, size_powerxx_offset),
1804 (num_relocs_for_powerxx_offset),
1805 (emit_relocs_for_powerxx_offset): New functions.
1806 (plt_stub_size): Size powerxx stubs.
1807 (ppc_build_one_stub): Emit powerxx stubs.
1808 (ppc_size_one_stub): Size powerxx stubs. Omit .eh_frame for
1809 powerxx stubs.
1810
1811 2019-05-24 Alan Modra <amodra@gmail.com>
1812
1813 * elf64-ppc.c (ppc64_elf_check_relocs): Set has_gotrel for
1814 R_PPC64_GOT_PCREL34.
1815 (xlate_pcrel_opt): New function.
1816 (ppc64_elf_edit_toc): Handle R_PPC64_GOT_PCREL34.
1817 (ppc64_elf_relocate_section): Edit GOT indirect to GOT relative
1818 for R_PPC64_GOT_PCREL34. Implement R_PPC64_PCREL_OPT optimisation.
1819
1820 2019-05-24 Alan Modra <amodra@gmail.com>
1821
1822 * reloc.c (BFD_RELOC_PPC64_D34, BFD_RELOC_PPC64_D34_LO),
1823 (BFD_RELOC_PPC64_D34_HI30, BFD_RELOC_PPC64_D34_HA30),
1824 (BFD_RELOC_PPC64_PCREL34, BFD_RELOC_PPC64_GOT_PCREL34),
1825 (BFD_RELOC_PPC64_PLT_PCREL34),
1826 (BFD_RELOC_PPC64_ADDR16_HIGHER34, BFD_RELOC_PPC64_ADDR16_HIGHERA34),
1827 (BFD_RELOC_PPC64_ADDR16_HIGHEST34, BFD_RELOC_PPC64_ADDR16_HIGHESTA34),
1828 (BFD_RELOC_PPC64_REL16_HIGHER34, BFD_RELOC_PPC64_REL16_HIGHERA34),
1829 (BFD_RELOC_PPC64_REL16_HIGHEST34, BFD_RELOC_PPC64_REL16_HIGHESTA34),
1830 (BFD_RELOC_PPC64_D28, BFD_RELOC_PPC64_PCREL28): New reloc enums.
1831 * elf64-ppc.c (PNOP): Define.
1832 (ppc64_elf_howto_raw): Add reloc howtos for new relocations.
1833 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc numbers.
1834 (ppc64_elf_ha_reloc): Adjust addend for highera34 and highesta34
1835 relocs.
1836 (ppc64_elf_prefix_reloc): New function.
1837 (struct ppc_link_hash_table): Add notoc_plt.
1838 (is_branch_reloc): Add R_PPC64_PLTCALL_NOTOC.
1839 (is_plt_seq_reloc): Add R_PPC64_PLT_PCREL34,
1840 R_PPC64_PLT_PCREL34_NOTOC, and R_PPC64_PLTSEQ_NOTOC.
1841 (ppc64_elf_check_relocs): Handle pcrel got and plt relocs. Set
1842 has_pltcall for section on seeing R_PPC64_PLTCALL_NOTOC. Handle
1843 possible need for dynamic relocs on non-pcrel powerxx relocs.
1844 (dec_dynrel_count): Handle non-pcrel powerxx relocs.
1845 (ppc64_elf_inline_plt): Handle R_PPC64_PLTCALL_NOTOC.
1846 (toc_adjusting_stub_needed): Likewise.
1847 (ppc64_elf_tls_optimize): Handle R_PPC64_PLTSEQ_NOTOC.
1848 (ppc64_elf_relocate_section): Handle new powerxx relocs.
1849 * bfd-in2.h: Regenerate.
1850 * libbfd.h: Regenerate.
1851
1852 2019-05-23 Jose E. Marchesi <jose.marchesi@oracle.com>
1853
1854 * config.bfd (targ_cpu): Process bpf-*-none only if BFD64.
1855 * configure.ac: Set target_size=64 for bpf_elf64_le_vec and
1856 bpf_elf64_be_vec.
1857 * configure: Regenerate.
1858
1859 2019-05-23 Jose E. Marchesi <jose.marchesi@oracle.com>
1860
1861 * configure: Regenerated.
1862 * Makefile.am (ALL_MACHINES): Add cpu-bpf.lo.
1863 (ALL_MACHINES_CFILES): Add cpu-bpf.c.
1864 (BFD64_BACKENDS): Add elf64-bpf.lo.
1865 (BFD64_BACKENDS_CFILES): Add elf64-bpf.c.
1866 * Makefile.in (SOURCE_HFILES): Regenerate.
1867 * config.bfd (targ_cpu): Handle bpf-*-* targets.
1868 * cpu-bpf.c: New file.
1869 * elf64-bpf.c: Likewise.
1870 * targets.c (_bfd_target_vector): Add bpf_elf64_be_vec and
1871 bpf_elf64_le_vec.
1872 * archures.c: Define architecture bfd_arch_bpf and machine
1873 bfd_arch_bpf.
1874 * reloc.c: Define BFD relocations used by the BPF target.
1875 * bfd-in2.h: Regenerated.
1876 * libbfd.h: Likewise.
1877
1878 2019-05-22 Alan Modra <amodra@gmail.com>
1879
1880 * elf32-arm.c (arm_allocate_glue_section_space): Clear section
1881 contents.
1882
1883 2019-05-22 Alan Modra <amodra@gmail.com>
1884
1885 * vms-alpha.c (_bfd_vms_write_etir): Don't attempt further
1886 processing on "size error in section".
1887
1888 2019-05-22 Alan Modra <amodra@gmail.com>
1889
1890 * som.c (som_bfd_free_cached_info): Call
1891 _bfd_generic_close_and_cleanup.
1892
1893 2019-05-21 Faraz Shahbazker <fshahbazker@wavecomp.com>
1894
1895 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Generate error
1896 for TLS_TPREL_HI16(/LO16) relocations in shared library.
1897
1898 2019-05-21 Faraz Shahbazker <fshahbazker@wavecomp.com>
1899
1900 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Add NULL pointer
1901 checks. Search the RELA table for n64 relocations.
1902
1903 2019-05-21 Matthew Fortune <matthew.fortune@mips.com>
1904 Faraz Shahbazker <fshahbazker@wavecomp.com>
1905
1906 * elfxx-mips.c (LA25_BC): New macro.
1907 (mips_elf_link_hash_table)<compact_branches>: New field.
1908 (STUB_JALRC): New macro.
1909 (mipsr6_o32_exec_plt0_entry_compact): New array.
1910 (mipsr6_n32_exec_plt0_entry_compact): Likewise.
1911 (mipsr6_n64_exec_plt0_entry_compact): Likewise.
1912 (mipsr6_exec_plt_entry_compact): Likewise.
1913 (mips_elf_create_la25_stub): Use BC instead of J for stubs
1914 when compact_branches is true.
1915 (_bfd_mips_elf_finish_dynamic_symbol): Choose the compact
1916 PLT for MIPSR6 with compact_branches. Do not reorder the
1917 compact branches PLT. Switch the lazy stub for MIPSR6
1918 with compact_branches to use JALRC.
1919 (mips_finish_exec_plt): Choose the compact PLT0 for MIPSR6
1920 when compact_branches is true.
1921 (_bfd_mips_elf_compact_branches): New function.
1922 * elfxx-mips.h (_bfd_mips_elf_compact_branches): New prototype.
1923
1924 2019-05-21 Tamar Christina <tamar.christina@arm.com>
1925
1926 PR ld/24373
1927 * elfnn-aarch64.c (_bfd_aarch64_erratum_843419_branch_to_stub):
1928 Fix print formatter.
1929
1930 2019-05-21 Andre Vieira <andre.simoesdiasvieira@arm.com>
1931
1932 PR 24460
1933 * elf32-arm.c (get_value_helper): Remove.
1934 (elf32_arm_final_link_relocate): Fix branch future relocations.
1935
1936 2019-05-21 Tamar Christina <tamar.christina@arm.com>
1937
1938 PR ld/24373
1939 * bfd-in.h (enum erratum_84319_opts): New
1940 (bfd_elf64_aarch64_set_options, bfd_elf32_aarch64_set_options): Change
1941 int to enum erratum_84319_opts.
1942 * bfd-in2.h: Regenerate.
1943 * elfnn-aarch64.c (struct elf_aarch64_link_hash_table): Change
1944 fix_erratum_843419 to use new enum, remove fix_erratum_843419_adr.
1945 (_bfd_aarch64_add_stub_entry_after): Conditionally create erratum stub.
1946 (aarch64_size_one_stub): Conditionally size erratum 843419 stubs.
1947 (_bfd_aarch64_resize_stubs): Amend comment.
1948 (elfNN_aarch64_size_stubs): Don't generate stubs when no workaround
1949 requested.
1950 (bfd_elfNN_aarch64_set_options): Use new fix_erratum_843419 enum.
1951 (_bfd_aarch64_erratum_843419_branch_to_stub): Implement selection of
1952 erratum workaround.
1953 (clear_erratum_843419_entry): Update erratum conditional.
1954
1955 2019-05-21 Senthil Kumar Selvaraj <senthilkumar.selvaraj@microchip.com>
1956
1957 PR ld/24571
1958 * bfd/elf32-avr.c (elf32_avr_relax_section): Adjust range check
1959 when computing distance_short_enough.
1960
1961 2019-05-21 Senthil Kumar Selvaraj <senthilkumar.selvaraj@microchip.com>
1962
1963 PR ld/24564
1964 * bfd/elf32-avr.c (avr_relative_distance_considering_wrap_around):
1965 Wrap around even if distance equals avr_pc_wrap_around.
1966
1967 2019-05-20 Nick Clifton <nickc@redhat.com>
1968
1969 * po/fr.po: Updated French translation.
1970
1971 2019-05-16 Andre Vieira <andre.simoesdiasvieira@arm.com>
1972
1973 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Add case for Tag_MVE_arch.
1974
1975 2019-05-16 Alan Modra <amodra@gmail.com>
1976
1977 * elf32-arm.c (elf32_arm_write_section): Revert last change.
1978
1979 2019-05-15 Alan Modra <amodra@gmail.com>
1980
1981 * elf32-arm.c (elf32_arm_write_section): Don't leave
1982 error case of STM32L4XX_ERRATUM_BRANCH_TO_VENEER with
1983 unitialised section contents.
1984
1985 2019-05-14 Jamey Hicks <jamey.hicks@gmail.com>
1986
1987 PR 19921
1988 * verilog.c: (VerilogDataWidth): New variable.
1989 (verilog_write_record): Emit bytes in VerilogDataWidth bundles.
1990
1991 2019-05-08 Nick Clifton <nickc@redhat.com>
1992
1993 PR 24523
1994 * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Return TRUE
1995 rather than FALSE if encountering a non-ELF file.
1996
1997 2019-05-06 Alan Modra <amodra@gmail.com>
1998
1999 * elf32-pj.c (pj_elf_reloc): Don't report undefined weak as an error.
2000
2001 2019-05-06 Alan Modra <amodra@gmail.com>
2002
2003 * reloc.c (BFD_RELOC_PPC64_TPREL16_HIGH, BFD_RELOC_PPC64_TPREL16_HIGHA),
2004 (BFD_RELOC_PPC64_DTPREL16_HIGH, BFD_RELOC_PPC64_DTPREL16_HIGHA):
2005 Sort before BFD_RELOC_PPC64_DTPREL16_HIGHESTA entry.
2006 * libbfd.h: Regenerate.
2007 * bfd-in2.h: Regenerate.
2008
2009 2019-05-04 Alan Modra <amodra@gmail.com>
2010
2011 PR 24511
2012 * syms.c (coff_section_type): Only allow '.', '$' and numeric
2013 following the standard section names.
2014 (bfd_decode_symclass): Prioritize section flag tests in
2015 decode_section_type before name tests in coff_section_type.
2016 * plugin.c (bfd_plugin_canonicalize_symtab): Init fake_section
2017 and fake_common_section using BFD_FAKE_SECTION. Use "fake" as
2018 their names and choose standard .text section flags for
2019 fake_section.
2020
2021 2019-05-02 Nick Clifton <nickc@redhat.com>
2022
2023 PR 24493
2024 * coffcode.h (styp_to_sec_flags): Treat .gnu.debuglink and
2025 .gnu.debugaltlink sections as debugging sections.
2026
2027 2019-04-30 Alan Modra <amodra@gmail.com>
2028
2029 * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add has_gotrel.
2030 (struct _ppc64_elf_section_data): Likewise.
2031 (ppc64_elf_check_relocs): Set above fields.
2032 (ppc64_elf_edit_toc): Add a pass over GOT relocs.
2033 (ppc64_elf_relocate_section): Edit GOT indirect to GOT relative
2034 when possible.
2035
2036 2019-04-26 H.J. Lu <hongjiu.lu@intel.com>
2037
2038 PR ld/24486
2039 * elflink.c (elf_link_output_extsym): Don't complain undefined
2040 weak dynamic reference.
2041
2042 2019-04-25 Sudakshina Das <sudi.das@arm.com>
2043
2044 * elfnn-aarch64.c (PLT_BTI_ENTRY_SIZE): Remove.
2045 (PLT_BTI_TLSDESC_ENTRY_SIZE): Remove.
2046 (PLT_PAC_ENTRY_SIZE, PLT_BTI_PAC_ENTRY_SIZE): Remove.
2047 (PLT_BTI_SMALL_ENTRY_SIZE, PLT_PAC_SMALL_ENTRY_SIZE): Update.
2048 (elfNN_aarch64_small_plt0_pac_entry): Remove.
2049 (elfNN_aarch64_small_plt0_bti_pac_entry): Remove.
2050 (elfNN_aarch64_small_plt0_bti_entry): Update.
2051 (elfNN_aarch64_small_plt_bti_entry): Update.
2052 (elfNN_aarch64_small_plt_pac_entry): Update.
2053 (elfNN_aarch64_tlsdesc_small_plt_bti_entry): Update.
2054 (setup_plt_values): Setup new entries.
2055 (elfNN_aarch64_finish_dynamic_sections): Remove size change.
2056 (elfNN_aarch64_plt_sym_val): Likewise.
2057
2058 2019-04-22 Jim Wilson <jimw@sifive.com>
2059
2060 * elfnn-riscv.c (PRSTATUS_SIZE) [ARCH_SIZE==32]: Change from 0 to 204.
2061
2062 2019-04-19 Alan Modra <amodra@gmail.com>
2063
2064 * elf32-s12z.c (elf_backend_can_gc_sections): Don't define
2065
2066 2019-04-17 H.J. Lu <hongjiu.lu@intel.com>
2067
2068 * elf64-x86-64.c (elf_x86_64_need_pic): Suggest -fPIE when not
2069 building shared object.
2070 * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Likewise.
2071
2072 2019-04-17 H.J. Lu <hongjiu.lu@intel.com>
2073
2074 PR ld/24458
2075 * elfxx-x86.h (SYMBOL_DEFINED_NON_SHARED_P): Also check x86
2076 linker_def.
2077
2078 2019-04-15 Thomas Preud'homme <thomas.preudhomme@arm.com>
2079
2080 * reloc.c (BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM): New internal
2081 relocation.
2082 * bfd-in2.h: Regenerate.
2083 * libbfd.h: Likewise.
2084
2085 2019-04-15 Sudakshina Das <sudi.das@arm.com>
2086
2087 * reloc.c (BFD_RELOC_ARM_THUMB_LOOP12): New.
2088 * bfd-in2.h: Regenerated.
2089 * libbfd.h: Regenerated.
2090
2091 2019-04-15 Sudakshina Das <sudi.das@arm.com>
2092
2093 * reloc.c (BFD_RELOC_THUMB_PCREL_BFCSEL): New relocation.
2094 * bfd-in2.h: Regenerated.
2095 * libbfd.h: Likewise.
2096
2097 2019-04-15 Sudakshina Das <sudi.das@arm.com>
2098
2099 * reloc.c (BFD_RELOC_ARM_THUMB_BF13): New.
2100 * bfd-in2.h: Regenerated.
2101 * libbfd.h: Regenerated.
2102 * elf32-arm.c (elf32_arm_howto_table_1): New entry for R_ARM_THM_BF13.
2103 (elf32_arm_reloc_map elf32_arm_reloc_map): Map BFD_RELOC_ARM_THUMB_BF13
2104 and R_ARM_THM_BF12 together.
2105 (elf32_arm_final_link_relocate): New switch case for R_ARM_THM_BF13.
2106
2107 2019-04-15 Sudakshina Das <sudi.das@arm.com>
2108
2109 * reloc.c (BFD_RELOC_ARM_THUMB_BF19): New
2110 * libbfd.h: Regenerated.
2111 * bfd-in2.h: Regenerated.
2112 * bfd-elf32-arm.c (elf32_arm_howto_table_1): New entry for R_ARM_THM_BF18.
2113 (elf32_arm_reloc_map elf32_arm_reloc_map): Map BFD_RELOC_ARM_THUMB_BF19
2114 and R_ARM_THM_BF18 together.
2115 (elf32_arm_final_link_relocate): New switch case for R_ARM_THM_BF19.
2116
2117 2019-04-15 Sudakshina Das <sudi.das@arm.com>
2118
2119 * reloc.c (BFD_RELOC_ARM_THUMB_BF17): New enum.
2120 * bfd-in2.h: Regenerated.
2121 * libbfd.h: Regenerated.
2122 * bfd-elf32-arm.c (elf32_arm_howto_table_1): New entry for R_ARM_THM_BF16.
2123 (elf32_arm_reloc_map elf32_arm_reloc_map): Map BFD_RELOC_ARM_THUMB_BF17
2124 and R_ARM_THM_BF16 together.
2125 (get_value_helper): New reloc helper.
2126 (elf32_arm_final_link_relocate): New switch case for R_ARM_THM_BF16.
2127
2128 2019-04-15 Sudakshina Das <sudi.das@arm.com>
2129
2130 * reloc.c (BFD_RELOC_THUMB_PCREL_BRANCH5): New enum.
2131 * bfd-in2.h: Regenerate.
2132 * libbfd.h: Regenerate.
2133
2134 2019-04-15 Thomas Preud'homme <thomas.preudhomme@arm.com>
2135
2136 * archures.c (bfd_mach_arm_8_1M_MAIN): Define.
2137 * bfd-in2.h: Regenerate.
2138 * cpu-arm.c (arch_info_struct): Add entry for Armv8.1-M Mainline.
2139 * elf32-arm.c (using_thumb_only): Return true for Armv8.1-M Mainline
2140 and update assert.
2141 (using_thumb2): Likewise.
2142 (using_thumb2_bl): Update assert.
2143 (arch_has_arm_nop): Likewise.
2144 (bfd_arm_get_mach_from_attributes): Add case for Armv8.1-M Mainline.
2145 (tag_cpu_arch_combine): Add logic for Armv8.1-M Mainline merging.
2146
2147 2019-04-11 H.J. Lu <hongjiu.lu@intel.com>
2148
2149 * elf-linker-x86.h (elf_x86_cet_report): New.
2150 (elf_linker_x86_params): Add cet_report.
2151 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
2152 missing IBT and SHSTK properties if needed.
2153
2154 2019-04-11 H.J. Lu <hongjiu.lu@intel.com>
2155
2156 PR ld/24436
2157 * elf-m10300.c (mn10300_elf_check_relocs): Remove BFD_ASSERT of
2158 "h != NULL". Don't check "h != NULL" before calling.
2159 bfd_elf_gc_record_vtentry.
2160 * elf32-arm.c (elf32_arm_check_relocs): Likewise.
2161 * elf32-bfin.c (bfin_check_relocs): Likewise.
2162 * elf32-cris.c (cris_elf_check_relocs): Likewise.
2163 * elf32-csky.c (csky_elf_check_relocs): Likewise.
2164 * elf32-d10v.c (elf32_d10v_check_relocs): Likewise.
2165 * elf32-dlx.c (elf32_dlx_check_relocs): Likewise.
2166 * elf32-fr30.c (fr30_elf_check_relocs): Likewise.
2167 * elf32-frv.c (elf32_frv_check_relocs): Likewise.
2168 * elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
2169 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2170 * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise.
2171 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
2172 * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise.
2173 * elf32-m68k.c (elf_m68k_check_relocs): Likewise.
2174 * elf32-mcore.c (mcore_elf_check_relocs): Likewise.
2175 * elf32-metag.c (elf_metag_check_relocs): Likewise.
2176 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
2177 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
2178 * elf32-s390.c (elf_s390_check_relocs): Likewise.
2179 * elf32-sh.c (sh_elf_check_relocs): Likewise.
2180 * elf32-v850.c (v850_elf_check_relocs): Likewise.
2181 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2182 * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise.
2183 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2184 * elf64-mmix.c (mmix_elf_check_relocs): Likewise.
2185 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
2186 * elf64-s390.c (elf_s390_check_relocs): Likewise.
2187 * elf64-x86-64.c (elf_s390_check_relocs): Likewise.
2188 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2189 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
2190 * elflink.c (bfd_elf_gc_record_vtinherit): Check for corrupt
2191 VTENTRY entry.
2192
2193 2019-04-11 Alan Modra <amodra@gmail.com>
2194
2195 PR 24435
2196 * elflink.c (elf_link_add_object_symbols): Don't read partial
2197 dynamic entries from fuzzed objects.
2198
2199 2019-04-11 Tamar Christina <tamar.christina@arm.com>
2200
2201 PR ld/24302
2202 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Don't emit
2203 DT_TLSDESC_GOT and DT_TLSDESC_PLT when DF_BIND_NOW.
2204 (elfNN_aarch64_finish_dynamic_sections): Don't write PLT if DF_BIND_NOW.
2205
2206 2019-04-10 Michael Forney <mforney@mforney.org>
2207
2208 PR 24427
2209 * doc/chew.c (free_words): Correctly free "push_text" strings.
2210
2211 2019-04-08 H.J. Lu <hongjiu.lu@intel.com>
2212
2213 * config.bfd: Remove i[3-7]86-*-kaos* and i[3-7]86-*-chaos targets.
2214
2215 2019-04-08 Alan Modra <amodra@gmail.com>
2216
2217 * configure.ac (elfxx_x86): Define and use.
2218 * configure: Regenerate.
2219
2220 2019-04-06 H.J. Lu <hongjiu.lu@intel.com>
2221
2222 * elf-linker-x86.h: New file.
2223 * elf32-i386.c (elf_i386_convert_load_reloc): Use htab->params
2224 to get x86-specific linker options.
2225 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
2226 (elf_x86_64_check_relocs): Likewise.
2227 (elf_x86_64_relocate_section): Likewise.
2228 (elf_x86_64_link_setup_gnu_properties): Likewise.
2229 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Likewise.
2230 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
2231 (_bfd_elf_linker_x86_set_options): New function.
2232 * elfxx-x86.h: Include "elf-linker-x86.h".
2233 (elf_x86_link_hash_table): Add params.
2234
2235 2019-04-03 Alan Modra <amodra@gmail.com>
2236
2237 * coff-i386.c, * coff-x86_64.c, * coffgen.c, * dwarf2.c,
2238 * elf-m10200.c, * elf.c, * elf32-arm.c, * elf32-bfin.c,
2239 * elf32-csky.c, * elf32-m32r.c, * elf32-microblaze.c, * elf32-pru.c,
2240 * elf32-rx.c, * elf32-xgate.c, * elf64-sparc.c, * elfnn-ia64.c,
2241 * elfxx-riscv.c, * elfxx-sparc.c, * linker.c, * mach-o.c,
2242 * pe-x86_64.c, * pei-x86_64.c, * plugin.c: Whitespace fixes.
2243
2244 2019-04-02 Jim Wilson <jimw@sifive.com>
2245
2246 PR 24389
2247 * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Move read of
2248 ELF header flags to after check for ELF object file. Loop through
2249 sections looking for code sections, if none, then skip ABI checks.
2250
2251 2019-03-30 Andrew Waterman <andrew@sifive.com>
2252
2253 * elfnn-riscv.c (_bfd_riscv_relax_call): Only check ARCH_SIZE for
2254 rd == X_RA case.
2255
2256 2019-03-29 Max Filippov <jcmvbkbc@gmail.com>
2257
2258 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Add
2259 info->export_dynamic to the conditional.
2260
2261 2019-03-28 Alan Modra <amodra@gmail.com>
2262
2263 PR 24392
2264 * configure.ac: Invoke AC_CHECK_SIZEOF(int).
2265 * configure: Regenerate.
2266 * coffgen.c (coff_get_reloc_upper_bound): Replace gcc diagnostic
2267 workaround with SIZEOF_LONG vs. SIZEOF_INT check.
2268 * elf.c (_bfd_elf_get_reloc_upper_bound): Likewise.
2269 * elf64-sparc.c (elf64_sparc_get_reloc_upper_bound): Likewise.
2270 * mach-o.c (bfd_mach_o_get_reloc_upper_bound): Likewise.
2271
2272 2019-03-21 Jim Wilson <jimw@sifive.com>
2273
2274 PR 24365
2275 * elfnn-riscv.c (riscv_elf_relocate_section): For STT_SECTION check,
2276 verify sym non-NULL before using. Add identical check using h.
2277
2278 2019-03-21 Sudakshina Das <sudi.das@arm.com>
2279
2280 * elf-bfd.h (struct elf_backend_data): Add argument to
2281 merge_gnu_properties.
2282 * elf-properties.c (elf_merge_gnu_properties): Add argument to
2283 itself and while calling bed->merge_gnu_properties.
2284 (elf_merge_gnu_property_list): Update the calls for
2285 elf_merge_gnu_properties.
2286 * elfnn-aarch64.c (elfNN_aarch64_merge_gnu_properties): Update handling
2287 of --force-bti warning and add argument.
2288 * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Add
2289 warning.
2290 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Add argument.
2291 * elfxx-x86.h (_bfd_x86_elf_merge_gnu_properties): Likewise in
2292 declaration.
2293
2294 2019-03-20 Sudakshina Das <sudi.das@arm.com>
2295
2296 * elfxx-aarch64.c (_bfd_aarch64_elf_link_fixup_gnu_properties): Define.
2297 * elfxx-aarch64.h (_bfd_aarch64_elf_link_fixup_gnu_properties): Declare.
2298 (elf_backend_fixup_gnu_properties): Define for AArch64.
2299
2300 2019-03-18 Alan Modra <amodra@gmail.com>
2301
2302 PR 24355
2303 * elf32-ppc.c (ppc_finish_symbols): Don't call write_glink_stub
2304 for local iplt syms with ent->plt.offset == -1. Remove ineffective
2305 attempt at writing glink stubs only once.
2306
2307 2019-03-16 Alan Modra <amodra@gmail.com>
2308
2309 PR 24337
2310 * elf.c (_bfd_elf_rela_local_sym): Revert last change.
2311 (_bfd_elf_rel_local_sym): Likewise.
2312 * elflink.c (elf_link_input_bfd): Use bfd_und_section for
2313 section of symbols with unrecognized shndx.
2314
2315 2019-03-15 H.J. Lu <hongjiu.lu@intel.com>
2316
2317 PR ld/24267
2318 * coffgen.c (_bfd_coff_section_already_linked): Skip discarded
2319 section.
2320 * cofflink.c (coff_link_add_symbols): Check for symbols defined
2321 in discarded section.
2322
2323 2019-03-15 Alan Modra <amodra@gmail.com>
2324
2325 PR 24339
2326 * elflink.c (elf_link_add_object_symbols): Bail out on a local
2327 symbol after globals if elf_bad_symtab is not set.
2328
2329 2019-03-15 Alan Modra <amodra@gmail.com>
2330
2331 PR 24337
2332 * elf.c (_bfd_elf_rela_local_sym): Don't segfault on NULL sec.
2333 (_bfd_elf_rel_local_sym): Likewise.
2334
2335 2019-03-15 Alan Modra <amodra@gmail.com>
2336
2337 PR 24336
2338 * elflink.c (elf_link_read_relocs_from_section): Handle fuzzed
2339 object files with sh_size not a multiple of sh_entsize.
2340
2341 2019-03-15 H.J. Lu <hongjiu.lu@intel.com>
2342
2343 PR ld/24338
2344 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for corrupt
2345 input with bad relocation.
2346
2347 22019-03-15 H.J. Lu <hongjiu.lu@intel.com>
2348
2349 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2350
2351 2019-03-14 Nick Clifton <nickc@redhat.com>
2352
2353 PR 24334
2354 * dwarf2.c (struct dwarf2_debug): Add sec_vma_count field.
2355 (save_section_vma): Initialise field to the number of entries in
2356 the sec_vma table.
2357 (section_vma_same): Check that the number of entries in the
2358 sec_vma table matches the number of sections in the bfd.
2359
2360 2019-03-14 Nick Clifton <nickc@redhat.com>
2361
2362 PR 24333
2363 * elflink.c (_bfd_elf_add_default_symbol): Add a check for a NULL
2364 section owner pointer when adding the default symbol.
2365
2366 2019-03-14 Nick Clifton <nickc@redhat.com>
2367
2368 PR 24332
2369 * elflink.c (elf_link_add_object_symbols): Add new local variable
2370 extversym_end. Initialise it to point to the end of the version
2371 symbol table, if present. Check it when initialising and updating
2372 the ever pointer.
2373
2374 2019-03-13 Sudakshina Das <sudi.das@arm.com>
2375
2376 * elfnn-aarch64.c (PLT_PAC_ENTRY_SIZE, PLT_PAC_SMALL_ENTRY_SIZE): New.
2377 (PLT_BTI_PAC_ENTRY_SIZE, PLT_BTI_PAC_SMALL_ENTRY_SIZE): New.
2378 (setup_plt_values): Account for PAC or PAC and BTI enabled PLTs.
2379 (elfNN_aarch64_size_dynamic_sections): Add checks for PLT_BTI_PAC
2380 and PLT_PAC_PLT.
2381 (elfNN_aarch64_finish_dynamic_sections): Account for PLT_BTI_PAC.
2382 (get_plt_type): Add case for DT_AARCH64_PAC_PLT.
2383 (elfNN_aarch64_plt_sym_val): Add cases for PLT_BTI_PAC and PLT_PAC.
2384
2385 2019-03-13 Sudakshina Das <sudi.das@arm.com>
2386 Szabolcs Nagy <szabolcs.nagy@arm.com>
2387
2388 * bfd-in.h (aarch64_plt_type, aarch64_enable_bti_type): New.
2389 (aarch64_bti_pac_info): New.
2390 (bfd_elf64_aarch64_set_options): Add aarch64_bti_pac_info argument.
2391 (bfd_elf32_aarch64_set_options): Likewise.
2392 * bfd-in2.h: Regenerate
2393 * elfnn-aarch64.c (PLT_BTI_ENTRY_SIZE): New.
2394 (PLT_BTI_SMALL_ENTRY_SIZE, PLT_BTI_TLSDESC_ENTRY_SIZE): New.
2395 (elfNN_aarch64_small_plt0_bti_entry): New.
2396 (elfNN_aarch64_small_plt_bti_entry): New.
2397 (elfNN_aarch64_tlsdesc_small_plt_bti_entry): New.
2398 (elf_aarch64_obj_tdata): Add no_bti_warn and plt_type fields.
2399 (elf_aarch64_link_hash_table): Add plt0_entry, plt_entry and
2400 tlsdesc_plt_entry_size fields.
2401 (elfNN_aarch64_link_hash_table_create): Initialise the new fields.
2402 (setup_plt_values): New helper function.
2403 (bfd_elfNN_aarch64_set_options): Use new bp_info to set plt sizes and
2404 bti enable type.
2405 (elfNN_aarch64_allocate_dynrelocs): Use new size members instead of
2406 fixed macros.
2407 (elfNN_aarch64_size_dynamic_sections): Likewise and add checks.
2408 (elfNN_aarch64_create_small_pltn_entry): Use new generic pointers
2409 to plt stubs instead of fixed ones and update filling them according
2410 to the need for bti.
2411 (elfNN_aarch64_init_small_plt0_entry): Likewise.
2412 (elfNN_aarch64_finish_dynamic_sections): Likewise.
2413 (get_plt_type, elfNN_aarch64_get_synthetic_symtab): New.
2414 (elfNN_aarch64_plt_sym_val): Update size accordingly.
2415 (elfNN_aarch64_link_setup_gnu_properties): Set up plts if BTI GNU NOTE
2416 is set.
2417 (bfd_elfNN_get_synthetic_symtab): Define.
2418 (elfNN_aarch64_merge_gnu_properties): Give out warning with --force-bti
2419 and mising BTI NOTE SECTION.
2420
2421
2422 2019-03-13 Sudakshina Das <sudi.das@arm.com>
2423
2424 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Exclude
2425 linker created inputs from merge.
2426 * elfnn-aarch64.c (struct elf_aarch64_obj_tdata): Add field for
2427 GNU_PROPERTY_AARCH64_FEATURE_1_AND properties.
2428 (elfNN_aarch64_link_setup_gnu_properties): New.
2429 (elfNN_aarch64_merge_gnu_properties): New.
2430 (elf_backend_setup_gnu_properties): Define for AArch64.
2431 (elf_backend_merge_gnu_properties): Likewise.
2432 * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Define.
2433 (_bfd_aarch64_elf_parse_gnu_properties): Define.
2434 (_bfd_aarch64_elf_merge_gnu_properties): Define.
2435 * elfxx-aarch64.h (_bfd_aarch64_elf_link_setup_gnu_properties): Declare.
2436 (_bfd_aarch64_elf_parse_gnu_properties): Declare.
2437 (_bfd_aarch64_elf_merge_gnu_properties): Declare.
2438 (elf_backend_parse_gnu_properties): Define for AArch64.
2439
2440 2019-03-13 H.J. Lu <hongjiu.lu@intel.com>
2441
2442 PR ld/24322
2443 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Properly
2444 merge GNU_PROPERTY_X86_FEATURE_1_[IBT|SHSTK].
2445
2446 2019-03-12 Alan Modra <amodra@gmail.com>
2447
2448 * coffcode.h (buy_and_read): Delete unnecessary forward decl. Add
2449 nmemb parameter. Use bfd_alloc2.
2450 (coff_slurp_line_table): Use bfd_alloc2. Update buy_and_read calls.
2451 Delete assertion.
2452 (coff_slurp_symbol_table): Use bfd_alloc2 and bfd_zalloc2.
2453 (coff_slurp_reloc_table): Use bfd_alloc2. Update buy_and_read calls.
2454 * coffgen.c (coff_get_reloc_upper_bound): Ensure size calculation
2455 doesn't overflow.
2456 * elf.c (bfd_section_from_shdr): Use bfd_zalloc2. Style fix.
2457 (assign_section_numbers): Style fix.
2458 (swap_out_syms): Use bfd_malloc2.
2459 (_bfd_elf_get_reloc_upper_bound): Ensure size calculation doesn't
2460 overflow.
2461 (_bfd_elf_make_empty_symbol): Style fix.
2462 (elfobj_grok_stapsdt_note_1): Formatting.
2463 * elfcode.h (elf_object_p): Use bfd_alloc2.
2464 (elf_write_relocs, elf_write_shdrs_and_ehdr): Likewise.
2465 (elf_slurp_symbol_table): Use bfd_zalloc2.
2466 (elf_slurp_reloc_table): Use bfd_alloc2.
2467 (_bfd_elf_bfd_from_remote_memory): Use bfd_malloc2.
2468 * elf64-sparc (elf64_sparc_get_reloc_upper_bound): Ensure
2469 size calculation doesn't overflow.
2470 (elf64_sparc_get_dynamic_reloc_upper_bound): Likewise.
2471 * mach-o.c (bfd_mach_o_get_reloc_upper_bound): Likewise.
2472 * pdp11.c (get_reloc_upper_bound): Copy aoutx.h version.
2473
2474 2019-03-08 Alan Modra <amodra@gmail.com>
2475
2476 PR 24311
2477 * merge.c (merge_strings): Return secinfo. Don't pad section
2478 to alignment here.
2479 (_bfd_merge_sections): Pad section to alignment here, if input
2480 sections contributing to merged output all pad to alignment.
2481 Formatting.
2482
2483 2019-03-06 Nick Clifton <nickc@redhat.com>
2484
2485 * dwarf2.c (_bfd_dwarf2_find_symbol_bias): Check for a NULL symbol
2486 table pointer.
2487 * coffgen.c (coff_find_nearest_line_with_names): Do not call
2488 _bfd_dwarf2_find_symbol_bias if there is no symbol table available.
2489
2490 2019-03-01 Andreas Krebbel <krebbel@linux.ibm.com>
2491
2492 This reverts commit 5a12586d44fa8d5dfc74cbca4f2f36a273a16335.
2493 2019-01-14 Maamoun Tarsha <maamountk@hotmail.com>
2494
2495 PR 20113
2496 * elf32-s390.c (allocate_dynrelocs): Update comment.
2497
2498 2019-02-28 Tamar Christina <tamar.christina@arm.com>
2499
2500 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Correct CIE parse.
2501
2502 2019-02-28 Nick Clifton <nickc@redhat.com>
2503
2504 PR 24273
2505 * elf.c (bfd_elf_string_from_elf_section): Check for a string
2506 section that is not NUL terminated.
2507
2508 2019-02-27 H.J. Lu <hongjiu.lu@intel.com>
2509
2510 PR ld/24276
2511 * elf64-x86-64.c (elf_x86_64_check_relocs): Skip symbol defined
2512 by linker when checking copy reloc on protected symbol.
2513
2514 2019-02-24 Alan Modra <amodra@gmail.com>
2515
2516 PR 24144
2517 * pdp11.c (set_section_contents): Revert 2015-02-24 change.
2518
2519 2019-02-20 Eric Tsai <erictsai@cadence.com>
2520
2521 * elf32-xtensa.c (is_resolvable_asm_expansion): Scan output
2522 sections between the call site and call destination and adjust
2523 call distance by the largest alignment.
2524
2525 2019-02-20 Alan Hayward <alan.hayward@arm.com>
2526
2527 * elf-bfd.h (elfcore_write_aarch_pauth): Add declaration.
2528 * elf.c (elfcore_grok_aarch_pauth): New function.
2529 (elfcore_grok_note): Check for NT_ARM_PAC_MASK.
2530 (elfcore_write_aarch_pauth): New function.
2531 (elfcore_write_register_note): Check for AArch64 pauth section.
2532
2533 2019-02-20 Alan Modra <amodra@gmail.com>
2534
2535 PR 24225
2536 * elf32-nios2.c (nios2_elf32_relocate_section): Check asprintf
2537 return value.
2538
2539 2019-02-20 Michael Roitzsch <reactorcontrol@icloud.com>
2540
2541 * configure.ac (SHARED_LIBADD): Add -liberty -lintl for all
2542 Darwin hosts, not just or1k.
2543 * configure: Regenerate.
2544
2545 2019-02-20 Alan Modra <amodra@gmail.com>
2546
2547 PR 24236
2548 * archive64.c (_bfd_archive_64_bit_slurp_armap): Move code adding
2549 sentinel NUL to string buffer nearer to loop where it is used.
2550 Don't go past sentinel when scanning strings, and don't write
2551 NUL again.
2552 * archive.c (do_slurp_coff_armap): Simplify string handling to
2553 archive64.c style.
2554
2555 2019-02-19 Alan Modra <amodra@gmail.com>
2556
2557 PR 24235
2558 * pei-x86_64.c (pex64_bfd_print_pdata_section): Correct checks
2559 attempting to prevent read past end of section.
2560
2561 2019-02-18 Alan Modra <amodra@gmail.com>
2562
2563 PR 24225
2564 * elf32-nios2.c (nios2_elf32_relocate_section): Use asprintf and
2565 PRIx64 to generate warning messages. Print local sym names too.
2566
2567 2019-02-09 Vineet Gupta <vgupta@synopsys.com>
2568
2569 * elf32-arc (INIT_SYM_STRING): Delete.
2570 (FINI_SYM_STRING): Likewise.
2571 (init_str): Likewise.
2572 (fini_str): Likewise.
2573
2574 2019-02-08 Alan Modra <amodra@gmail.com>
2575
2576 * elf32-ppc.c (ppc_elf_relocate_section): Add %X to "unsupported
2577 for bss-plt" warning to make it an error.
2578
2579 2019-02-07 Eric Botcazou <ebotcazou@adacore.com>
2580
2581 PR ld/18841
2582 * elf32-sparc.c (elf32_sparc_reloc_type_class): Return
2583 reloc_class_ifunc for ifunc symbols.
2584 * elf64-sparc.c (elf64_sparc_reloc_type_class): Likewise.
2585
2586 2019-02-07 Eric Botcazou <ebotcazou@adacore.com>
2587
2588 * elf32-visium.c (visium_elf_howto_parity_reloc): Minor tweak.
2589 <R_VISIUM_PC16>: Use explicit range test to detect an overflow.
2590
2591 2019-02-07 Nick Clifton <nickc@redhat.com>
2592
2593 * config.bfd: Move the powerpc-lynxos and powerpc-windiss targets
2594 into the definitely obsolete list.
2595
2596 2019-02-05 H.J. Lu <hongjiu.lu@intel.com>
2597
2598 PR ld/24151
2599 * elf64-x86-64.c (elf_x86_64_need_pic): Check
2600 SYMBOL_DEFINED_NON_SHARED_P instead of def_regular.
2601 (elf_x86_64_relocate_section): Move PIC check for PC-relative
2602 relocations to ...
2603 (elf_x86_64_check_relocs): Here.
2604 (elf_x86_64_finish_dynamic_symbol): Use SYMBOL_DEFINED_NON_SHARED_P
2605 to check if a symbol is defined in a non-shared object.
2606 * elfxx-x86.h (SYMBOL_DEFINED_NON_SHARED_P): New.
2607
2608 2019-01-21 Sergio Durigan Junior <sergiodj@redhat.com>
2609
2610 * elf32-arm.c (elf32_arm_final_link_relocate): Use 'llabs' instead
2611 of 'labs' (and fix GCC warning).
2612
2613 2019-01-25 Nick Clifton <nickc@redhat.com>
2614
2615 * po/ru.po: Updated Russian translation.
2616
2617 2019-01-23 Nick Clifton <nickc@redhat.com>
2618
2619 * po/fr.po: Updated French translation.
2620
2621 2019-01-21 Nick Clifton <nickc@redhat.com>
2622
2623 * po/pt.po: Updated Portuguese translation.
2624 * po/uk.po: Updated Ukranian translation.
2625
2626 2019-01-21 Yuri Chornoivan <yurchor@ukr.net>
2627
2628 PR 24108
2629 * elf32-nds32.c (nds32_relocate_section): Add space between words
2630 in error message.
2631 * elfnn-riscv.c (riscv_version_mismatch): Fix spelling mistake in
2632 error message.
2633 (riscv_i_or_e_p): Likewise.
2634 (riscv_merge_arch_attr_info): Likewise.
2635
2636 2019-01-19 Nick Clifton <nickc@redhat.com>
2637
2638 * version.m4: Reset to 2.32.51
2639 * configure: Regenerate.
2640 * po/bfd.pot: Regenerate.
2641
2642 2018-06-24 Nick Clifton <nickc@redhat.com>
2643
2644 2.32 branch created.
2645
2646 2019-01-16 Kito Cheng <kito@andestech.com>
2647
2648 * elf-attrs.c (vendor_obj_attr_size): Return 0 if size is 0 even
2649 for OBJ_ATTR_PROC.
2650
2651 2019-01-16 Kito Cheng <kito@andestech.com>
2652 Nelson Chu <nelson@andestech.com>
2653
2654 * elfnn-riscv.c (in_subsets): New.
2655 (out_subsets): Likewise.
2656 (merged_subsets): Likewise.
2657 (riscv_std_ext_p): Likewise.
2658 (riscv_non_std_ext_p): Likewise.
2659 (riscv_std_sv_ext_p): Likewise.
2660 (riscv_non_std_sv_ext_p): Likewise.
2661 (riscv_version_mismatch): Likewise.
2662 (riscv_i_or_e_p): Likewise.
2663 (riscv_merge_std_ext): Likewise.
2664 (riscv_merge_non_std_and_sv_ext): Likewise.
2665 (riscv_merge_arch_attr_info): Likewise.
2666 (riscv_merge_attributes): Likewise.
2667 (_bfd_riscv_elf_merge_private_bfd_data): Merge attribute.
2668
2669 * elfnn-riscv.c (riscv_elf_obj_attrs_arg_type): New.
2670 (elf_backend_obj_attrs_vendor): Define.
2671 (elf_backend_obj_attrs_section_type): Likewise.
2672 (elf_backend_obj_attrs_section): Likewise.
2673 (elf_backend_obj_attrs_arg_type): Define as
2674 riscv_elf_obj_attrs_arg_type.
2675 * elfxx-riscv.c (riscv_estimate_digit): New.
2676 (riscv_estimate_arch_strlen1): Likewise.
2677 (riscv_estimate_arch_strlen): Likewise.
2678 (riscv_arch_str1): Likewise.
2679 (riscv_arch_str): Likewise.
2680 * elfxx-riscv.h (riscv_arch_str): Declare.
2681
2682 2019-01-14 John Darrington <john@darrington.wattle.id.au>
2683
2684 * bfd-in2.h [BFD_RELOC_S12Z_OPR]: New reloc.
2685 * libbfd.h: regen.
2686 * elf32-s12z.c (eld_s12z_howto_table): R_S12Z_OPR takes non zero
2687 source field. (md_apply_fix): Apply final fix
2688 to BFD_RELOC_S12Z_OPR.
2689 * reloc.c[BFD_RELOC_S12Z_OPR]: New reloc.
2690
2691 2019-01-14 Maamoun Tarsha <maamountk@hotmail.com>
2692
2693 PR 20113
2694 * elf32-s390.c (allocate_dynrelocs): Update comment.
2695
2696 2019-01-09 Andrew Paprocki <andrew@ishiboo.com>
2697
2698 * warning.m4: Adjust egrep pattern for non-GNU compilers.
2699 * configure: Regenerate.
2700
2701 2019-01-08 Alan Modra <amodra@gmail.com>
2702
2703 PR 23699
2704 PR 24065
2705 * ihex.c (ihex_write_object_contents): Properly check 32-bit
2706 address range.
2707
2708 2019-01-05 Yoshinori Sato <ysato@users.sourceforge.jp>
2709
2710 * bfd/archures.c: Add bfd_mach_rx_v2 and bfd_mach_rx_v3.
2711 * bfd/bfd-in2.h: Regenerate.
2712 * bfd/cpu-rx.c (arch_info_struct): Add RXv2 and RXv3 entry.
2713 * bfd/elf32-rx.c (elf32_rx_machine): Add RXv2 and RXv3 support.
2714
2715 2019-01-04 Lifang Xia <lifang_xia@c-sky.com>
2716
2717 * config.bfd (csky-*-elf* | csky-*-linux*): Modify the csky
2718 default target, little endian target is more suitable.
2719
2720 2019-01-04 Alan Modra <amodra@gmail.com>
2721
2722 PR 24061
2723 PR 21786
2724 * coff-rs6000.c (GET_VALUE_IN_FIELD): Add base parameter and
2725 adjust all callers.
2726 (EQ_VALUE_IN_FIELD): Likewise.
2727 * coff64-rs6000.c (GET_VALUE_IN_FIELD): Likewise.
2728
2729 2019-01-01 Alan Modra <amodra@gmail.com>
2730
2731 Update year range in copyright notice of all files.
2732
2733 For older changes see ChangeLog-2018
2734 \f
2735 Copyright (C) 2019 Free Software Foundation, Inc.
2736
2737 Copying and distribution of this file, with or without modification,
2738 are permitted in any medium without royalty provided the copyright
2739 notice and this notice are preserved.
2740
2741 Local Variables:
2742 mode: change-log
2743 left-margin: 8
2744 fill-column: 74
2745 version-control: never
2746 End:
This page took 0.085921 seconds and 4 git commands to generate.