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