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