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