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