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