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