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