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