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