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