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