1 2017-11-04 Alan Modra <amodra@gmail.com>
3 * elf32-ppc.c (readonly_dynrelocs): Delete info param. Update all
4 callers. Don't bother with SEC_ALLOC test. Return section pointer.
6 (maybe_set_textrel): ..here.
7 * elf64-ppc.c (readonly_dynrelocs): Return section pointer.
8 (maybe_set_textrel): Call minfo to print textrel warning to map file.
10 2017-11-04 Alan Modra <amodra@gmail.com>
12 * elf32-hppa.c (enum _tls_type): Move.
13 (struct elf32_hppa_link_hash_entry): Make tls_type a bitfield.
14 (elf32_hppa_check_relocs): Set DF_STATIC_TLS only for shared libraries.
15 Tidy tls_type handling. Set symbol tls_type for GOT_TLS_LDM too.
16 (got_entries_needed, got_relocs_needed): New functions.
17 (allocate_dynrelocs): Use them.
18 (elf32_hppa_size_dynamic_sections): Likewise.
19 (elf32_hppa_relocate_section): Delete bogus FIXME. Formatting.
20 Correct code emitting relocs on GD/IE got entries. Report an
21 error when a symbol has both normal and TLS GOT relocs.
23 2017-11-04 Alan Modra <amodra@gmail.com>
26 * elf32-hppa.c (elf32_hppa_check_relocs): Don't create dyn_relocs
27 for plabels when non-pic.
28 (maybe_set_textrel): New function.
29 (readonly_dynrelocs): Move and rewrite.
30 (elf32_hppa_adjust_dynamic_symbol): Use it. Don't create copy
31 relocs when def_regular or -z nocopyreloc. Handle non_got_ref
32 for functions. Expand non_got_ref comments.
33 (elf32_hppa_size_dynamic_sections): Use maybe_set_textrel.
35 2017-11-03 H.J. Lu <hongjiu.lu@intel.com>
37 * elf32-i386.c (elf_i386_check_relocs): Set plt.refcount to 1.
38 Don't use func_pointer_refcount. Don't set plt.refcount nor
39 non_got_ref for function pointer reference.
40 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
41 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't use
42 func_pointer_refcount.
43 (_bfd_x86_elf_copy_indirect_symbol): Don't copy
44 func_pointer_refcount.
45 (_bfd_x86_elf_hide_symbol): Don't use func_pointer_refcount.
46 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Likewise.
47 (elf_x86_link_hash_entry): Remove func_pointer_refcount.
49 2017-11-03 Mingi Cho <mgcho.minic@gmail.com>
50 Nick Clifton <nickc@redhat.com>
53 * coffgen.c (_bfd_coff_get_external_symbols): Check for an
54 overlarge raw syment count.
55 (coff_get_normalized_symtab): Likewise.
57 2017-11-01 James Bowman <james.bowman@ftdichip.com>
59 * archures.c: Add bfd_mach_ft32b.
60 * cpu-ft32.c: Add arch_info_struct.
61 * elf32-ft32.c: Add R_FT32_RELAX, SC0, SC1,
63 (ft32_elf_relocate_section): Add clauses for R_FT32_SC0, SC1,
65 (ft32_reloc_shortable, elf32_ft32_is_diff_reloc)
66 (elf32_ft32_adjust_diff_reloc_value)
67 (elf32_ft32_adjust_reloc_if_spans_insn)
68 (elf32_ft32_relax_delete_bytes, elf32_ft32_relax_is_branch_target)
69 (ft32_elf_relax_section): New function.
70 * reloc.c: Add BFD_RELOC_FT32_RELAX, SC0, SC1, DIFF32.
71 * bfd-in2.h: Regenerate.
72 * libbfd.h: Regenerate.
74 2017-11-01 Nick Clifton <nickc@redhat.com>
77 * coffcode.h (coff_slurp_line_table): Check for an excessively
78 large line number count.
80 2017-11-01 Nick Clifton <nickc@redhat.com>
83 * peicode.h (pe_bfd_read_buildid): Revise check for invalid size
84 and offset in light of further possible bogus values.
86 2017-11-01 Alan Modra <amodra@gmail.com>
89 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't create a plt
90 entry when just a dynamic reloc can serve. Ensure no dynamic
91 relocations when UNDEFWEAK_NO_DYNAMIC_RELOC by setting non_got_ref.
92 Expand and move the non_got_ref comment.
93 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
95 2017-11-01 Nick Clifton <nickc@redhat.com>
98 * coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF
100 * cofflink.c (coff_link_check_archive_element): Skip non-COFF
101 members of an archive.
103 2017-10-31 Nick Clifton <nickc@redhat.com>
106 * peicode.h (pe_bfd_read_buildid): Check for invalid size and data
109 2017-10-30 Alan Modra <amodra@gmail.com>
111 * elf32-frv.c (ELF_TARGET_ID): Don't define for generic
114 * elflink.c (elf_gc_sweep): Test elf_object_id in addition to
116 (bfd_elf_gc_sections): Likewise.
118 2017-10-30 Alan Modra <amodra@gmail.com>
121 * elf32-hppa.c (elf32_hppa_check_relocs): Move SEC_ALLOC test to
122 ensure non_got_ref is not set due to debug references.
123 (elf32_hppa_adjust_dynamic_symbol): Tidy plabel handling. Use
124 SYMBOL_CALLS_LOCAL and UNDEFWEAK_NO_DYNAMIC_RELOC when determining
125 need for a plt entry.
126 (allocate_dynrelocs): Similarly for got entries. Tidy code discarding
127 dynamic relocs when pic. Remove bogus code attempting to handle
129 (elf32_hppa_relocate_section): Similarly. Delete resolved_to_zero
131 (elf32_hppa_finish_dynamic_symbol): Use UNDEFWEAK_NO_DYNAMIC_RELOC
132 and SYMBOL_REFERENCES_LOCAL in GOT handling.
134 2017-10-28 Alan Modra <amodra@gmail.com>
137 * elflink.c (_bfd_elf_merge_symbol): Remove relocs_compatible check.
138 * elf32-hppa.c (elf_backend_relocs_compatible): Define.
139 * elf32-ppc.c (elf_backend_relocs_compatible): Define.
140 * elf64-ppc.c (elf_backend_relocs_compatible): Define.
142 2017-10-25 Alan Modra <amodra@gmail.com>
144 * archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
145 optionally prefixed with "_".
146 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
148 2017-10-24 Andrew Waterman <andrew@sifive.com>
150 * elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
153 2017-10-24 Renlin Li <renlin.li@arm.com>
156 * elflink.c (_bfd_elf_merge_symbol): Handle multiple definition case.
158 2017-10-23 Nick Clifton <nickc@redhat.com>
161 * elflink.c (elf_link_output_extsym): Keep global undefined
162 symbols if they have been marked as needed.
164 2017-10-23 Maciej W. Rozycki <macro@imgtec.com>
166 * elfn32-mips.c (mips_elf_n32_mkobject): New prototype and
168 (bfd_elf32_mkobject): Use `mips_elf_n32_mkobject' rather than
169 `_bfd_mips_elf_mkobject'.
171 2017-10-22 Hans-Peter Nilsson <hp@axis.com>
174 * config.bfd (cris-*-* | crisv32-*-*): Require a 64-bit BFD.
176 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
178 * elfnn-riscv.c (riscv_pcgp_hi_reloc): New structure.
179 (riscv_pcgp_lo_reloc): Likewise.
180 (riscv_pcgp_relocs): Likewise.
181 (riscv_init_pcgp_relocs): New function.
182 (riscv_free_pcgp_relocs): Likewise.
183 (riscv_record_pcgp_hi_reloc): Likewise.
184 (riscv_record_pcgp_lo_reloc): Likewise.
185 (riscv_delete_pcgp_hi_reloc): Likewise.
186 (riscv_use_pcgp_hi_reloc): Likewise.
187 (riscv_record_pcgp_lo_reloc): Likewise.
188 (riscv_find_pcgp_lo_reloc): Likewise.
189 (riscv_delete_pcgp_lo_reloc): Likewise.
190 (_bfd_riscv_relax_pc): Likewise.
191 (_bfd_riscv_relax_section): Handle R_RISCV_PCREL_* relocations
192 via the new functions above.
194 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
196 * elfnn-riscv.c (R_RISCV_DELETE): New define.
197 (_bfd_riscv_relax_delete): New function.
198 (perform_relocation): Handle R_RISCV_DELETE.
199 (_bfd_riscv_relax_section): Likewise.
201 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
204 * elfxx-tilegx.c (tilegx_elf_tls_transition): Replace
205 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
206 bfd_link_executable for TLS check.
207 (tilegx_elf_check_relocs): Likewise.
208 (allocate_dynrelocs): Likewise.
209 (tilegx_elf_relocate_section): Likewise.
211 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
214 * elf32-tilepro.c (tilepro_elf_tls_transition): Replace
215 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
216 bfd_link_executable for TLS check.
217 (tilepro_elf_check_relocs): Likewise.
218 (allocate_dynrelocs): Likewise.
219 (tilepro_elf_relocate_section): Likewise.
221 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
224 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
225 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
226 bfd_link_executable for TLS check.
227 (_bfd_sparc_elf_check_relocs): Likewise.
228 (allocate_dynrelocs): Likewise.
229 (_bfd_sparc_elf_relocate_section): Likewise.
231 2017-10-18 H.J. Lu <hongjiu.lu@intel.com>
233 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
234 _bfd_generic_link_add_one_symbol to mark __tls_get_addr.
235 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
237 2017-10-17 H.J. Lu <hongjiu.lu@intel.com>
239 * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
240 indirect and warning symbols.
242 2017-10-17 Alan Modra <amodra@gmail.com>
245 * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
246 against size left rather than comparing pointers. Reorganise loop.
248 2017-10-17 Alan Modra <amodra@gmail.com>
251 * aoutx.h (aout_get_external_symbols): Handle stringsize of zero,
252 and error for any other size that doesn't cover the header word.
254 2017-10-16 H.J. Lu <hongjiu.lu@intel.com>
256 * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook.
257 * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed.
258 (elf_backend_gc_sweep_hook): Likewise.
259 * elf32-bfin.c (bfin_gc_sweep_hook): Likewise.
260 (bfinfdpic_gc_sweep_hook): Likewise.
261 (elf_backend_gc_sweep_hook): Likewise.
262 * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise.
263 (elf_backend_gc_sweep_hook): Likewise.
264 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
265 (elf_backend_gc_sweep_hook): Likewise.
266 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
267 (elf_backend_gc_sweep_hook): Likewise.
268 * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise.
269 (elf_backend_gc_sweep_hook): Likewise.
270 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
271 (elf_backend_gc_sweep_hook): Likewise.
272 * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook
274 (elf_m68k_remove_got_entry_type): Removed.
275 (elf_m68k_find_got_entry_ptr): Likewise.
276 (elf_m68k_remove_got_entry): Likewise.
277 (elf_m68k_gc_sweep_hook): Likewise.
278 (elf_backend_gc_sweep_hook): Likewise.
279 * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise.
280 (elf_backend_gc_sweep_hook): Likewise.
281 * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise.
282 (elf_backend_gc_sweep_hook): Likewise.
283 * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise.
284 (elf_backend_gc_sweep_hook): Likewise.
285 * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise.
286 (elf_backend_gc_sweep_hook): Likewise.
287 * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise.
288 (elf_backend_gc_sweep_hook): Likewise.
289 * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise.
290 (elf_backend_gc_sweep_hook): Likewise.
291 * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise.
292 (elf_backend_gc_sweep_hook): Likewise.
293 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
294 (elf_backend_gc_sweep_hook): Likewise.
295 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
296 (elf_backend_gc_sweep_hook): Likewise.
297 * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise.
298 * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise.
299 (elf_backend_gc_sweep_hook): Likewise.
300 * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
301 * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise.
302 (elf_backend_gc_sweep_hook): Likewise.
303 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
304 (elf_backend_gc_sweep_hook): Likewise.
305 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
306 (elf_backend_gc_sweep_hook): Likewise.
307 * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise.
308 (elf_backend_gc_sweep_hook): Likewise.
309 * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise.
310 * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise.
311 (elf_backend_gc_sweep_hook): Likewise.
312 * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise.
313 (ppc64_elf_gc_sweep_hook): Likewise.
314 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
315 (elf_backend_gc_sweep_hook): Likewise.
316 * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise.
317 * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
318 * elflink.c (elf_link_add_object_symbols): Don't call
319 _bfd_elf_link_check_relocs here.
320 (gc_sweep_hook_fn): Removed.
321 (elf_gc_sweep): Remove gc_sweep_hook.
322 * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed.
323 (elf_backend_gc_sweep_hook): Likewise.
324 * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise.
325 (elf_backend_gc_sweep_hook): Likewise.
326 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
327 * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise.
328 (elf_backend_gc_sweep_hook): Likewise.
329 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
330 * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise.
331 * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise.
332 (elfNN_bed): Remove elf_backend_gc_sweep_hook.
333 * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed.
334 * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise.
336 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
338 * elf32-i386.c (elf_i386_backend_data): Removed.
339 (get_elf_i386_backend_data): Likewise.
340 (elf_i386_arch_bed): Replace elf_i386_backend_data with
341 elf_x86_backend_data.
342 (elf_i386_get_synthetic_symtab): Likewise.
343 (elf_i386_nacl_arch_bed): Likewise.
344 (elf_i386_vxworks_arch_bed): Likewise.
345 (elf_i386_relocate_section): Check target_os instead of
347 (elf_i386_finish_dynamic_symbol): Likewise.
348 (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
349 Check target_os instead of is_vxworks.
350 (elf_i386_link_setup_gnu_properties): Remove normal_target and
351 is_vxworks. Initialize plt0_pad_byte.
352 * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
353 (get_elf_x86_64_arch_data): Likewise.
354 (get_elf_x86_64_backend_data): Likewise.
355 (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
356 elf_x86_backend_data.
357 (elf_x86_64_get_synthetic_symtab): Likewise.
358 (elf_x86_64_nacl_arch_bed): Likewise.
359 (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
360 normal_target. Initialize plt0_pad_byte.
361 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
362 instead of is_vxworks.
363 (_bfd_x86_elf_size_dynamic_sections): Likewise.
364 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
365 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
366 (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
367 (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
368 Update normal_target. Set up plt0_pad_byte. Check target_os
369 instead of is_vxworks.
370 * elfxx-x86.h (elf_x86_target_os): New.
371 (elf_x86_backend_data): Likewise.
372 (get_elf_x86_backend_data): Likewise.
373 (elf_x86_link_hash_table): Remove is_vxworks. Add plt0_pad_byte
375 (elf_x86_init_table): Remove normal_target and is_vxworks. Add
378 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
380 * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
381 _bfd_x86_elf_finish_dynamic_sections.
382 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
383 * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
385 * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
388 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
391 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
392 hide symbol which was forced to be dynamic.
394 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
397 * elf32-cris.c (cris_elf_relocate_section): Don't generate
398 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
399 (cris_elf_check_relocs): Don't allocate dynamic relocation
400 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
402 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
405 * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
406 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
407 (sh_elf_relocate_section): Don't generate dynamic relocation if
408 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
410 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
413 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
414 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
415 (elf_s390_relocate_section): Don't generate dynamic relocation
416 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
417 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
418 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
419 (elf_s390_relocate_section): Don't generate dynamic relocation
420 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
422 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
425 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
426 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
427 (allocate_dynrelocs): Discard dynamic relocations if
428 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
430 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
433 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
434 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
436 (allocate_dynrelocs): Discard dynamic relocations if
437 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
439 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
442 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
443 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
444 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
445 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
446 (elf_m68k_relocate_section): Don't generate dynamic relocation
447 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
449 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
452 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
453 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
454 (allocate_dynrelocs): Discard dynamic relocations if
455 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
456 (elf32_hppa_relocate_section): Don't generate dynamic
457 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
459 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
462 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
463 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
464 (allocate_fptr): Don't allocate function pointer if
465 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
466 (allocate_dynrel_entries): Don't allocate dynamic relocation
467 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
468 (set_got_entry): Don't set GOT entry if
469 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
470 (set_pltoff_entry): Don't set PLTOFF entry if
471 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
472 (elfNN_ia64_relocate_section): Don't install dynamic relocation
473 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
475 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
478 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
479 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
480 (allocate_dynrelocs): Don't allocate dynamic relocations if
481 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
483 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
486 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
487 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
488 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
489 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
491 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
494 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
495 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
496 (tilepro_elf_relocate_section): Don't generate dynamic
497 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
498 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
499 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
500 (tilegx_elf_relocate_section): Don't generate dynamic
501 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
503 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
506 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
507 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
509 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
510 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
512 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
514 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
515 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
516 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
518 2017-10-12 James Bowman <james.bowman@ftdichip.com>
520 * bfd-in2.h: Regenerate.
521 * libbfd.h: Regenerate.
522 * elf32-ft32.c: Add HOWTO R_FT32_15.
523 * reloc.c: Add BFD_RELOC_FT32_15.
525 2017-10-12 Nick Clifton <nickc@redhat.com>
527 * reloc.c (enum bfd_reloc_status): Start values at 2.
528 * bfd-in2.h: Regenerate.
529 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
530 that a TRUE return indicates success. Compare the result of
531 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
532 (build_one_stub): Change sense of tests against aarch64_relocate
534 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
535 than FALSE, when an error is detected.
536 (elfNN_aarch64_final_link_relocate): Likewise.
538 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
540 * elf32-i386.c (elf_backend_hide_symbol): New.
541 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
542 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
543 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
545 2017-10-12 Alan Modra <amodra@gmail.com>
547 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
548 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
549 (bfd_elf_define_start_stop): Likewise.
551 2017-10-12 Alan Modra <amodra@gmail.com>
553 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
554 when executable rather than non-PIC.
555 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
556 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
558 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
560 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
562 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
563 (elf_external_linux_prpsinfo64_ugid32): ... this.
564 (swap_linux_prpsinfo32_out): Rename to...
565 (swap_linux_prpsinfo32_ugid32_out): ... this.
566 (elf_external_linux_prpsinfo64_ugid16): New structure.
567 (swap_linux_prpsinfo64_ugid16_out): New function.
568 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
569 (elf_backend_linux_prpsinfo64_ugid16): Define.
570 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
571 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
572 of the 64-bit Linux core PRPSINFO note.
573 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
575 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
577 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
579 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
580 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
581 (elf_external_ppc_linux_prpsinfo32)
582 (swap_ppc_linux_prpsinfo32_out): Move to...
583 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
584 (swap_linux_prpsinfo32_ugid32_out): ... these.
585 (elf_external_linux_prpsinfo32): Rename to...
586 (elf_external_linux_prpsinfo32_ugid16): ... this.
587 (swap_linux_prpsinfo32_out): Rename to...
588 (swap_linux_prpsinfo32_ugid16_out): ... this.
589 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
590 (elf_backend_linux_prpsinfo32_ugid16): Define.
591 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
592 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
593 of the 32-bit Linux core PRPSINFO note.
594 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
595 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
596 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
597 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
598 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
599 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
600 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
601 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
602 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
603 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
605 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
607 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
608 `gap' member ahead of `pr_flag'.
610 2017-10-11 Pedro Alves <palves@redhat.com>
612 * bfd.c (_doprnt): Rename to ...
613 (_bfd_doprnt): ... this.
614 (error_handler_internal): Adjust.
616 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
618 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
619 instead of incrementing it.
620 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
622 2017-10-10 Renlin Li <renlin.li@arm.com>
625 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
626 symbols into dynamic.
628 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
631 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
632 (riscv_elf_link_hash_table_create): Initialize max_alignment to
634 (_bfd_riscv_relax_section): Cache the max alignment of output
635 sections if possible.
637 2017-10-10 Alan Modra <amodra@gmail.com>
639 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
640 .opd whenever .opd is present and non-zero size. Move code
641 setting abiversion to/from output file earlier. Only set
642 u.opd.func_sec when --gc-sections. Read relocs and set up
643 u.opd.func_sec values here..
644 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
646 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
648 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
650 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
653 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
655 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
656 .interp section with "ld --no-dynamic-linker".
658 2017-10-09 Alan Modra <amodra@gmail.com>
661 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
662 funcinfo_hash_table and varinfo_hash_table.
664 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
666 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
667 in read-only section with minfo.
668 (sh_elf_size_dynamic_sections): Likewise.
670 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
672 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
675 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
677 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
678 this_hdr.sh_entsize only if section size > 0.
680 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
682 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
684 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
686 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
687 in read-only section with minfo.
688 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
690 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
692 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
695 2017-10-06 John Baldwin <jhb@FreeBSD.org>
697 * elf-bfd.h (struct elf_backend_data): Add
698 `elf_backend_grok_freebsd_prstatus'.
699 * elf.c (elfcore_grok_freebsd_note): Call
700 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
702 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
704 (elf_backend_grok_freebsd_prstatus): Define.
705 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
706 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
708 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
710 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
711 and has_non_got_reloc with zero_undefweak.
712 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
713 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
715 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
716 has_non_got_reloc with zero_undefweak.
717 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
718 has_got_reloc and has_non_got_reloc with zero_undefweak.
719 (elf_x86_link_hash_entry): Likewise.
721 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
723 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
724 (VERIFY_COPY_RELOC): Likewise.
726 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
728 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
729 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
730 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
732 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
734 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
735 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
736 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
738 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
740 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
741 * elf32-i386.c (elf_i386_relocate_section): Use it.
742 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
744 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
746 * elf32-i386.c (X86_SIZE_TYPE_P): New.
747 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
748 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
749 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
750 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
752 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
754 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
755 (PLT_LOCAL_IFUNC_P): Likewise.
756 * elf32-i386.c (elf_i386_relocate_section): Use them.
757 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
759 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
761 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
762 * elf32-i386.c (elf_i386_relocate_section): Use it.
763 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
765 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
767 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
768 * elf32-i386.c (elf_i386_relocate_section): Use it.
769 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
771 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
773 * elf32-i386.c (X86_PCREL_TYPE_P): New.
774 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
775 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
776 (X86_PCREL_TYPE_P): This.
777 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
778 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
779 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
781 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
783 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
785 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
786 * elf32-i386.c (elf_i386_tls_transition): Use it.
787 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
789 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
791 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
792 Dump dynamic relocation in read-only section with minfo if
794 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
795 (maybe_set_textrel): Likewise.
796 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
797 read-only section with minfo.
799 2017-10-05 John Baldwin <jhb@FreeBSD.org>
801 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
803 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
805 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
806 in read-only section with minfo.
807 (tilepro_elf_size_dynamic_sections): Likewise.
808 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
809 (tilegx_elf_size_dynamic_sections): Likewise.
811 2017-10-05 Pedro Alves <palves@redhat.com>
814 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
815 ellipsis parameter. Split out bfd_error_on_input code to..
816 (bfd_set_input_error): .. New function.
817 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
818 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
819 * bfd-in2.h: Regenerate.
821 2017-10-05 Alan Modra <amodra@gmail.com>
823 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
824 fini_array error value.
826 2017-10-05 Alan Modra <amodra@gmail.com>
829 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
831 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
833 (elf_fake_sections): Adjust calls. Exit immediately on failure.
834 (bfd_elf_set_group_contents): Add associated reloc section indices
837 2017-10-04 Alan Modra <amodra@gmail.com>
839 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
840 classify symbols for ELFv2.
842 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
845 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
846 undergoes default promotion.
847 * bfd-in2.h: Regenerate.
849 2017-10-02 Alan Modra <amodra@gmail.com>
851 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
852 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
854 2017-10-01 Alan Modra <amodra@gmail.com>
857 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
858 (add_line_info): Always put end_sequence last.
860 2017-10-01 Alan Modra <amodra@gmail.com>
863 * dwarf2.c (read_section): Allocate buffer with extra byte for
864 bfd_simple_get_relocated_section_contents rather than copying
867 2017-09-29 Alan Modra <amodra@gmail.com>
869 * merge.c (merge_strings): Return FALSE on malloc failure.
870 (_bfd_merge_sections): Return failures from record_section and
873 2017-09-28 Alan Modra <amodra@gmail.com>
876 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
877 a case where plugin_notice isn't called.
879 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
881 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
884 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
887 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
888 output_bfd to info->callbacks->minfo.
890 2017-09-26 Nick Clifton <nickc@redhat.com>
893 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
894 assertion failure if elf_x86_64_rtype_to_howto has already issued
897 2017-09-26 Alan Modra <amodra@gmail.com>
900 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
903 2017-09-26 Nick Clifton <nickc@redhat.com>
906 * dwarf2.c (read_formatted_entries): Fail early if we know that
907 the loop parsing data entries will overflow the end of the
910 2017-09-26 Alan Modra <amodra@gmail.com>
913 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
914 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
915 to stash->info_ptr_memory, and check die_ref is within that memory.
916 Set info_ptr_end correctly when another CU is refd. Check die_ref
917 for DW_FORM_ref4 etc. is within CU.
919 2017-09-26 Alan Modra <amodra@gmail.com>
922 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
923 (read_formatted_entries): Init "fe".
924 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
926 2017-09-26 Alan Modra <amodra@gmail.com>
929 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
930 bounds in inner loop.
932 2017-09-25 Alan Modra <amodra@gmail.com>
935 * dwarf1.c (parse_die): Sanity check pointer against section limit
936 before dereferencing.
937 (parse_line_table): Likewise.
939 2017-09-25 Alan Modra <amodra@gmail.com>
942 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
944 (parse_comp_unit): Likewise.
946 2017-09-25 Alan Modra <amodra@gmail.com>
949 * dwarf2.c (read_formatted_entries): Error on format_count zero.
951 2017-09-24 Alan Modra <amodra@gmail.com>
954 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
955 within section bounds.
957 2017-09-24 Alan Modra <amodra@gmail.com>
960 * dwarf2.c (decode_line_info): Properly free line sequences on error.
962 2017-09-24 Alan Modra <amodra@gmail.com>
965 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
966 pname param. Return status. Make name const. Don't abort,
967 return an error. Formatting. Exit if current info_ptr matches
968 orig_info_ptr. Update callers.
969 (scan_unit_for_symbols): Start at nesting_level of zero. Make
970 nested_funcs an array of structs for extensibility. Formatting.
972 2017-09-24 Alan Modra <amodra@gmail.com>
975 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
976 rather than dividing by zero.
978 2017-09-24 Alan Modra <amodra@gmail.com>
981 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
983 2017-09-24 Alan Modra <amodra@gmail.com>
986 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
988 2017-09-24 Alan Modra <amodra@gmail.com>
991 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
992 SHT_GNU_verneed section for sanity. Don't zalloc memory for
995 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
998 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
1001 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1004 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
1005 -1 if bfd_canonicalize_dynamic_reloc returns 0.
1007 2017-09-22 Pedro Alves <palves@redhat.com>
1008 Alan Modra <amodra@gmail.com>
1010 * version.h: Add comment.
1012 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
1014 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
1015 NT_S390_GS_BC, correct the previously swapped invocations of
1016 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
1018 2017-09-19 Alan Modra <amodra@gmail.com>
1021 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
1024 2017-09-19 Alan Modra <amodra@gmail.com>
1027 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
1028 symbols before calculating verrefs. Don't renumber dynsyms
1029 after gc. Exclude .gnu.version when zero or one dynsym.
1030 Localize some vars and reindent.
1032 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
1035 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
1036 return from bfd_canonicalize_dynamic_reloc.
1038 2017-09-15 Alan Modra <amodra@gmail.com>
1041 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
1042 overflows bfd_size_type.
1044 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
1047 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
1048 to indicate if conversion is performed.
1049 (elf_i386_check_relocs): Cache section contents and relocations
1050 if conversion is performed.
1051 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
1052 contents and relocations if conversion is performed.
1054 2017-09-14 Nick Clifton <nickc@redhat.com>
1057 * peXXigen.c (pe_print_idata): Extend check for HintName vector
1060 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
1062 * elfxx-x86.h: Fix a typo in comments.
1064 2017-09-09 Kamil Rytarowski <n54@gmx.com>
1066 * elf32-nds32.c: Rename __BIT() to N32_BIT().
1068 2017-09-09 Alan Modra <amodra@gmail.com>
1070 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
1073 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1075 * elf32-i386.c (elf_i386_relocate_section): Update usage of
1076 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1077 (elf_i386_finish_dynamic_symbol): Likewise.
1078 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1079 (elf_x86_64_finish_dynamic_symbol): Likewise.
1080 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1081 (_bfd_x86_elf_fixup_symbol): Likewise.
1083 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1085 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
1086 check has_non_got_reloc.
1088 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1091 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
1092 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1093 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
1094 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1095 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
1096 and linker_def on __ehdr_start if it is referenced and not
1098 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
1099 and return TRUE when building executable, if a symbol has
1100 non-GOT/non-PLT relocations in text section or there is no
1102 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
1104 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1106 * elfxx-x86.h: Update comments.
1108 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1110 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
1111 elf_x86_plt_layout_table with elf_x86_init_table.
1112 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1114 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
1116 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
1117 (elf_x86_init_table): This.
1118 (_bfd_x86_elf_link_setup_gnu_properties): Replace
1119 elf_x86_plt_layout_table with elf_x86_init_table.
1121 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1123 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
1124 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
1125 * configure: Regenerated.
1126 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
1127 and r_sym fields of plt_layout.
1128 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1130 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
1131 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
1132 r_info nor r_sym fields.
1133 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
1135 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
1137 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1139 * (_bfd_riscv_relax_align): Call bfd_set_error and
1140 print an error message when unable to relax a .align directive.
1142 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1144 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
1145 (riscv_record_pcrel_hi_reloc): Add absolute argument.
1146 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
1147 R_RISCV_PCREL_HI20 relocs, and pass the result to
1148 riscv_record_pcrel_hi_reloc.
1150 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1152 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
1153 r_type_p. Remove the converted argument. Replace
1154 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
1155 the new relocation type via r_type_p.
1156 (elf_i386_relocate_section): Likewise.
1157 (elf_i386_finish_dynamic_symbol): Likewise.
1158 (need_convert_load): Removed.
1159 (check_relocs_failed): Updated.
1160 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
1161 instead of setting need_convert_load.
1162 (_bfd_i386_elf_convert_load): Removed.
1163 * elf64-x86-64.c (need_convert_load): Removed.
1164 (check_relocs_failed): Updated.
1165 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
1166 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
1167 Return the new relocation type via r_type_p.
1168 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
1169 instead of setting need_convert_load.
1170 (elf_x86_64_check_relocs): Don't check PIC if relocation has
1172 (_bfd_x86_64_elf_convert_load): Removed.
1173 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
1174 with SYMBOL_REFERENCES_LOCAL_P.
1175 (elf_x86_64_finish_dynamic_symbol): Likewise.
1176 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
1178 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
1179 (_bfd_x86_elf_link_symbol_references_local): New function.
1180 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
1181 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
1182 SYMBOL_REFERENCES_LOCAL_P.
1183 (elf_x86_link_hash_entry): Add local_ref.
1184 (elf_x86_link_hash_table): Remove convert_load.
1185 (_bfd_i386_elf_convert_load): Removed.
1186 (_bfd_x86_64_elf_convert_load): Likewise.
1187 (_bfd_x86_elf_link_symbol_references_local): New.
1189 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1191 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
1192 (elf_x86_64_info_to_howto): Get the real relocation type by
1193 masking out R_X86_64_converted_reloc_bit.
1194 (elf_x86_64_check_tls_transition): Get the real relocation type
1195 by masking out R_X86_64_converted_reloc_bit.
1196 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
1197 instead of setting converted_reloc.
1198 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
1199 instead of converted_reloc. Get the real relocation type by
1200 masking out R_X86_64_converted_reloc_bit.
1201 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
1202 R_X86_64_converted_reloc_bit is valid.
1203 * elfxx-x86.h (converted_reloc): Removed.
1205 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1207 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
1208 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
1209 to get the relocation type again.
1210 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
1211 r_type when calling elf_x86_64_tls_transition. Don't use
1212 ELF32_R_TYPE to get the relocation type again.
1214 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1216 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
1219 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1221 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
1222 argument. Don't check relocation overflow. Avoid relocation
1223 overflow if --no-relax is used. Set converted_reloc on symbol
1224 if a GOTPCREL relocation is converted.
1225 (elf_x86_64_relocate_section): Issue a fatal error and suggest
1226 --no-relax if GOTPCREL relocation conversion leads to relocation
1228 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
1230 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
1231 Edmar Wienskoski <edmar.wienskoski@nxp.com
1233 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
1234 (ppc_elf_check_relocs): Handle it.
1235 (ppc_elf_vle_split20): New function.
1236 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
1238 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
1241 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
1242 for x86-64 if GOT_TLS_GDESC_P is true.
1244 2017-09-03 Alan Modra <amodra@gmail.com>
1247 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
1249 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1251 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1252 tls_get_addr for x86-64 in one place.
1254 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1256 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
1257 with elfxx-x86.lo for 64-bit BFD.
1258 * configure: Regenerated.
1260 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1262 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
1263 (_bfd_i386_elf_convert_load): This. Remove static.
1264 (elf_i386_size_dynamic_sections): Removed.
1265 (elf_backend_size_dynamic_sections): Likewise.
1266 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
1267 (_bfd_x86_64_elf_convert_load): This. Remove static.
1268 (elf_x86_64_size_dynamic_sections): Removed.
1269 (elf_backend_size_dynamic_sections): Likewise.
1270 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
1271 (elf_x86_allocate_dynrelocs): This. Make it static.
1272 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
1273 (elf_x86_allocate_local_dynreloc): This. Make it static.
1274 (elf_i386_is_reloc_section): New function.
1275 (elf_x86_64_is_reloc_section): Likewise.
1276 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
1277 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1278 Rearrange got_entry_size initialization.
1279 (_bfd_x86_elf_size_dynamic_sections): New function.
1280 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
1281 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1282 (_bfd_i386_elf_convert_load): New.
1283 (_bfd_x86_64_elf_convert_load): Likewise.
1284 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1285 (elf_backend_size_dynamic_sections): Likewise.
1286 (_bfd_x86_elf_allocate_dynrelocs): Removed.
1287 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1289 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1291 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
1294 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1296 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1297 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
1299 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1301 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1302 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
1303 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1304 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
1305 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1306 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
1308 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1310 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
1311 (elf_i386_allocate_local_dynrelocs): Likewise.
1312 (elf_i386_size_dynamic_sections): Replace
1313 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
1314 with _bfd_x86_elf_allocate_dynrelocs and
1315 _bfd_x86_elf_allocate_local_dynrelocs.
1316 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
1317 (elf_x86_64_allocate_local_dynrelocs): Likewise.
1318 (elf_x86_64_size_dynamic_sections): Replace
1319 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
1320 with _bfd_x86_elf_allocate_dynrelocs and
1321 _bfd_x86_elf_allocate_local_dynrelocs.
1322 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
1323 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1324 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
1325 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1327 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1329 * elf32-i386.c (is_i386_elf): Removed.
1330 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
1331 (elf_i386_size_dynamic_sections): Likewise.
1332 (elf_i386_relocate_section): Likewise.
1333 * elf64-x86-64.c (is_x86_64_elf): Removed.
1334 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
1336 (elf_x86_64_size_dynamic_sections): Likewise.
1337 (elf_x86_64_relocate_section): Likewise.
1338 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1340 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
1343 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1345 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
1346 (elf_i386_allocate_dynrelocs): Replace
1347 elf_i386_compute_jump_table_size with
1348 elf_x86_compute_jump_table_size.
1349 (elf_i386_size_dynamic_sections): Likewise.
1350 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
1351 (elf_x86_64_allocate_dynrelocs): Replace
1352 elf_x86_64_compute_jump_table_size with
1353 elf_x86_compute_jump_table_size.
1354 (elf_x86_64_size_dynamic_sections): Likewise.
1355 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1357 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
1358 (elf_x86_compute_jump_table_size): New.
1360 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1362 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1364 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
1365 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
1367 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1369 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
1370 with htab->is_vxworks.
1371 (elf_i386_size_dynamic_sections): Likewise.
1372 (elf_i386_relocate_section): Likewise.
1373 (elf_i386_finish_dynamic_symbol): Likewise.
1374 (elf_i386_finish_dynamic_sections): Likewise.
1376 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1378 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1379 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1380 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
1381 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1382 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1383 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
1384 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1385 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
1387 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1390 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
1391 ELF_COMMON_DEF_P for common symbols.
1393 2017-09-02 Alan Modra <amodra@gmail.com>
1395 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
1396 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1397 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1399 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1401 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
1402 (elf_backend_gc_mark_hook): Likewise.
1403 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
1404 (elf_backend_gc_mark_hook): Likewise.
1405 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
1406 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
1407 (elf_backend_gc_mark_hook): Likewise.
1409 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1411 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1412 (elf_backend_adjust_dynamic_symbol): Likewise.
1413 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1414 (elf_backend_adjust_dynamic_symbol): Likewise.
1415 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1416 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1417 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1418 (_bfd_x86_elf_adjust_dynamic_symbol): New.
1419 (elf_backend_adjust_dynamic_symbol): Likewise.
1421 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1423 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1426 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1428 * elf32-i386.c (elf_i386_mkobject): Removed.
1429 (bfd_elf32_mkobject): Likewise.
1430 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1431 (bfd_elf64_mkobject): Likewise.
1432 (bfd_elf32_mkobject): Likewise.
1433 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
1434 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1435 (bfd_elf64_mkobject): Likewise.
1436 (bfd_elf32_mkobject): Likewise.
1438 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1440 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1441 Call _bfd_x86_elf_link_setup_gnu_properties.
1442 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1443 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1445 (elf_x86_64_non_lazy_plt): Likewise.
1446 (elf_x86_64_lazy_bnd_plt): Likewise.
1447 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1448 (elf_x86_64_lazy_ibt_plt): Likewise.
1449 (elf_x32_lazy_ibt_plt): Likewise.
1450 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1451 (elf_x32_non_lazy_ibt_plt): Likewise.
1452 (elf_x86_64_nacl_plt): Likewise.
1453 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1454 _bfd_x86_elf_link_setup_gnu_properties.
1455 * elfxx-x86.c: Include elf-vxworks.h".
1456 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1457 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1458 comments for pic_plt0_entry and pic_plt_entry.
1459 (elf_x86_non_lazy_plt_layout): Likewise.
1460 (elf_x86_plt_layout_table): New.
1461 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1463 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1466 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1467 .eh_frame section for the second PLT.
1468 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1469 alignment of .eh_frame section for the second PLT.
1471 2017-09-01 Nick Clifton <nickc@redhat.com>
1474 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1477 2017-09-01 Nick Clifton <nickc@redhat.com>
1480 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1481 attribute buffer is NUL terminated.
1483 2017-08-31 Nick Clifton <nickc@redhat.com>
1486 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1487 to dwarf string sections.
1489 2017-08-31 Alan Modra <amodra@gmail.com>
1491 * po/SRC-POTFILES.in: Regenerate.
1493 2017-08-31 Alan Modra <amodra@gmail.com>
1495 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1496 for a section containing just a terminator. Allow multiple
1497 terminators at end of section.
1498 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1499 sections when not adding alignment. Assert on terminator in
1502 2017-08-31 Alan Modra <amodra@gmail.com>
1506 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1509 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1511 * configure.ac (bfd_backends): Add elf64.lo together with
1512 elfxx-x86.lo for 64-bit BFD.
1513 * configure: Regenerated.
1515 2017-08-31 James Bowman <james.bowman@ftdichip.com>
1517 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1520 2017-08-31 Alan Modra <amodra@gmail.com>
1523 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1524 before _close_and_cleanup. Call iovec->bclose after.
1525 (bfd_close): Remove code common to, and call, bfd_close_all_done.
1527 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1529 * elf32-i386.c (elf_i386_plt_type): Removed.
1530 (elf_i386_plt): Likewise.
1531 (elf_i386_get_synthetic_symtab): Updated. Call
1532 _bfd_x86_elf_get_synthetic_symtab.
1533 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1534 (elf_x86_64_plt): Likewise.
1535 (elf_x86_64_get_synthetic_symtab): Updated. Call
1536 _bfd_x86_elf_get_synthetic_symtab.
1537 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1538 (elf_x86_64_get_plt_got_vma): Likewise.
1539 (elf_i386_valid_plt_reloc_p): Likewise.
1540 (elf_x86_64_valid_plt_reloc_p): Likewise.
1541 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1542 * elfxx-x86.h (elf_x86_plt_type): New.
1543 (elf_x86_plt): Likewise.
1544 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1546 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1548 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1549 target_id instead of elf_machine_code.
1551 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1553 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1554 (elf_i386_lazy_plt_layout): Likewise.
1555 (elf_i386_non_lazy_plt_layout): Likewise.
1556 (elf_i386_plt_layout): Likewise.
1557 (elf_i386_link_hash_table): Likewise.
1558 (elf_i386_next_tls_desc_index): Likewise.
1559 (elf_i386_srelplt2): Likewise.
1560 (elf_i386_plt): Likewise.
1561 (elf_i386_lazy_plt): Likewise.
1562 (elf_i386_non_lazy_plt): Likewise.
1563 (elf_i386_link_hash_table_create): Likewise.
1564 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1565 (elf_i386_lazy_plt): Updated.
1566 (elf_i386_non_lazy_plt): Likewise.
1567 (elf_i386_lazy_ibt_plt): Likewise.
1568 (elf_i386_non_lazy_ibt_plt): Likewise.
1569 (elf_i386_allocate_dynrelocs): Likewise.
1570 (elf_i386_size_dynamic_sections): Likewise.
1571 (elf_i386_relocate_section): Likewise.
1572 (elf_i386_finish_dynamic_symbol): Likewise.
1573 (elf_i386_finish_dynamic_sections): Likewise.
1574 (elf_i386_get_synthetic_symtab): Likewise.
1575 (elf_i386_link_setup_gnu_properties): Likewise.
1576 (elf_i386_nacl_plt): Likewise.
1577 * elf64-x86-64.c (ABI_64_P): Removed.
1578 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1579 (ELF32_DYNAMIC_INTERPRETER): Likewise.
1580 (elf_x86_64_lazy_plt_layout): Likewise.
1581 (elf_x86_64_non_lazy_plt_layout): Likewise.
1582 (elf_x86_64_plt_layout): Likewise.
1583 (elf_x86_64_link_hash_table): Likewise.
1584 (elf_x86_64_plt): Likewise.
1585 (elf_x86_64_lazy_plt): Likewise.
1586 (elf_x86_64_non_lazy_plt): Likewise.
1587 (elf_x86_64_link_hash_table_create): Likewise.
1588 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1589 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1590 (elf_x86_64_lazy_plt): Updated.
1591 (elf_x86_64_non_lazy_plt): Likewise.
1592 (elf_x86_64_lazy_bnd_plt): Likewise.
1593 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1594 (elf_x86_64_lazy_ibt_plt): Likewise.
1595 (elf_x32_lazy_ibt_plt): Likewise.
1596 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1597 (elf_x32_non_lazy_ibt_plt): Likewise.
1598 (elf_x86_64_allocate_dynrelocs): Likewise.
1599 (elf_x86_64_size_dynamic_sections): Likewise.
1600 (elf_x86_64_relocate_section): Likewise.
1601 (elf_x86_64_finish_dynamic_symbol): Likewise.
1602 (elf_x86_64_finish_dynamic_sections): Likewise.
1603 (elf_x86_64_get_synthetic_symtab): Likewise.
1604 (elf_x86_64_link_setup_gnu_properties): Likewise.
1605 (elf_x86_64_nacl_plt): Likewise.
1606 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1608 (ELF32_DYNAMIC_INTERPRETER): New.
1609 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1610 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1611 (_bfd_x86_elf_link_hash_table_create): Likewise.
1612 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1613 (elf_x86_link_hash_table_free): This. Make it static.
1614 * elfxx-x86.h: Don't include "objalloc.h".
1616 (elf_x86_lazy_plt_layout): Likewise.
1617 (elf_x86_non_lazy_plt_layout): Likewise.
1618 (elf_x86_plt_layout): Likewise.
1619 (_bfd_x86_elf_link_hash_table_create): Likewise.
1620 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1621 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1622 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1623 srelplt2 and next_tls_desc_index.
1624 (_bfd_x86_elf_link_hash_table_free): Removed.
1626 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1628 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1629 branch offset interpretation.
1631 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1634 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1636 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1638 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1639 (elf_x86_64_srelplt2): Likewise.
1641 2017-08-30 Alan Modra <amodra@gmail.com>
1643 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1644 (ppc64_elf_tls_optimize): Set it.
1645 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1646 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1647 addis would add zero.
1648 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1649 (ppc_elf_tls_optimize): Set it.
1650 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1651 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1653 2017-08-30 Alan Modra <amodra@gmail.com>
1655 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1656 __tls_get_addr call sequences to LE, don't move the addi down
1657 to the nop. Replace the bl with addi and leave the nop alone.
1659 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1661 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1663 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1665 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1667 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1669 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1670 (BFD64_BACKENDS): Likewise.
1671 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1672 (BFD64_BACKENDS_CFILES): Likewise.
1673 * Makefile.in: Regenerated.
1674 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1675 elf32-i386.lo and elf64-x86-64.lo.
1676 * configure: Regenerated.
1677 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1678 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1679 "objalloc.h" and "hashtab.h".
1680 (ELIMINATE_COPY_RELOCS): Removed.
1681 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1682 (SYMBOL_NO_COPYRELOC): Likewise.
1683 (elf_i386_link_hash_entry): Likewise.
1684 (GOT_UNKNOWN): Likewise.
1685 (GOT_NORMAL): Likewise.
1686 (GOT_TLS_GD): Likewise.
1687 (elf_i386_hash_entry): Likewise.
1688 (elf_i386_obj_tdata): Likewise.
1689 (elf_i386_tdata): Likewise.
1690 (elf_i386_local_got_tls_type): Likewise.
1691 (elf_i386_local_tlsdesc_gotent): Likewise.
1692 (elf_i386_hash_table): Likewise.
1693 (elf_i386_link_hash_newfunc): Likewise.
1694 (elf_i386_local_htab_hash): Likewise.
1695 (elf_i386_local_htab_eq): Likewise.
1696 (elf_i386_get_local_sym_hash): Likewise.
1697 (elf_i386_link_hash_table_free): Likewise.
1698 (elf_i386_copy_indirect_symbol): Likewise.
1699 (elf_i386_fixup_symbol): Likewise.
1700 (elf_i386_readonly_dynrelocs): Likewise.
1701 (elf_i386_always_size_sections): Likewise.
1702 (elf_i386_set_tls_module_base): Likewise.
1703 (elf_i386_dtpoff_base): Likewise.
1704 (compare_relocs): Likewise.
1705 (elf_i386_hash_symbol): Likewise.
1706 (elf_i386_parse_gnu_properties): Likewise.
1707 (elf_i386_merge_gnu_properties): Likewise.
1708 (elf_i386_link_check_relocs): Likewise.
1709 (elf_i386_merge_symbol_attribute): Likewise.
1710 (bfd_elf32_bfd_link_check_relocs): Likewise.
1711 (elf_backend_copy_indirect_symbol): Likewise.
1712 (elf_backend_always_size_sections): Likewise.
1713 (elf_backend_omit_section_dynsym): Likewise.
1714 (elf_backend_hash_symbol): Likewise.
1715 (elf_backend_fixup_symbol): Likewise.
1716 (elf_backend_parse_gnu_properties): Likewise.
1717 (elf_backend_merge_gnu_properties): Likewise.
1718 (elf_backend_merge_symbol_attribute): Likewise.
1719 (elf_i386_mkobject): Updated.
1720 (elf_i386_link_hash_table_create): Likewise.
1721 (elf_i386_check_tls_transition): Likewise.
1722 (elf_i386_tls_transition): Likewise.
1723 (elf_i386_convert_load_reloc): Likewise.
1724 (elf_i386_check_relocs): Likewise.
1725 (elf_i386_adjust_dynamic_symbol): Likewise.
1726 (elf_i386_allocate_dynrelocs): Likewise.
1727 (elf_i386_convert_load): Likewise.
1728 (elf_i386_size_dynamic_sections): Likewise.
1729 (elf_i386_relocate_section): Likewise.
1730 (elf_i386_finish_dynamic_symbol ): Likewise.
1731 (elf_i386_finish_dynamic_sections): Likewise.
1732 (elf_i386_output_arch_local_syms): Likewise.
1733 (elf_i386_get_synthetic_symtab): Likewise.
1734 (elf_i386_link_setup_gnu_properties): Likewise.
1735 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1736 of elf_link_hash_table, as base.
1737 (elf_i386_next_tls_desc_index): New.
1738 (elf_i386_srelplt2): Likewise.
1739 (elf_i386_plt): Likewise.
1740 (elf_i386_lazy_plt): Likewise.
1741 (elf_i386_non_lazy_plt): Likewise.
1742 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1743 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1744 "objalloc.h" and "hashtab.h".
1745 (ELIMINATE_COPY_RELOCS): Removed.
1746 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1747 (SYMBOL_NO_COPYRELOC): Likewise.
1748 (elf_x86_64_link_hash_entry): Likewise.
1749 (GOT_UNKNOWN): Likewise.
1750 (GOT_NORMAL): Likewise.
1751 (GOT_TLS_GD): Likewise.
1752 (elf_x86_64_hash_entry): Likewise.
1753 (elf_x86_64_obj_tdata): Likewise.
1754 (elf_x86_64_tdata): Likewise.
1755 (elf_x86_64_local_got_tls_type): Likewise.
1756 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1757 (elf_x86_64_hash_table): Likewise.
1758 (elf_x86_64_link_hash_newfunc): Likewise.
1759 (elf_x86_64_local_htab_hash): Likewise.
1760 (elf_x86_64_local_htab_eq): Likewise.
1761 (elf_x86_64_get_local_sym_hash): Likewise.
1762 (elf_x86_64_link_hash_table_free): Likewise.
1763 (elf_x86_64_copy_indirect_symbol): Likewise.
1764 (elf_x86_64_fixup_symbol): Likewise.
1765 (elf_x86_64_readonly_dynrelocs): Likewise.
1766 (elf_x86_64_always_size_sections): Likewise.
1767 (elf_x86_64_set_tls_module_base): Likewise.
1768 (elf_x86_64_dtpoff_base): Likewise.
1769 (compare_relocs): Likewise.
1770 (elf_x86_64_merge_symbol_attribute): Likewise.
1771 (elf_x86_64_hash_symbol): Likewise.
1772 (elf_x86_64_parse_gnu_properties): Likewise.
1773 (elf_x86_64_merge_gnu_properties): Likewise.
1774 (elf_x86_64_link_check_relocs): Likewise.
1775 (elf_backend_copy_indirect_symbol): Likewise.
1776 (elf_backend_always_size_sections): Likewise.
1777 (bfd_elf64_bfd_link_check_relocs): Likewise.
1778 (elf_backend_merge_symbol_attribute): Likewise.
1779 (elf_backend_hash_symbol): Likewise.
1780 (elf_backend_omit_section_dynsym): Likewise.
1781 (elf_backend_fixup_symbol): Likewise.
1782 (elf_backend_parse_gnu_properties): Likewise.
1783 (elf_backend_merge_gnu_properties): Likewise.
1784 (bfd_elf32_bfd_link_check_relocs): Likewise.
1785 (elf_x86_64_mkobject): Updated.
1786 (elf_x86_64_link_hash_table_create): Likewise.
1787 (elf_x86_64_check_tls_transition): Likewise.
1788 (elf_x86_64_tls_transition): Likewise.
1789 (elf_x86_64_convert_load_reloc): Likewise.
1790 (elf_x86_64_check_relocs): Likewise.
1791 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1792 (elf_x86_64_allocate_dynrelocs): Likewise.
1793 (elf_x86_64_convert_load): Likewise.
1794 (elf_x86_64_size_dynamic_sections): Likewise.
1795 (elf_x86_64_relocate_section): Likewise.
1796 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1797 (elf_x86_64_finish_dynamic_sections): Likewise.
1798 (elf_x86_64_output_arch_local_syms): Likewise.
1799 (elf_x86_64_get_synthetic_symtab): Likewise.
1800 (elf_x86_64_link_setup_gnu_properties): Likewise.
1801 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1802 instead of elf_link_hash_table, as base.
1803 (elf_x86_64_next_tls_desc_index): New.
1804 (elf_x86_64_srelplt2): Likewise.
1805 (elf_x86_64_plt): Likewise.
1806 (elf_x86_64_lazy_plt): Likewise.
1807 (elf_x86_64_non_lazy_plt): Likewise.
1808 * elfxx-x86.c: New file.
1809 * elfxx-x86.h: Likewise.
1811 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1813 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1815 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1817 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1819 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1820 sections before checking dynamic relocations and free invalid
1821 PLT section contents.
1822 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1824 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1826 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1827 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1829 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1832 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1834 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1836 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1838 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1840 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1842 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1845 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1846 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1847 Add a has_no_copy_on_protected bitfield.
1848 (elf_has_no_copy_on_protected): New.
1849 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1850 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1851 (elf_merge_gnu_property_list): Likewise.
1852 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1853 to FALSE for elf_has_no_copy_on_protected.
1854 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1855 (elf_i386_link_hash_entry): Add def_protected.
1856 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1857 when checking info->nocopyreloc.
1858 (elf_i386_link_setup_gnu_properties): Don't set
1859 extern_protected_data here.
1860 (elf_i386_merge_symbol_attribute): New function.
1861 (elf_backend_merge_symbol_attribute): New.
1862 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1863 (elf_x86_64_link_hash_entry): Add def_protected.
1864 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1865 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1866 when checking info->nocopyreloc.
1867 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1868 relocation run-time overflow and unresolvable R_X86_64_32S
1869 relocation against protected data symbol defined in shared object
1870 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1871 (elf_x86_64_link_setup_gnu_properties): Don't set
1872 extern_protected_data here.
1873 (elf_x86_64_merge_symbol_attribute): New function.
1874 (elf_backend_merge_symbol_attribute): New.
1876 2017-08-26 Alan Modra <amodra@gmail.com>
1878 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1879 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1880 (ppc_elf_relocate_section): Comment fix.
1881 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1882 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1883 Support dynamic relocs for TPREL16 when non-pic too.
1884 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1885 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1888 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1890 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1891 "symbol" in comments.
1892 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1894 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1897 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1898 R_X86_64_PC32 relocation run-time overflow and unresolvable
1899 R_X86_64_32S relocation with -z nocopyreloc.
1901 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1903 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1904 Undefined symbols may not have a type.
1905 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1907 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1909 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1910 bfd_link_info. Report shared, PIE or PDE object based on
1912 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1913 (elf_x86_64_relocate_section): Likewise.
1915 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1917 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1918 for function symbols.
1919 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1921 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1923 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1924 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1925 is set on any input relocatable file.
1926 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1928 2017-08-23 Alan Modra <amodra@gmail.com>
1931 * elf64-ppc.c (ensure_undef_dynamic): Rename from
1932 ensure_undefweak_dynamic. Handle undefined too.
1933 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1934 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1935 (allocate_dynrelocs): Discard undefined non-default visibility
1936 relocs first. Make undefined syms dynamic. Tidy goto.
1938 2017-08-21 Alan Modra <amodra@gmail.com>
1939 H.J. Lu <hongjiu.lu@intel.com>
1942 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
1943 * elflink.c (bfd_elf_define_start_stop): Rewrite.
1945 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
1948 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
1949 undefined weak symbols.
1951 2017-08-18 Nick Clifton <nickc@redhat.com>
1954 * tekhex.c (getsym): Fix check for source pointer walking off the
1955 end of the input buffer.
1957 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
1960 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
1961 relocations in debug sections, change abort to _bfd_error_handler.
1963 2017-08-14 Nick Clifton <nickc@redhat.com>
1966 * elf.c (setup_group): Check for an empty or very small group
1968 * po/bfd.pot: Regenerate.
1970 2017-08-14 Alan Modra <amodra@gmail.com>
1973 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
1974 alignment padding here.
1975 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
1976 in a reverse pass over sections.
1978 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
1981 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
1982 for @plt suffixes first.
1983 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1985 2017-08-08 Nick Clifton <nickc@redhat.com>
1988 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
1989 small section lengths.
1990 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
1992 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
1993 there is enough data present in the note.
1995 2017-08-08 Alan Modra <amodra@gmail.com>
1998 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
1999 got.refcount for GOTOFF relocs, just create .got section.
2001 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
2003 * elflink.c (elf_link_add_object_symbols): Move common symbol
2004 check after bed->common_definition.
2006 2017-08-07 Alan Modra <amodra@gmail.com>
2009 * elflink.c (bfd_elf_final_link): Don't segfault when sections
2010 needed to define various dynamic tags have been discarded.
2012 2017-08-07 Nick Clifton <nickc@redhat.com>
2015 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
2016 has not been set then use the bfd returned by
2017 _bfd_elf_link_setup_gnu_properties. If that is null then search
2018 through all the input bfds selecting the first normal, ELF format
2020 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2022 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2024 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
2026 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
2027 (elf_i386_check_tls_transition): Check tls_get_addr directly.
2028 (elf_i386_convert_load_reloc): Update tls_get_addr check.
2029 (elf_i386_link_check_relocs): New function.
2030 (bfd_elf32_bfd_link_check_relocs): New.
2031 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
2033 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
2034 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
2035 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
2036 (elf_x86_64_link_check_relocs): New function.
2037 (bfd_elf64_bfd_link_check_relocs): New.
2038 (bfd_elf32_bfd_link_check_relocs): Likewise.
2040 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2043 * elflink.c (elf_link_add_object_symbols): Treat common symbol
2044 as undefined for --no-define-common.
2046 2017-08-05 Alan Modra <amodra@gmail.com>
2048 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
2049 hppa_link_hash_table.
2051 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
2053 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
2054 entries for sysregs with negative indices.
2056 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2058 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
2059 isn't the S/390 specific elf data.
2060 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2062 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
2064 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
2065 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
2066 [R_RISCV_ADD16]: Likewise.
2067 [R_RISCV_ADD32]: Likewise.
2068 [R_RISCV_ADD64]: Likewise.
2069 [R_RISCV_SUB6]: Likewise.
2070 [R_RISCV_SUB8]: Likewise.
2071 [R_RISCV_SUB16]: Likewise.
2072 [R_RISCV_SUB32]: Likewise.
2073 [R_RISCV_SUB64]: Likewise.
2075 2017-07-31 Alan Modra <amodra@gmail.com>
2077 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
2078 without ld.so checks.
2080 2017-07-29 Alan Modra <amodra@gmail.com>
2083 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
2084 (ppc64_elf_merge_symbol): Set non_zero_localentry.
2085 (is_elfv2_localentry0): Test non_zero_localentry.
2086 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
2088 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2090 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
2091 pointer check for htab->elf.irelplt.
2092 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2094 2017-07-27 Nick Clifton <nickc@redhat.com>
2097 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
2099 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
2101 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
2103 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
2105 (evax_bfd_print_emh): Check for invalid string lengths.
2107 2017-07-25 Nick Clifton <nickc@redhat.com>
2109 * po/fr.po: Updated French translation.
2111 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
2114 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
2115 16-bit absolute branches into 10-bit pc-relative branches on the
2116 MSP430 as well as the MSP430X.
2118 2017-07-25 Alan Modra <amodra@gmail.com>
2120 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
2121 (stub_eh_frame_size): New function.
2122 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
2123 (group_sections): Init group tls_get_addr_opt_bctrl.
2124 (ppc64_elf_size_stubs): Update sizing and initialization of
2125 .eh_frame. Iteration over stubs via group list.
2126 (ppc64_elf_build_stubs): Iterate over stubs via group list.
2127 (ppc64_elf_finish_dynamic_sections): Update finalization of
2130 2017-07-24 Nick Clifton <nickc@redhat.com>
2133 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
2134 of the relocs to the canonicalize_one_reloc routine.
2135 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
2136 for the _bfd_mach_o_canonicalize_one_reloc field.
2137 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
2138 res_base parameter. Use to check for corrupt pair relocs.
2139 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
2141 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
2143 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
2146 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
2147 enough data in the record before attempting to parse it.
2148 (_bfd_vms_slurp_eeom): Likewise.
2150 (_bfd_vms_slurp_egsd): Check for an invalid section index.
2151 (image_set_ptr): Likewise.
2152 (alpha_vms_slurp_relocs): Likewise.
2154 (alpha_vms_object_p): Check for a truncated record.
2156 2017-07-24 Nick Clifton <nickc@redhat.com>
2159 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
2160 an unrecognized reloc and sets the bfd_error value.
2161 * libbfd.h: Regenerate.
2162 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
2164 * elf32-i386.c (elf_i386_relocate_section): Likewise.
2165 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2166 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2167 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
2168 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2170 2017-07-23 Alan Modra <amodra@gmail.com>
2172 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
2175 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
2178 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
2179 reloc_class_ifunc for ifunc symbols.
2181 2017-07-19 Nick Clifton <nickc@redhat.com>
2184 * archive.c (bfd_generic_archive_p): If the bfd does not have the
2185 correct magic bytes at the start, set the error to wrong format
2186 and clear the format selector before returning NULL.
2188 2017-07-19 Nick Clifton <nickc@redhat.com>
2191 * coff-rs6000.c (_bfd_strntol): New function.
2192 (_bfd_strntoll): New function.
2193 (GET_VALUE_IN_FIELD): New macro.
2194 (EQ_VALUE_IN_FIELD): new macro.
2195 (_bfd_xcoff_slurp_armap): Use new macros.
2196 (_bfd_xcoff_archive_p): Likewise.
2197 (_bfd_xcoff_read_ar_hdr): Likewise.
2198 (_bfd_xcoff_openr_next_archived_file): Likewise.
2199 (_bfd_xcoff_stat_arch_elt): Likewise.
2200 * coff64-rs6000.c (_bfd_strntol): New function.
2201 (_bfd_strntoll): New function.
2202 (GET_VALUE_IN_FIELD): New macro.
2203 (xcoff64_slurp_armap): Use new macros.
2205 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
2206 John Eric Martin <John.Martin@emmicro-us.com>
2208 * bfd-in2.h: Regenerate.
2209 * libbfd.h: Regenerate.
2210 * elf32-arc.c (JLI): Define.
2211 * reloc.c: Add JLI relocations.
2213 2017-07-18 Nick Clifton <nickc@redhat.com>
2216 * coff-sh.c: Fix spelling typos.
2217 * compress.c: Likewise.
2218 * cpu-pdp11.c: Likewise.
2219 * ecofflink.c: Likewise.
2220 * elf-m10300.c: Likewise.
2222 * elf32-arm.c: Likewise.
2223 * elf32-m68k.c: Likewise.
2224 * elf32-nds32.c: Likewise.
2225 * elf32-ppc.c: Likewise.
2226 * elf32-sh.c: Likewise.
2227 * elf32-v850.c: Likewise.
2228 * elf64-ppc.c: Likewise.
2229 * elf64-x86-64.c: Likewise.
2230 * elflink.c: Likewise.
2231 * elfnn-aarch64.c: Likewise.
2232 * elfxx-mips.c: Likewise.
2234 * sunos.c: Likewise.
2235 * vms-alpha.c: Likewise.
2236 * xcofflink.c: Likewise.
2238 2017-07-18 Nick Clifton <nickc@redhat.com>
2241 * coffcode.h (handle_COMDAT): Replace abort with an error message
2244 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2247 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
2250 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2252 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2254 2017-07-16 Alan Modra <amodra@gmail.com>
2256 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
2257 __tls_index GOT entries when using __tls_get_addr_opt stub.
2258 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2260 2017-07-12 Alan Modra <amodra@gmail.com>
2262 * po/es.po: Update from translationproject.org/latest/bfd/.
2263 * po/fi.po: Likewise.
2264 * po/fr.po: Likewise.
2265 * po/id.po: Likewise.
2266 * po/ja.po: Likewise.
2267 * po/ro.po: Likewise.
2268 * po/ru.po: Likewise.
2269 * po/sr.po: Likewise.
2270 * po/sv.po: Likewise.
2271 * po/tr.po: Likewise.
2272 * po/uk.po: Likewise.
2273 * po/vi.po: Likewise.
2274 * po/zh_CN.po: Likewise.
2275 * po/hr.po: New file from translationproject.org.
2276 * configure.ac (ALL_LINGUAS): Add hr. Sort.
2277 * configure: Regenerate.
2279 2017-07-12 Nick Clifton <nickc@redhat.com>
2281 Fix compile time warnings using gcc 7.1.1.
2282 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
2284 (elf_xtensa_get_gotplt_section): Increase length of got_name
2286 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
2287 default return of FALSE.
2288 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
2289 default return of FALSE.
2291 2017-07-12 Alan Modra <amodra@gmail.com>
2293 * binary.c (binary_set_section_contents): Don't print filepos in
2295 (coff_write_object_contents): Cast size_t for error message.
2296 (coff_slurp_line_table): Don't use bfd_vma symndx.
2297 (coff_slurp_reloc_table): Remove unneeded cast.
2298 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
2300 (find_abstract_instance_name): Likewise.
2301 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
2302 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
2303 (elf32_arm_check_relocs): Make r_symndx an int.
2304 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
2306 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
2308 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
2310 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
2311 * elf32-s390.c (elf_s390_check_relocs): Likewise.
2312 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
2313 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
2314 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2315 * elf64-s390.c (elf_s390_check_relocs): Likewise.
2316 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2317 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
2318 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2319 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
2320 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
2321 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
2322 and use %lu for error message.
2323 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
2324 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
2327 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
2329 (elf32_arm_final_link_relocate): Likewise.
2330 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
2331 * coffcode.h (styp_to_sec_flags): Likewise.
2332 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
2333 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
2334 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
2335 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
2336 (elf32_bfin_merge_private_bfd_data): Likewise.
2337 * elf32-cris.c (cris_elf_relocate_section): Likewise.
2338 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2339 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
2340 (i370_elf_relocate_section): Likewise.
2341 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
2342 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
2343 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
2344 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2345 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
2346 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
2347 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
2348 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
2349 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2350 * ieee.c (ieee_write_id, read_id): Likewise.
2351 * mach-o.c (bfd_mach_o_write_contents): Likewise.
2352 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
2353 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
2354 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
2355 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
2356 * stabs.c (_bfd_link_section_stabs): Likewise.
2358 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
2360 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2361 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2362 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
2363 * coff-sh.c (sh_relax_section): Likewise.
2364 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
2365 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2366 * coffcode.h (coff_slurp_reloc_table): Likewise.
2367 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2368 (_bfd_coff_read_string_table): Likewise.
2369 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
2370 * compress.c (bfd_get_full_section_contents): Likewise.
2371 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
2372 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2373 * elf.c (bfd_elf_string_from_elf_section): Likewise.
2374 * elf32-arc.c (arc_special_overflow_checks): Likewise.
2375 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
2376 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
2377 (elf32_arm_write_section): Likewise.
2378 * elf32-bfin.c (bfin_relocate_section): Likewise.
2379 (bfinfdpic_relocate_section): Likewise.
2380 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2381 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
2382 * elf32-i386.c (elf_i386_tls_transition): Likewise.
2383 (elf_i386_relocate_section): Likewise.
2384 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
2385 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
2386 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2387 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2388 * elf32-metag.c (elf_metag_relocate_section): Likewise.
2389 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
2390 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
2391 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
2392 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
2393 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
2394 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
2395 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
2396 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
2397 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
2398 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
2399 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
2400 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
2401 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
2402 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
2403 * elf32-sh.c (sh_elf_relax_section): Likewise.
2404 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
2405 (sh_elf_relocate_section): Likewise.
2406 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
2407 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2408 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2409 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2410 * elf32-v850.c (v850_elf_relax_section): Likewise.
2411 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2412 (elf_vax_relocate_section): Likewise.
2413 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2414 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2415 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2416 (do_fix_for_relocatable_link): Likewise.
2417 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2418 (elf64_alpha_relax_with_lituse): Likewise.
2419 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2420 (elf_hppa_final_link_relocate): Likewise.
2421 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2422 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2423 (elf64_vms_link_add_object_symbols): Likewise.
2424 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2425 (mmix_final_link_relocate): Likewise.
2426 * elf64-s390.c (invalid_tls_insn): Likewise.
2427 (elf_s390_relocate_section): Likewise.
2428 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2429 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2430 (elf_x86_64_relocate_section): Likewise.
2431 * elfcode.h (elf_slurp_symbol_table): Likewise.
2432 * elfcore.h (elf_core_file_p): Likewise.
2433 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2434 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2435 (elfNN_aarch64_relocate_section): Likewise.
2436 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2437 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2438 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2439 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2440 (_bfd_mips_elf_relocate_section): Likewise.
2441 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2442 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2443 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2444 * ieee.c (ieee_slurp_external_symbols): Likewise.
2445 * ihex.c (ihex_write_object_content): Likewise.
2446 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2447 * merge.c (_bfd_merged_section_offset): Likewise.
2448 * mmo.c (mmo_write_loc_chunk): Likewise.
2449 (mmo_write_object_contents): Likewise.
2450 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2451 * stabs.c (_bfd_link_section_stabs): Likewise.
2452 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2454 2017-07-11 Alan Modra <amodra@gmail.com>
2456 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2458 2017-07-11 Alan Modra <amodra@gmail.com>
2460 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2461 instruction" error using _bfd_error_handler, not einfo.
2463 2017-07-10 Nick Clifton <nickc@redhat.com>
2465 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2466 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2468 2017-07-07 John Baldwin <jhb@FreeBSD.org>
2470 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2472 2017-07-07 Alan Modra <amodra@gmail.com>
2474 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2476 2017-07-07 Alan Modra <amodra@gmail.com>
2478 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2479 as long long. Move code replacing "ll" with "I64", and simplify.
2481 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2483 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2486 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2488 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2490 (line_info_add_file_name): Likewise.
2491 (decode_line_info): Likewise.
2493 2017-07-04 Tristan Gingold <gingold@adacore.com>
2495 * version.m4: Bump version to 2.29.51
2496 * configure: Regenerate.
2498 2017-07-04 Jiong Wang <jiong.wang@arm.com>
2500 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2501 sanity check at the head of this function.
2503 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2505 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2506 dwarf_line_str_size.
2507 (struct attr_abbrev): Add field implicit_const.
2508 (dwarf_debug_sections): Add .debug_line_str.
2509 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2510 (dwarf_debug_section_assert): Add static assertion.
2511 (read_indirect_line_string): New.
2512 (read_abbrevs): Support DW_FORM_implicit_const.
2513 (is_str_attr): Support DW_FORM_line_strp.
2514 (read_attribute_value): Support DW_FORM_line_strp and
2515 DW_FORM_implicit_const.
2516 (read_attribute): Support DW_FORM_implicit_const.
2517 (line_info_add_include_dir, line_info_add_include_dir_stub):
2518 (line_info_add_file_name, read_formatted_entries): New.
2519 (decode_line_info, parse_comp_unit): Support DWARF 5.
2520 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2522 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2524 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2525 abort statement that was put for symbols that are not dynamic.
2527 2017-07-03 Tristan Gingold <gingold@adacore.com>
2529 * po/bfd.pot: Regenerate
2531 2017-07-03 Alan Modra <amodra@gmail.com>
2533 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2534 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
2535 * elf.c (setup_group): Use "Lx" to print sh_size.
2536 (_bfd_elf_setup_sections): Remove unnecessary cast and print
2537 unknown section type in hex.
2538 (copy_special_section_fields): Style fix.
2539 (bfd_section_from_shdr): Correct format for sh_link. Use a
2540 common error message for all the variants of unrecognized
2542 (assign_file_positions_for_load_sections): Use "Lx" for lma
2543 adjust error message.
2544 (assign_file_positions_for_non_load_sections): Formatting.
2545 (rewrite_elf_program_header): Formatting. Use "Lx" for
2546 bfd_vma values in error messages.
2547 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2548 ELF_R_SYM value to type expected by format.
2549 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2551 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2552 (elf_link_input_bfd): Use "Lx" for r_info.
2553 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2555 2017-07-03 Alan Modra <amodra@gmail.com>
2557 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2558 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2559 Microsoft C library variant of long long format specifier.
2560 (PRINT20): Cast value to bfd_uint64_t not long long.
2561 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2562 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2563 long long. Don't cast to bfd_vma.
2564 * elf32-score.c (score3_bfd_getl48): Likewise.
2565 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2567 2017-07-03 Alan Modra <amodra@gmail.com>
2569 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2571 (bfd_elf_print_symbol): Don't cast symbol->flags.
2572 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2573 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2574 _bfd_error_handler argument order.
2575 (ppc_elf_merge_private_bfd_data): Don't cast flags.
2577 2017-07-03 Alan Modra <amodra@gmail.com>
2579 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
2580 AC_TYPE_LONG_DOUBLE.
2581 * configure: Regenerate.
2582 * config.in: Regenerate.
2584 2017-06-29 Andrew Waterman <andrew@sifive.com>
2586 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2589 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2591 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2592 unless it is undefined weak.
2593 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2594 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2596 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2597 is not dynamic in PIC, abort.
2599 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2602 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2603 undefined weak symbols into dynamic.
2604 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2605 relocation for non-dynamic symbols.
2606 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2608 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2610 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2611 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2612 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2613 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2614 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2617 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
2619 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2620 (elfcore_write_s390_gs_bc): Likewise.
2621 * elf.c (elfcore_grok_s390_gs_cb): New function.
2622 (elfcore_grok_s390_gs_bc): New function.
2623 (elfcore_grok_note): Call them.
2624 (elfcore_write_s390_gs_cb): New function.
2625 (elfcore_write_s390_gs_bc): New function.
2626 (elfcore_write_register_note): Call them.
2628 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2630 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2631 bfd_get_file_size. Check archive element size.
2632 (_bfd_generic_get_section_contents_in_window): Likewise.
2634 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2636 * bfd-in2.h: Regenerated.
2637 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2638 (bfd_get_file_size): Likewise.
2640 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2641 Matthew Fortune <matthew.fortune@imgtec.com>
2643 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2644 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2645 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2646 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2648 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2649 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2650 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2651 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2652 `bfd_mach_mips_interaptiv_mr2' entries.
2653 * bfd-in2.h: Regenerate.
2655 2017-06-27 Nick Clifton <nickc@redhat.com>
2657 * tekhex.c (pass_over): Revert accidental conversion of a local
2658 array to a static array.
2660 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2663 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2664 reloc addend if necessary. Adjust diff only if
2665 shrinked_insn_address < end_address.
2667 2017-06-27 Alan Modra <amodra@gmail.com>
2670 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2671 (_bfd_generic_get_section_contents_in_window): Likewise.
2673 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2675 * elfnn-riscv.c (perform_relocation): Support the new
2676 R_RISCV_32_PCREL relocation.
2677 (riscv_elf_relocate_section): Likewise.
2678 * elfxx-riscv.c (howto_table): Likewise.
2679 (riscv_reloc_map): Likewise.
2680 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2681 * libbfd.h: Regenerate.
2683 2017-06-27 Alan Modra <amodra@gmail.com>
2686 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2687 Use unsigned file pointer type, and remove cast.
2688 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2689 Add "count", not "sz".
2691 2017-06-26 Pedro Alves <palves@redhat.com>
2694 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2697 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2700 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2703 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2705 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2706 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2707 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2708 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2709 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2711 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2714 * compress.c (bfd_get_full_section_contents): Don't check the
2716 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2717 reject a section whose size + offset is greater than the size
2719 (_bfd_generic_get_section_contents_in_window): Likewise.
2721 2017-06-26 Nick Clifton <nickc@redhat.com>
2724 * tekhex.c (getvalue): Check for the source pointer exceeding the
2725 end pointer before the first byte is read.
2727 2017-06-26 Nick Clifton <nickc@redhat.com>
2730 * opncls.c (get_build_id): Check that the section is big enough
2731 to contain the whole note.
2732 * compress.c (bfd_get_full_section_contents): Check for and reject
2733 a section whose size is greater than the size of the entire file.
2734 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2735 contain a notes section.
2737 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2739 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2741 (elf_s390_modify_segment_map): Likewise.
2742 (bfd_elf_s390_set_options): Lisewise.
2744 2017-06-26 Alan Modra <amodra@gmail.com>
2746 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2748 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2749 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2750 .preinit_array on --just-syms bfds.
2751 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2752 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2753 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2755 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2757 * elf.c (find_link): Bounds check "hint".
2759 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2761 * elf32-arm.c (using_thumb_only): Update list of architectures in
2762 BFD_ASSERT for which the logic is valid.
2763 (using_thumb2_bl): Likewise.
2764 (using_thumb2): Likewise and return true for ARMv8-R.
2765 (arch_has_arm_nop): Likewise.
2766 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2767 merging logic. Update commentis for value 15 of v8m_baseline,
2768 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2769 merging of value 15 of Tag_CPU_arch.
2771 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2773 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2774 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2775 * bfd-in2.h: Regenerate.
2777 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2779 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2780 the error_alignment label forward. Properly align program
2781 property note section.
2783 2017-06-22 Eric Christopher <echristo@gmail.com>
2785 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2786 abs to fix a truncation warning.
2788 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2790 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2791 local undefined weak symbol to 0.
2792 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2794 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2796 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2797 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2798 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2799 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2800 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2801 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2802 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2803 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2805 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2807 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2808 (elf_i386_lazy_ibt_plt_entry): Likewise.
2809 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2810 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2811 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2812 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2813 (elf_i386_lazy_plt_layout): Likewise.
2814 (elf_i386_non_lazy_plt_layout): Likewise.
2815 (elf_i386_link_hash_entry): Add plt_second.
2816 (elf_i386_link_hash_table): Add plt_second and
2817 plt_second_eh_frame.
2818 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2819 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2820 the second PLT. Check the second PLT.
2821 (elf_i386_relocate_section): Use the second PLT to resolve
2822 PLT reference if needed.
2823 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2825 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2826 second PLT. Generate unwind info for the second PLT.
2827 (elf_i386_plt_type): Add plt_second.
2828 (elf_i386_get_synthetic_symtab): Support the second PLT.
2829 (elf_i386_parse_gnu_properties): Support
2830 GNU_PROPERTY_X86_FEATURE_1_AND.
2831 (elf_i386_merge_gnu_properties): Support
2832 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2833 on GNU_PROPERTY_X86_FEATURE_1_IBT
2834 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2835 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2836 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2837 is set on all relocatable inputs.
2838 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2839 (elf_x32_lazy_ibt_plt_entry): Likewise.
2840 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2841 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2842 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2843 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2844 (elf_x86_64_lazy_ibt_plt): Likewise.
2845 (elf_x32_lazy_ibt_plt): Likewise.
2846 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2847 (elf_x32_non_lazy_ibt_plt): Likewise.
2848 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2849 (elf_x86_64_parse_gnu_properties): Support
2850 GNU_PROPERTY_X86_FEATURE_1_AND.
2851 (elf_x86_64_merge_gnu_properties): Support
2852 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2853 on GNU_PROPERTY_X86_FEATURE_1_IBT
2854 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2855 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2856 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2857 is set on all relocatable inputs.
2859 2017-06-22 Nick Clifton <nickc@redhat.com>
2862 * som.c (setup_sections): NUL terminate the space_strings buffer.
2863 Check that the space.name field does not index beyond the end of
2864 the space_strings buffer.
2866 2017-06-21 Nick Clifton <nickc@redhat.com>
2869 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2871 2017-06-21 Nick Clifton <nickc@redhat.com>
2874 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2875 type of the size parameter.
2876 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2877 length of the counted string.
2878 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2879 (_bfd_vms_save_counted_string): Likewise.
2880 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2881 _bfd_vms_save_counted_string.
2882 (_bfd_vms_slurp_ehdr): Likewise.
2883 (_bfd_vms_slurp_egsd): Likewise.
2884 (Parse_module): Likewise.
2886 2017-06-21 Alan Modra <amodra@gmail.com>
2888 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2889 calls before tocsave calls.
2890 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2893 2017-06-21 Nick Clifton <nickc@redhat.com>
2896 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2897 bfd_get_full_section_contents returns no contents.
2899 2017-06-21 Nick Clifton <nickc@redhat.com>
2902 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2905 2017-06-21 Nick Clifton <nickc@redhat.com>
2908 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2910 (image_set_ptr): Likewise.
2911 (alpha_vms_fix_sec_rel): Likewise.
2912 (alpha_vms_slurp_relocs): Likewise.
2914 2017-06-21 Nick Clifton <nickc@redhat.com>
2917 * ieee.c (ieee_slurp_sections): Check for a NULL return from
2919 (ieee_archive_p): Likewise.
2920 (ieee_object_p): Likewise.
2922 2017-06-21 Nick Clifton <nickc@redhat.com>
2925 * elf.c (setup_group): Zero the group section pointer list after
2926 allocation so that loops can be caught. Check for NULL pointers
2927 when processing a group list.
2929 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2931 * elf-s390.h: New file.
2932 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2934 (elf_s390_additional_program_headers): New function.
2935 (elf_s390_modify_segment_map): New function.
2936 (bfd_elf_s390_set_options): New function.
2937 (elf_backend_additional_program_headers)
2938 (elf_backend_modify_segment_map): Add macro definitions.
2940 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
2943 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
2944 the DYNAMIC bit instead of bfd_count_sections.
2946 2017-06-19 Nick Clifton <nickc@redhat.com>
2949 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
2951 (evax_bfd_print_eeom): Likewise.
2952 (evax_bfd_print_egsd): Check for an overlarge record length.
2953 (evax_bfd_print_etir): Likewise.
2955 2017-06-19 Nick Clifton <nickc@redhat.com>
2958 * libieee.h (struct common_header_type): Add end_p field.
2959 * ieee.c (this_byte_and_next): Do not advance input_p beyond
2961 (read_id): Check for a length that exceeds the remaining bytes in
2963 (ieee_seek): Initialise end_p.
2964 (ieee_archive_p): Likewise.
2965 (ieee_object_p): Likewise.
2967 2017-06-19 Nick Clifton <nickc@redhat.com>
2970 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
2971 before reading the EIHS structure entries.
2973 2017-06-19 Nick Clifton <nickc@redhat.com>
2976 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
2977 gsd_size. Check that there are enough bytes remaining to read the
2978 type and size of the next egsd. Check that the size of the egsd
2979 does not exceed the size of the record.
2981 2017-06-19 Alan Modra <amodra@gmail.com>
2983 * config.bfd: Correct targ_underscore for cris.
2985 2017-06-18 Alan Modra <amodra@gmail.com>
2987 * config.bfd: Correct targ_underscore for epiphany, ip2k,
2988 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
2990 2017-06-16 Nick Clifton <nickc@redhat.com>
2992 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
2993 bucketlist is empty because there are no symbols to add to the
2996 2017-06-16 Alan Modra <amodra@gmail.com>
3002 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
3003 (BFD_JUMP_TABLE_LINK): Likewise.
3004 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
3005 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
3006 (bfd_elf_define_start_stop): New function.
3007 * linker.c (bfd_generic_define_start_stop): New function.
3008 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
3010 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
3011 * aout-target.h (MY_bfd_define_start_stop): Define.
3012 * aout-tic30.c (MY_bfd_define_start_stop): Define.
3013 * binary.c (binary_bfd_define_start_stop): Define.
3014 * bout.c (b_out_bfd_define_start_stop): Define.
3015 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
3016 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
3017 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
3018 * coffcode.h (coff_bfd_define_start_stop): Define.
3019 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
3020 * i386msdos.c (msdos_bfd_define_start_stop): Define.
3021 * i386os9k.c (os9k_bfd_define_start_stop): Define.
3022 * ieee.c (ieee_bfd_define_start_stop): Define.
3023 * ihex.c (ihex_bfd_define_start_stop): Define.
3024 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
3025 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
3026 * mmo.c (mmo_bfd_define_start_stop): Define.
3027 * nlm-target.h (nlm_bfd_define_start_stop): Define.
3028 * oasys.c (oasys_bfd_define_start_stop): Define.
3029 * pef.c (bfd_pef_bfd_define_start_stop): Define.
3030 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
3031 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
3032 * som.c (som_bfd_define_start_stop): Define.
3033 * srec.c (srec_bfd_define_start_stop): Define.
3034 * tekhex.c (tekhex_bfd_define_start_stop): Define.
3035 * versados.c (versados_bfd_define_start_stop): Define.
3036 * vms-alpha.c (vms_bfd_define_start_stop): Define.
3037 (alpha_vms_bfd_define_start_stop): Define.
3038 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
3039 * bfd-in2.h: Regenerate.
3040 * libbfd.h: Regenerate.
3042 2017-06-16 Jiong Wang <jiong.wang@arm.com>
3044 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
3045 SYMBOL_REFERENCES_LOCAL.
3047 2017-06-15 Jiong Wang <jiong.wang@arm.com>
3050 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
3051 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
3052 runtime for if there needs copy relocation elimination.
3053 (need_copy_relocation_p): New function. Return true for symbol with
3054 pc-relative references and if it's against read-only sections.
3055 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
3056 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
3057 that are related with accessing external objects.
3058 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
3059 in elfNN_aarch64_check_relocs.
3061 2017-06-15 Nick Clifton <nickc@redhat.com>
3064 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
3067 (ieee_archive_p): Likewise.
3069 2017-06-15 Nick Clifton <nickc@redhat.com>
3072 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
3074 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
3076 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
3077 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
3078 keep both windowed and call0 ABI PLT definitions.
3079 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
3080 elf_xtensa_*_plt_entry endex.
3081 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
3083 2017-06-14 Nick Clifton <nickc@redhat.com>
3086 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
3089 2017-06-14 Nick Clifton <nickc@redhat.com>
3092 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
3093 maximum value for the ascic pointer. Check that name processing
3094 does not read beyond this value.
3095 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
3098 2017-06-14 Nick Clifton <nickc@redhat.com>
3101 * versados.c (versados_mkobject): Zero the allocated tdata structure.
3102 (process_otr): Check for an invalid offset in the otr structure.
3104 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
3106 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
3108 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
3114 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
3115 vtable field to a union.
3116 (_bfd_elf_is_start_stop): Removed.
3117 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
3118 __start_SECNAME and __stop_SECNAME symbols.
3119 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
3120 * elflink.c (_bfd_elf_is_start_stop): Removed.
3121 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
3122 _bfd_elf_is_start_stop.
3123 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
3124 __stop_SECNAME symbols. Updated.
3125 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3126 (bfd_elf_gc_record_vtinherit): Likewise.
3127 (bfd_elf_gc_record_vtentry): Likewise.
3129 2017-06-13 Nick Clifton <nickc@redhat.com>
3132 * elflink.c (elf_link_adjust_relocs): Generate an error when
3133 encountering a reloc against a symbol removed by garbage
3136 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
3138 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
3139 to merge_gnu_properties.
3140 * elf-properties.c (elf_merge_gnu_properties): Add struct
3141 bfd_link_info * and pass it to merge_gnu_properties.
3142 (elf_merge_gnu_property_list): Add struct bfd_link_info *
3143 and pass it to elf_merge_gnu_properties.
3144 (_bfd_elf_link_setup_gnu_properties): Pass info to
3145 elf_merge_gnu_property_list.
3146 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
3148 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
3150 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
3153 * binary.c (binary_set_section_contents): Scale lma by octets
3154 per byte to set filepos.
3156 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3158 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
3161 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3163 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
3166 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3168 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
3169 patched section contents for TLS IE reloc.
3170 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
3172 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3174 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
3175 RELOC_FOR_GLOBAL_SYMBOL macro.
3177 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3179 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
3182 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3184 * config/tc-arc.c (md_undefined_symbol): Changed.
3185 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
3187 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3189 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
3192 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3194 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
3195 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
3197 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3199 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
3202 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
3204 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
3205 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
3206 is non-zero. Add clarifying comments.
3208 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
3210 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
3211 name. Use local IFUNC symbol name string to report unsupported
3212 non-PIC call to IFUNC function.
3213 (elf_i386_relocate_section): Dump local IFUNC name with minfo
3214 when generating R_386_IRELATIVE relocation.
3215 (elf_i386_finish_dynamic_symbol): Likewise.
3216 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
3218 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
3219 when generating R_X86_64_IRELATIVE relocation.
3220 (elf_x86_64_finish_dynamic_symbol): Likewise.
3222 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3224 * elf.c (setup_group): Make sure BFD sections are created for all
3225 group sections in the input file when processing SHF_GROUP
3227 (bfd_section_from_shdr): Avoid duplicating logic already
3228 implemented in `setup_group'.
3230 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
3233 * peXXigen.c (pe_print_idata): Use the address of the first thunk
3234 if the hint address is zero.
3236 2017-06-06 James Clarke <jrtc27@jrtc27.com>
3239 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
3240 ELF_COMMON_DEF_P for common symbols.
3242 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
3244 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
3245 SEC_GROUP sections as SEC_EXCLUDE.
3246 (bfd_elf_set_group_contents): Replace use of abort with an assert.
3247 (assign_section_numbers): Use resolve_section_groups flag instead
3248 of relocatable link type.
3249 (_bfd_elf_init_private_section_data): Use resolve_section_groups
3250 flag instead of checking the final_link flag for part of the
3251 checks in here. Fix white space as a result.
3252 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
3253 instead of relocatable link type.
3254 (bfd_elf_final_link): Likewise.
3256 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3258 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
3260 * elf32-score.c (score_elf_final_link_relocate): Likewise.
3261 (s3_bfd_score_elf_check_relocs): Likewise.
3262 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3263 (score_elf_final_link_relocate): Likewise.
3264 (s7_bfd_score_elf_check_relocs): Likewise.
3266 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3268 * elflink.c (init_reloc_cookie_rels): Remove unused variable
3271 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
3273 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
3274 from `reloc_count' rather than decrementing it.
3275 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
3276 `reloc_count' by `int_rels_per_ext_rel'.
3277 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
3278 `reloc_count' by `int_rels_per_ext_rel' for last relocation
3279 entry determination.
3280 (s3_bfd_score_elf_check_relocs): Likewise.
3281 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
3282 (s7_bfd_score_elf_relocate_section): Likewise.
3283 (s7_bfd_score_elf_check_relocs): Likewise.
3284 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
3285 prototype and function.
3286 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
3287 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
3288 triple rather than once the sum of REL and RELA relocation entry
3290 (bfd_elf64_get_reloc_upper_bound): Remove macro.
3291 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
3292 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
3293 storage allocation size determination.
3294 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
3295 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
3296 by `int_rels_per_ext_rel' for last relocation entry
3298 (bfd_elf_final_link): Do not multiply `reloc_count' by
3299 `int_rels_per_ext_rel' for internal relocation storage
3300 allocation size determination.
3301 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
3302 `int_rels_per_ext_rel' for last relocation entry determination.
3303 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3304 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
3305 (_bfd_mips_elf_relocate_section): Likewise.
3307 2017-06-05 Alan Modra <amodra@gmail.com>
3310 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
3312 2017-06-01 John Baldwin <jhb@FreeBSD.org>
3314 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
3315 determine structure sizes.
3316 (elfcore_grok_freebsd_prstatus): Likewise.
3318 2017-06-01 Alan Modra <amodra@gmail.com>
3320 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
3321 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
3323 (is_elfv2_localentry0): New function.
3324 (ppc64_elf_tls_setup): Default params->plt_localentry0.
3325 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
3326 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
3327 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
3328 optimized localentry:0 stubs.
3329 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
3330 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
3332 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
3334 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3336 2017-05-30 Casey Smith <clegg89@gmail.com>
3339 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
3340 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
3342 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
3344 * cpu-arc.c (arc_compatible): New function.
3346 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
3348 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
3350 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
3353 * bfdio.c (bfd_get_file_size): New function.
3354 * bfd-in2.h: Regenerated.
3356 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
3358 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
3361 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
3363 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
3364 dynobj instead of htab->elf.dynobj.
3366 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
3368 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
3370 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
3371 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
3372 actual number of internal relocations retrieved. Adjust
3373 function description.
3374 (bfd_elf64_canonicalize_reloc): Remove macro.
3375 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
3377 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
3379 * archures.c (bfd_mach_sparc_v9m8): Define.
3380 (bfd_mach_sparc_v8plusm8): Likewise.
3381 (bfd_mach_sparc_v9_p): Adjust to M8.
3382 (bfd_mach_sparc_64bit_p): Likewise.
3383 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
3384 bfd_mach_sparc_v8plusm8.
3385 * bfd-in2.h: Regenerated.
3386 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
3388 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
3389 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
3390 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
3392 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3393 bfd_mach_sparc_v8plusm8.
3395 2017-05-19 Alan Modra <amodra@gmail.com>
3397 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
3398 debug and special sections when no non-note alloc sections in an
3401 2017-05-18 Alan Modra <amodra@gmail.com>
3403 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
3404 * elf-m10300.c: Likewise.
3406 * elf32-arc.c: Likewise.
3407 * elf32-bfin.c: Likewise.
3408 * elf32-m68k.c: Likewise.
3409 * elf32-nds32.c: Likewise.
3410 * elf32-tilepro.c: Likewise.
3411 * elflink.c: Likewise.
3412 * elfnn-aarch64.c: Likewise.
3413 * elfnn-riscv.c: Likewise.
3414 * elfxx-tilegx.c: Likewise.
3415 * mach-o.c: Likewise.
3416 * peXXigen.c: Likewise.
3417 * vms-alpha.c: Likewise.
3418 * vms-lib.c: Likewise.
3420 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3423 * elflink.c (elf_gc_mark_debug_section): New function.
3424 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3425 referenced by kept debug sections.
3427 2017-05-16 Alan Modra <amodra@gmail.com>
3429 * elf-m10300.c: Rename occurrences of non_ir_ref.
3430 * elf32-arm.c: Likewise.
3431 * elf32-bfin.c: Likewise.
3432 * elf32-cr16.c: Likewise.
3433 * elf32-cris.c: Likewise.
3434 * elf32-d10v.c: Likewise.
3435 * elf32-dlx.c: Likewise.
3436 * elf32-fr30.c: Likewise.
3437 * elf32-frv.c: Likewise.
3438 * elf32-hppa.c: Likewise.
3439 * elf32-i370.c: Likewise.
3440 * elf32-i386.c: Likewise.
3441 * elf32-iq2000.c: Likewise.
3442 * elf32-lm32.c: Likewise.
3443 * elf32-m32c.c: Likewise.
3444 * elf32-m32r.c: Likewise.
3445 * elf32-m68hc1x.c: Likewise.
3446 * elf32-m68k.c: Likewise.
3447 * elf32-mcore.c: Likewise.
3448 * elf32-metag.c: Likewise.
3449 * elf32-microblaze.c: Likewise.
3450 * elf32-moxie.c: Likewise.
3451 * elf32-msp430.c: Likewise.
3452 * elf32-mt.c: Likewise.
3453 * elf32-nios2.c: Likewise.
3454 * elf32-or1k.c: Likewise.
3455 * elf32-ppc.c: Likewise.
3456 * elf32-rl78.c: Likewise.
3457 * elf32-s390.c: Likewise.
3458 * elf32-score.c: Likewise.
3459 * elf32-score7.c: Likewise.
3460 * elf32-sh.c: Likewise.
3461 * elf32-tic6x.c: Likewise.
3462 * elf32-tilepro.c: Likewise.
3463 * elf32-v850.c: Likewise.
3464 * elf32-vax.c: Likewise.
3465 * elf32-xstormy16.c: Likewise.
3466 * elf32-xtensa.c: Likewise.
3467 * elf64-alpha.c: Likewise.
3468 * elf64-hppa.c: Likewise.
3469 * elf64-ia64-vms.c: Likewise.
3470 * elf64-mmix.c: Likewise.
3471 * elf64-ppc.c: Likewise.
3472 * elf64-s390.c: Likewise.
3473 * elf64-sh64.c: Likewise.
3474 * elf64-x86-64.c: Likewise.
3475 * elflink.c: Likewise.
3476 * elfnn-aarch64.c: Likewise.
3477 * elfnn-ia64.c: Likewise.
3478 * elfnn-riscv.c: Likewise.
3479 * elfxx-mips.c: Likewise.
3480 * elfxx-sparc.c: Likewise.
3481 * elfxx-tilegx.c: Likewise.
3482 * linker.c: Likewise.
3484 2017-05-16 Alan Modra <amodra@gmail.com>
3486 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3487 * elflink.c (elf_link_add_object_symbols): Update to use
3489 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3491 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3493 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3495 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3497 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3499 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3500 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3502 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3504 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3506 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3508 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3509 to plt_second/plt_second_eh_frame.
3510 (elf_x86_64_link_hash_newfunc): Updated.
3511 (elf_x86_64_allocate_dynrelocs): Likewise.
3512 (elf_x86_64_size_dynamic_sections): Likewise.
3513 (elf_x86_64_relocate_section): Likewise.
3514 (elf_x86_64_finish_dynamic_symbol): Likewise.
3515 (elf_x86_64_finish_dynamic_sections): Likewise.
3516 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3517 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3519 (elf_backend_setup_gnu_properties): Updated. Create the
3520 .plt.sec section instead of the .plt.sec section.
3522 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3524 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3525 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3526 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3528 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3530 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3531 (bfd_elf64_set_reloc): Define.
3532 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3534 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3536 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3537 (struct bfd_target): New field _bfd_set_reloc.
3538 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3539 * reloc.c (_bfd_generic_set_reloc): New function.
3540 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3541 * nlm-target.h (nlm_set_reloc): Likewise.
3542 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3543 * aout-tic30.c (MY_set_reloc): Likewise.
3544 * aout-target.h (MY_set_reloc): Likewise.
3545 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3546 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3547 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3548 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3549 * aout-adobe.c (aout_32_set_reloc): Likewise.
3550 * bout.c (b_out_set_reloc): Likewise.
3551 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3552 * i386os9k.c (aout_32_set_reloc): Likewise.
3553 * ieee.c (ieee_set_reloc): Likewise.
3554 * oasys.c (oasys_set_reloc): Likewise.
3555 * som.c (som_set_reloc): Likewise.
3556 * versados.c (versados_set_reloc): Likewise.
3557 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3558 _bfd_generic_set_reloc.
3559 (rs6000_xcoff64_aix_vec): LIkewise.
3560 * libbfd.c (_bfd_norelocs_set_reloc): New function.
3561 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3562 * i386msdos.c (msdos_set_reloc): Define to
3563 _bfd_norelocs_set_reloc.
3564 * elfcode.h (elf_set_reloc): Define.
3565 * bfd-in2.h: Regenerated.
3567 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
3570 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3571 for IFUNC function address.
3573 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
3575 * elf32-arc.c (FEATURE_LIST_NAME): Define.
3576 (CONFLICT_LIST): Likewise.
3577 (opcode/arc-attrs.h): Include.
3578 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3579 (arc_extract_features): New file.
3580 (arc_stralloc): Likewise.
3581 (arc_elf_merge_attributes): Likewise.
3582 (arc_elf_merge_private_bfd_data): Use object attributes.
3583 (bfd_arc_get_mach_from_attributes): New function.
3584 (arc_elf_object_p): Use object attributes.
3585 (arc_elf_final_write_processing): Likewise.
3586 (elf32_arc_obj_attrs_arg_type): New function.
3587 (elf32_arc_obj_attrs_handle_unknown): Likewise.
3588 (elf32_arc_section_from_shdr): Likewise.
3589 (elf_backend_obj_attrs_vendor): Define.
3590 (elf_backend_obj_attrs_section): Likewise.
3591 (elf_backend_obj_attrs_arg_type): Likewise.
3592 (elf_backend_obj_attrs_section_type): Likewise.
3593 (elf_backend_obj_attrs_handle_unknown): Likewise.
3594 (elf_backend_section_from_shdr): Likewise.
3596 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
3599 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3600 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3601 and the destination is a Thumb symbol.
3603 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3605 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3606 initializer to silence GCC 4.2.
3607 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3609 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3611 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3612 (LAZY_PLT_ENTRY_SIZE): This.
3613 (NON_LAZY_PLT_ENTRY_SIZE): New.
3614 (elf_x86_64_plt0_entry): Renamed to ...
3615 (elf_x86_64_lazy_plt0_entry): This.
3616 (elf_x86_64_plt_entry): Renamed to ...
3617 (elf_x86_64_lazy_plt_entry): This.
3618 (elf_x86_64_bnd_plt0_entry): Renamed to ...
3619 (elf_x86_64_lazy_bnd_plt0_entry): This.
3620 (elf_x86_64_legacy_plt_entry): Removed.
3621 (elf_x86_64_bnd_plt_entry): Renamed to ...
3622 (elf_x86_64_lazy_bnd_plt_entry): This.
3623 (elf_x86_64_legacy_plt2_entry): Renamed to ...
3624 (elf_x86_64_non_lazy_plt_entry): This.
3625 (elf_x86_64_bnd_plt2_entry): Renamed to ...
3626 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3627 (elf_x86_64_eh_frame_plt): Renamed to ...
3628 (elf_x86_64_eh_frame_lazy_plt): This.
3629 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3630 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3631 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3632 (elf_x86_64_eh_frame_non_lazy_plt): This.
3633 (elf_x86_64_lazy_plt_layout): New.
3634 (elf_x86_64_non_lazy_plt_layout): Likewise.
3635 (elf_x86_64_plt_layout): Likewise.
3636 (elf_x86_64_backend_data): Remove PLT layout information. Add
3637 os for target system.
3638 (GET_PLT_ENTRY_SIZE): Removed.
3639 (elf_x86_64_lazy_plt): New.
3640 (elf_x86_64_non_lazy_plt): Likewise.
3641 (elf_x86_64_lazy_bnd_plt): Likewise.
3642 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3643 (elf_x86-64_arch_bed): Updated.
3644 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3645 (elf_x86_64_create_dynamic_sections): Removed.
3646 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3647 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3648 (elf_x86-64_adjust_dynamic_symbol): Updated.
3649 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3650 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3651 size for PLT0 if there is no PLT0. Get plt_entry_size from
3652 non_lazy_plt for non-lazy PLT entries.
3653 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3654 from non_lazy_plt for non-lazy PLT entries.
3655 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3656 if there is no PLT0.
3657 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3658 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3659 entries with non-lazy PLT layout. Don't fill the second and third
3660 slots in the PLT entry if there is no PLT0.
3661 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3662 if there is no PLT0. Set sh_entsize on the .plt.got section.
3663 (compare_relocs): New.
3664 (elf_x86_64_plt_type): Likewise.
3665 (elf_x86_64_plt): Likewise.
3666 (elf_x86_64_nacl_plt): New. Forward declaration.
3667 (elf_x86_64_get_plt_sym_val): Removed.
3668 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3669 against all dynamic relocations.
3670 (elf_x86_64_link_setup_gnu_properties): New function.
3671 (elf_backend_create_dynamic_sections): Updated.
3672 (elf_backend_setup_gnu_properties): New.
3673 (elf_x86_64_nacl_plt): New.
3674 (elf_x86_64_nacl_arch_bed): Updated.
3676 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3678 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3679 (LAZY_PLT_ENTRY_SIZE): This.
3680 (NON_LAZY_PLT_ENTRY_SIZE): New.
3681 (elf_i386_plt0_entry): Renamed to ...
3682 (elf_i386_lazy_plt0_entry): This.
3683 (elf_i386_plt_entry): Renamed to ...
3684 (elf_i386_lazy_plt_entry): This.
3685 (elf_i386_pic_plt0_entry): Renamed to ...
3686 (elf_i386_pic_lazy_plt0_entry): This.
3687 (elf_i386_pic_plt_entry): Renamed to ...
3688 (elf_i386_pic_lazy_plt_entry): This.
3689 (elf_i386_got_plt_entry): Renamed to ...
3690 (elf_i386_non_lazy_plt_entry): This.
3691 (elf_i386_pic_got_plt_entry): Renamed to ...
3692 (elf_i386_pic_non_lazy_plt_entry): This.
3693 (elf_i386_eh_frame_plt): Renamed to ...
3694 (elf_i386_eh_frame_lazy_plt): This.
3695 (elf_i386_eh_frame_plt_got): Renamed to ...
3696 (elf_i386_eh_frame_non_lazy_plt): This.
3697 (elf_i386_plt_layout): Renamed to ...
3698 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3699 eh_frame_plt_got_size.
3700 (elf_i386_non_lazy_plt_layout): New.
3701 (elf_i386_plt_layout): Likewise.
3702 (elf_i386_non_lazy_plt): Likewise.
3703 (GET_PLT_ENTRY_SIZE): Removed.
3704 (elf_i386_plt): Renamed to ...
3705 (elf_i386_lazy_plt): This.
3706 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3707 (elf_i386_arch_bed): Updated.
3708 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3709 (elf_i386_create_dynamic_sections): Removed.
3710 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3711 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3712 (elf_i386_adjust_dynamic_symbol): Updated.
3713 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3714 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3715 size for PLT0 if there is no PLT0.
3716 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3717 output section is discarded only if GOT isn't empty.
3718 (elf_i386_relocate_section): Updated. Properly get PLT index
3719 if there is no PLT0.
3720 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3721 second and third slots in the PLT entry if there is no PLT0.
3722 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3723 if there is no PLT0. Set sh_entsize on the .plt.got section.
3724 (elf_i386_nacl_plt): Forward declaration.
3725 (elf_i386_get_plt_sym_val): Removed.
3726 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3727 against all dynamic relocations.
3728 (elf_i386_link_setup_gnu_properties): New function.
3729 (elf_backend_create_dynamic_sections): Updated.
3730 (elf_backend_setup_gnu_properties): New.
3731 (elf_i386_nacl_plt): Updated.
3732 (elf_i386_nacl_arch_bed): Likewise.
3733 (elf_i386_vxworks_arch_bed): Likewise.
3735 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3737 * elflink.c (elf_output_implib): Remove executable flag from import
3739 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3740 library is a relocatable object file.
3742 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3745 * elf32-avr.c (avr_should_move_sym): New function.
3746 (avr_should_reduce_sym_size): Likewise.
3747 (avr_should_increase_sym_size): Likewise.
3748 (elf32_avr_relax_delete_bytes): Adjust symbol values
3749 and sizes by calling new functions.
3751 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3753 * config.bfd (riscv32-*): Enable rv64.
3755 2017-05-02 Alan Modra <amodra@gmail.com>
3758 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3759 rather than h->root.type == bfd_link_hash_new.
3760 (bfd_elf_record_link_assignment): Similarly, call
3761 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3763 2017-04-29 Alan Modra <amodra@gmail.com>
3766 * reloc.c (reloc_offset_in_range): New function.
3767 (bfd_perform_relocation, bfd_install_relocation): Use it.
3768 (_bfd_final_link_relocate): Likewise.
3770 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3772 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3773 before using .plt.got.
3774 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3776 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3778 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3779 instead of "+=" to update 0.
3781 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3783 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3784 .plt.got section here.
3785 (elf_i386_check_relocs): Don't create the .plt.got section.
3786 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3787 the .plt.got and .plt.bnd sections here.
3788 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3791 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3793 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3795 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3796 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3797 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3798 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3801 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3803 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3805 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3806 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3807 the first relocatable ELF input with GNU properties.
3809 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3811 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3812 VxWorks for non-PIC.
3814 2017-04-27 Alan Modra <amodra@gmail.com>
3816 * elf-bfd.h (struct elf_backend_data): Make asection param of
3817 elf_backend_eh_frame_address_size const.
3818 (_bfd_elf_eh_frame_address_size): Likewise.
3819 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3820 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3821 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3822 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3823 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3824 (next_cie_fde_offset): Constify params.
3825 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3827 2017-04-27 Alan Modra <amodra@gmail.com>
3829 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3830 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3831 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3833 (offset_adjust): New function.
3834 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3835 (adjust_eh_frame_local_symbols): Likewise.
3836 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3837 after changing anything. Return true if anything changed.
3838 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3839 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3841 2017-04-27 Alan Modra <amodra@gmail.com>
3843 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3846 2017-04-27 Alan Modra <amodra@gmail.com>
3848 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3849 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3850 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3851 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3852 for undef and undefweak dyn_relocs.
3853 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3854 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3855 (allocate_got, allocate_dynrelocs): Likewise.
3856 (ppc64_elf_relocate_section): Likewise.
3858 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3860 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3861 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3862 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3863 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3865 2017-04-26 Nick Clifton <nickc@redhat.com>
3868 * reloc.c (bfd_perform_relocation): Check for a negative address
3871 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3874 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3876 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3877 (elf_backend_always_renumber_dynsyms): Define.
3878 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3879 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3880 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3881 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3883 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3885 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3887 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3888 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3889 sections have been created.
3891 2017-04-26 Nick Clifton <nickc@redhat.com>
3894 * compress.c (bfd_init_section_compress_status): Check the return
3895 value from bfd_malloc.
3897 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3899 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3900 no_finish_dynamic_symbol.
3901 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3903 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3904 weak symbol, don't make it dynamic.
3905 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3906 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3907 relocation for GOT reference.
3908 (elf_x86_64_finish_dynamic_symbol): Abort if
3909 no_finish_dynamic_symbol isn't 0.
3911 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3914 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3915 undefined weak symbol, don't make it dynamic.
3916 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3917 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3918 relocation for R_386_GOT32.
3920 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3923 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3925 2017-04-23 Alan Modra <amodra@gmail.com>
3928 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3929 * elf.c (lcomm_sym): New.
3930 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3931 * bfd-in2.h: Regenerate.
3933 2017-04-23 Alan Modra <amodra@gmail.com>
3936 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3937 parameters and comment.
3938 (_bfd_elf_get_reloc_section): Delete.
3939 (_bfd_elf_plt_get_reloc_section): Declare.
3940 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3941 New functions. Don't blindly skip over assumed .rel/.rela prefix.
3943 (_bfd_elf_get_reloc_section): ..here. Delete.
3944 (assign_section_numbers): Call elf_get_reloc_section.
3945 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
3946 * elfxx-target.h (elf_backend_get_reloc_section): Update.
3948 2017-04-23 Alan Modra <amodra@gmail.com>
3951 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
3954 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3957 * elf32-i386.c (elf_i386_link_hash_entry): Add
3958 no_finish_dynamic_symbol.
3959 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
3960 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
3961 symbol, don't make it dynamic in PIE.
3962 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
3963 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3964 relocation for R_386_GOT32
3965 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
3968 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3972 * elflink.c (elf_link_add_object_symbols): Require
3973 --no-dynamic-linker with -E/--dynamic-list when creating
3976 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3978 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
3981 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3983 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
3984 dynamic symbol sorting.
3986 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
3989 * elflink.c (elf_link_add_object_symbols): Preserve
3990 dynamic_ref_after_ir_def when restoring the symbol table for
3991 unneeded dynamic object.
3993 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
3996 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
3997 on on undefined IFUNC symbol in the second PLT.
3999 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
4001 * peXXigen.c (pe_print_reloc): Correct chunk_end.
4003 2017-04-19 Alan Modra <amodra@gmail.com>
4005 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
4006 or make dynamic for info->dynamic_undefined_weak 0 and 1.
4007 * elf32-ppc.c:Formatting.
4008 (ensure_undefweak_dynamic): Don't make dynamic when
4009 info->dynamic_undefined_weak is zero.
4010 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4011 info->dynamic_undefined_weak. Discard undef dyn_relocs when
4012 not default visibility. Discard undef and undefweak
4014 (ppc_elf_relocate_section): Adjust to suit.
4015 * elf64-ppc.c: Formatting.
4016 (ensure_undefweak_dynamic): Don't make dynamic when
4017 info->dynamic_undefined_weak is zero.
4018 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4019 info->dynamic_undefined_weak. Discard them earlier.
4021 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
4024 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
4025 before generating the version definition section.
4027 2017-04-17 Alan Modra <amodra@gmail.com>
4029 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
4030 state when a regular object file defines a symbol with
4031 incompatible type to that defined by an earlier shared lib.
4033 2017-04-13 Alan Modra <amodra@gmail.com>
4035 * coffcode.h: Wrap some overly long _bfd_error_handler args.
4037 * elf32-arm.c: Likewise.
4038 * elf32-i386.c: Likewise.
4039 * elf32-mep.c: Likewise.
4040 * elf64-ia64-vms.c: Likewise.
4041 * elf64-x86-64.c: Likewise.
4042 * elflink.c: Likewise.
4043 * elfnn-ia64.c: Likewise.
4044 * elfxx-mips.c: Likewise.
4046 2017-04-13 Alan Modra <amodra@gmail.com>
4048 * aoutx.h: Use %B and %A in error messages throughout file.
4049 * aout-cris.c: Likewise.
4050 * archive.c: Likewise.
4051 * binary.c: Likewise.
4052 * coff-rs6000.c: Likewise.
4053 * coff-tic4x.c: Likewise.
4054 * coffcode.h: Likewise.
4055 * coffgen.c: Likewise.
4056 * cofflink.c: Likewise.
4057 * coffswap.h: Likewise.
4058 * cpu-arm.c: Likewise.
4059 * elf-eh-frame.c: Likewise.
4060 * elf-m10300.c: Likewise.
4062 * elf32-arc.c: Likewise.
4063 * elf32-arm.c: Likewise.
4064 * elf32-bfin.c: Likewise.
4065 * elf32-frv.c: Likewise.
4066 * elf32-iq2000.c: Likewise.
4067 * elf32-m32c.c: Likewise.
4068 * elf32-microblaze.c: Likewise.
4069 * elf32-nds32.c: Likewise.
4070 * elf32-rl78.c: Likewise.
4071 * elf32-rx.c: Likewise.
4072 * elf32-score.c: Likewise.
4073 * elf32-score7.c: Likewise.
4074 * elf32-sh64.c: Likewise.
4075 * elf32-v850.c: Likewise.
4076 * elf32-vax.c: Likewise.
4077 * elf32-visium.c: Likewise.
4078 * elf64-ia64-vms.c: Likewise.
4079 * elf64-mmix.c: Likewise.
4080 * elf64-sh64.c: Likewise.
4081 * elfcode.h: Likewise.
4082 * elfnn-aarch64.c: Likewise.
4083 * elfnn-ia64.c: Likewise.
4084 * elfxx-mips.c: Likewise.
4085 * hpux-core.c: Likewise.
4088 * linker.c: Likewise.
4089 * merge.c: Likewise.
4091 * oasys.c: Likewise.
4092 * pdp11.c: Likewise.
4093 * peXXigen.c: Likewise.
4094 * rs6000-core.c: Likewise.
4095 * vms-alpha.c: Likewise.
4096 * xcofflink.c: Likewise.
4098 2017-04-13 Alan Modra <amodra@gmail.com>
4100 * bfd.c (PRINT_TYPE): Define.
4101 (_doprnt): New function.
4102 (error_handler_internal): Use _doprnt.
4103 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
4104 calls in their natural order, throughout file.
4105 * coff-mcore.c: Likewise.
4106 * coff-ppc.c: Likewise.
4107 * coff-tic80.c: Likewise.
4108 * cofflink.c: Likewise.
4109 * elf-s390-common.c: Likewise.
4111 * elf32-arm.c: Likewise.
4112 * elf32-i386.c: Likewise.
4113 * elf32-m32r.c: Likewise.
4114 * elf32-msp430.c: Likewise.
4115 * elf32-spu.c: Likewise.
4116 * elf64-ia64-vms.c: Likewise.
4117 * elf64-sparc.c: Likewise.
4118 * elf64-x86-64.c: Likewise.
4119 * elflink.c: Likewise.
4120 * elfnn-aarch64.c: Likewise.
4121 * elfnn-ia64.c: Likewise.
4122 * elfxx-mips.c: Likewise.
4124 2017-04-13 Alan Modra <amodra@gmail.com>
4126 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
4127 branch veneers" error. Fix double space and format message.
4128 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
4129 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
4131 2017-04-13 Alan Modra <amodra@gmail.com>
4133 * bfd-in2.h: Regenerate.
4135 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4137 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
4138 extra `\n' in warning/error messages.
4139 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
4140 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4142 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4144 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
4145 processor-specific properties with generic ELF target vector.
4147 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
4149 * elf32-sparc.c (elf_backend_fixup_symbol): New.
4150 * elf64-sparc.c (elf_backend_fixup_symbol): New.
4151 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
4152 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
4154 (link_hash_newfunc): Initialize has_got_reloc and
4156 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
4158 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
4160 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
4162 (_bfd_sparc_elf_fixup_symbol): New function.
4163 (allocate_dynrelocs): Don't allocate space for dynamic
4164 relocations and discard relocations against resolved undefined
4165 weak symbols in executable. Don't make resolved undefined weak
4166 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
4167 relocation against undefined weak symbols in PIE.
4168 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
4169 relocations against resolved undefined weak symbols in PIE
4170 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
4171 without ynamic PLT/GOT relocations for resolved undefined weak
4173 Don't generate dynamic relocation against resolved undefined
4174 weak symbol in executable.
4175 (pie_finish_undefweak_symbol): New function.
4176 (_bfd_sparc_elf_finish_dynamic_sections): Call
4177 pie_finish_undefweak_symbol on all symbols in PIE.
4178 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
4179 (_bfd_sparc_elf_fixup_symbol): New function.
4181 2017-04-10 Nick Clifton <nickc@redhat.com>
4183 * config.bfd: Remove ns32k from obsolete list.
4185 2017-04-10 Alan Modra <amodra@gmail.com>
4188 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
4189 (special_sections_i): Likewise for .init_array.
4190 (special_sections_p): Likewise for .preinit_array.
4192 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
4196 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
4197 ELF_COMMON_DEF_P for common symbols.
4198 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4199 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
4200 * elflink.c (_bfd_elf_merge_symbol): Revert commits
4201 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
4202 07492f668d2173da7a2bda3707ff0985e0f460b6.
4204 2017-04-07 Pedro Alves <palves@redhat.com>
4206 * opncls.c (bfd_get_debug_link_info): Rename to...
4207 (bfd_get_debug_link_info_1): ... this. Change type of second
4208 parameter to void pointer. Adjust.
4209 (bfd_get_debug_link_info): Reimplement on top of
4210 bfd_get_debug_link_info_1.
4211 (separate_debug_file_exists, separate_alt_debug_file_exists):
4212 Change type of second parameter to void pointer. Adjust.
4213 (get_func_type, check_func_type): Change type of second parameter
4215 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
4216 the callback functions instead of passing the address of a local.
4217 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
4218 find_separate_debug_file.
4219 (get_alt_debug_link_info_shim): Change type of second parameter to
4220 void pointer. Adjust.
4221 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
4222 find_separate_debug_file.
4223 (get_build_id_name, bfd_boolean check_build_id_file): Change type
4224 of second parameter to void pointer. Adjust.
4225 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
4226 pointer local to find_separate_debug_file.
4228 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
4230 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
4231 external symbols with a definition.
4232 (_bfd_coff_gc_mark_extra_sections): Fix typo.
4234 2017-04-07 Alan Modra <amodra@gmail.com>
4236 * po/SRC-POTFILES.in: Regenerate.
4238 2017-04-05 Alan Modra <amodra@gmail.com>
4240 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
4243 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
4245 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
4246 numbers for DataDirectory entry indicies passed to
4249 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
4251 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
4252 each GNU_MBIND section and align GNU_MBIND section to page size.
4253 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
4254 segment for each GNU_MBIND section.
4255 (_bfd_elf_init_private_section_data): Copy sh_info from input
4256 for GNU_MBIND section.
4258 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
4260 * elfnn-riscv.c (GP_NAME): Delete.
4261 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
4262 (_bfd_riscv_relax_lui): Likewise.
4264 2017-04-04 Nick Clifton <nickc@redhat.com>
4267 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
4269 (bfd_elf_final_link): Only initialize the extended symbol index
4270 section if there are extended symbol tables to list.
4272 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
4274 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
4275 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
4276 * configure.ac (elf): Add elf-properties.lo.
4277 * Makefile.in: Regenerated.
4278 * configure: Likewise.
4279 * elf-bfd.h (elf_property_kind): New.
4280 (elf_property): Likewise.
4281 (elf_property_list): Likewise.
4282 (elf_properties): Likewise.
4283 (_bfd_elf_parse_gnu_properties): Likewise.
4284 (_bfd_elf_get_property): Likewise.
4285 (_bfd_elf_link_setup_gnu_properties): Likewise.
4286 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
4287 and setup_gnu_properties.
4288 (elf_obj_tdata): Add properties.
4289 * elf-properties.c: New file.
4290 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
4291 (elf_i386_merge_gnu_properties): Likewise.
4292 (elf_backend_parse_gnu_properties): Likewise.
4293 (elf_backend_merge_gnu_properties): Likewise.
4294 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4295 (elf_x86_64_merge_gnu_properties): Likewise.
4296 (elf_backend_parse_gnu_properties): Likewise.
4297 (elf_backend_merge_gnu_properties): Likewise.
4298 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
4299 (elf_backend_parse_gnu_properties): Likewise.
4300 (elf_backend_setup_gnu_properties): Likewise.
4301 (elfNN_bed): Add elf_backend_parse_gnu_properties,
4302 elf_backend_merge_gnu_properties and
4303 elf_backend_setup_gnu_properties.
4305 2017-03-30 Pip Cet <pipcet@gmail.com>
4307 * elf32-wasm32.c: Add relocation code, two relocs.
4308 * reloc.c: Add wasm32 relocations.
4309 * libbfd.h: Regenerate.
4310 * bfd-in2.h: Regenerate.
4311 * bfd/po/bfd.pot: Regenerate.
4313 2017-03-29 Nick Clifton <nickc@redhat.com>
4316 * coff-bfd.h (struct coff_section_data): Add new fields:
4317 saved_bias and bias.
4318 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
4319 computed for PE binaries.
4320 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
4323 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
4326 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
4327 to handle a local symbol with a hash-symbol-entry; without PLT.
4328 Add BFD_ASSERT for an incidental case with GOT entry present.
4329 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
4330 isn't forced-or-set local.
4332 2017-03-27 Pip Cet <pipcet@gmail.com>
4334 * wasm-module.c: New file to support WebAssembly modules.
4335 * wasm-module.h: New file to support WebAssembly modules.
4336 * doc/webassembly.texi: Start documenting wasm-module.c.
4337 * config.bfd: Add wasm_vec.
4338 * targets.c: Likewise.
4339 * configure.ac: Likewise.
4340 * Makefile.am: Add entries for wasm-module.c.
4341 * Makefile.in: Regenerate.
4342 * configure: Regenerate.
4343 * po/SRC-POTFILES.in: Regenerate.
4345 2017-03-27 Pip Cet <pipcet@gmail.com>
4347 * cpu-wasm32.c: New file to support wasm32 architecture.
4348 * elf32-wasm32.c: New file to support wasm32 architecture.
4349 * Makefile.am: Add wasm32 architecture.
4350 * archures.c: Likewise.
4351 * config.bfd: Likewise.
4352 * configure.ac: Likewise.
4353 * targets.c: Likewise.
4354 * Makefile.in: Regenerate.
4355 * bfd-in2.h: Regenerate.
4356 * configure: Regenerate.
4357 * po/SRC-POTFILES.in: Regenerate.
4359 2017-03-20 Alan Modra <amodra@gmail.com>
4362 * elf64-ppc.c (compare_symbols): Stabilize sort.
4364 2017-03-18 Alan Modra <amodra@gmail.com>
4366 * elf64-ppc.c (struct ppc_link_hash_table): Add
4367 local_ifunc_resolver and maybe_local_ifunc_resolver.
4368 (ppc_build_one_stub): Set flags on emitting dynamic
4369 relocation to ifunc.
4370 (ppc64_elf_relocate_section): Likewise.
4371 (ppc64_elf_finish_dynamic_symbol): Likewise.
4372 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
4373 local dynamic relocs to ifuncs.
4374 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
4375 local_ifunc_resolver and maybe_local_ifunc_resolver.
4376 (ppc_elf_relocate_section): Set flag on emitting dynamic
4377 relocation to ifuncs.
4378 (ppc_elf_finish_dynamic_symbol): Likewise.
4379 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
4380 dynamic relocs to ifuncs.
4382 2017-03-13 Nick Clifton <nickc@redhat.com>
4385 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
4386 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
4387 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
4388 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
4389 * bfd-in2.h: Regenerate.
4390 * libbfd.h: Regenerate.
4391 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
4393 (IS_AARCH64_TLSDESC_RELOC): Likewise.
4394 (elfNN_aarch64_howto_table): Likewise.
4395 (aarch64_tls_transition_without_check): Likewise.
4396 (aarch64_reloc_got_type): Likewise.
4397 (elfNN_aarch64_final_link_relocate): Likewise.
4398 (elfNN_aarch64_tls_relax): Likewise.
4399 (elfNN_aarch64_relocate_section): Likewise.
4400 (elfNN_aarch64_gc_sweep_hook): Likewise.
4401 (elfNN_aarch64_check_relocs): Likewise.
4402 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4403 (_bfd_aarch64_elf_resolve_relocation): Likewise.
4405 2017-03-11 Alan Modra <amodra@gmail.com>
4407 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
4408 parameter is in fact used. Whitespace fixes.
4409 * elf64-ppc.c: Likewise.
4411 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4413 * rs6000-core.c (CORE_NEW): Simplify macro when
4414 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4416 2017-03-07 Alan Modra <amodra@gmail.com>
4420 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4423 2017-03-05 Alan Modra <amodra@gmail.com>
4425 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4426 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4427 (next_cie_fde_offset): New function.
4428 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4429 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4430 four bytes. Align CIEs to four or eight bytes depending on
4431 per_encoding_aligned8. Align FDEs according to their encoding.
4432 Pad last FDE to output section alignment.
4433 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4435 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4436 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4437 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4439 2017-03-02 Martin Bickel <binutils@ineranves.de>
4442 * elf.c (rewrite_elf_program_header): Do not issue a warning for
4443 empty segments which have a zero filesz, but a non-zero memsz.
4445 2017-03-02 Alan Modra <amodra@gmail.com>
4447 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4449 2017-02-28 Alan Modra <amodra@gmail.com>
4451 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4452 (ppc64_elf_relocate_section): Likewise.
4454 2017-02-28 Alan Modra <amodra@gmail.com>
4457 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4458 rather than elf32_nios2_hash_table or elf_hash_table.
4459 (create_got_section): Likewise.
4460 (nios2_elf32_finish_dynamic_symbol): Likewise.
4461 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4462 (nios2_elf32_size_dynamic_sections): Likewise.
4463 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4464 vars. Use htab equivalents directly instead. Don't create
4465 all dynamic sections on needing just the GOT. Use a goto
4466 rather than a fall-through with reloc test. Ensure
4467 htab->dynobj is set when making dynamic sreloc section.
4468 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4469 equivalent directly instead. Don't segfault on looking for
4470 .dynamic when dynamic sections have not been created. Don't
4471 segfault on .got.plt being discarded.
4472 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4473 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4474 fixme and another not so relevant comment.
4475 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4476 already set, set hash table dynobj on creating .sbss.
4478 2017-02-28 Alan Modra <amodra@gmail.com>
4480 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4481 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4482 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4483 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4484 (ppc64_elf_relocate_section): Likewise.
4485 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4486 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4487 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4488 * libbfd.h: Regenerate.
4489 * bfd-in2.h: Regenerate.
4491 2017-02-28 Alan Modra <amodra@gmail.com>
4493 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4494 dynamic .data.rel.ro read-only.
4495 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4496 rather than section flags when deciding where copy reloc goes.
4497 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4498 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4499 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4500 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4501 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4502 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4503 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4504 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4505 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4506 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4507 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4508 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4509 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4510 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4511 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4512 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4513 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4514 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4515 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4517 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4519 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4520 `jalr $0, $25' instruction encoding.
4522 2017-02-27 Nick Clifton <nickc@redhat.com>
4525 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4526 generating a seg-fault when encountering a symbol that has been
4527 deleted by garbage collection.
4529 2017-02-25 Alan Modra <amodra@gmail.com>
4531 * elf32-arc.c (struct dynamic_sections): Delete.
4532 (enum dyn_section_types): Delete.
4533 (dyn_section_names): Delete.
4534 (arc_create_dynamic_sections): Delete.
4535 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
4536 segfault on discarded .rela.plt section.
4537 (elf_arc_size_dynamic_sections): Formatting. Don't call
4538 arc_create_dynamic_sections. Don't allocate memory for sections
4539 handled by the generic linker. Correct code finding relocs in
4540 read-only sections. Set SEC_EXCLUDE on zero size .got,
4541 .got.plt, and .dynbss sections. Do set .interp for pies.
4543 2017-02-24 Andrew Waterman <andrew@sifive.com>
4545 * elfnn-riscv.c (GP_NAME): New macro.
4546 (riscv_global_pointer_value): Use it.
4547 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4548 output section, consider only that section's alignment.
4550 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4552 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4553 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4554 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4555 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4557 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4559 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4560 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4563 2017-02-23 Alan Modra <amodra@gmail.com>
4566 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4568 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4569 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4572 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
4575 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4576 processing ahead of the call to `elf_gc_sweep_symbol'.
4578 2017-02-22 Nick Clifton <nickc@redhat.com>
4581 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4582 created section 4-byte alignment.
4584 2017-02-22 Alan Modra <amodra@gmail.com>
4586 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4587 on .got or .plt output section being discarded by script.
4588 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
4591 2017-02-21 Alan Modra <amodra@gmail.com>
4593 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4594 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4596 2017-02-20 Alan Modra <amodra@gmail.com>
4599 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4600 if DT_RELSZ/DT_RELASZ is zero.
4602 2017-02-17 Nick Clifton <nickc@redhat.com>
4604 * compress.c (bfd_get_full_section_contents): Remember to reduce
4605 compressed size by the sizeof the compression header when
4606 decompressing the contents.
4608 2017-02-17 Pedro Alves <palves@redhat.com>
4610 * srec.c (Chunk): Rename to ...
4611 (_bfd_srec_len): ... this.
4612 (S3Forced): Rename to ...
4613 (_bfd_srec_forceS3): ... this.
4614 * objcopy.c: Adjust all references.
4616 2017-02-17 Pedro Alves <palves@redhat.com>
4618 * archive.c (bsd_write_armap): Rename to ...
4619 (_bfd_bsd_write_armap): ... this.
4620 (coff_write_armap): Rename to ...
4621 (_bfd_coff_write_armap): ... this.
4622 * libbfd-in.h (bsd_write_armap): Rename to ...
4623 (_bfd_bsd_write_armap): ... this.
4624 (coff_write_armap): Rename to ...
4625 (_bfd_coff_write_armap): ... this.
4626 * aout-target.h, aout-tic30.c: Adjust all users.
4627 * libbfd.h: Regenerate.
4629 2017-02-17 Pedro Alves <palves@redhat.com>
4631 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4632 (warn_deprecated): Rename to ...
4633 (_bfd_warn_deprecated): ... this.
4634 * libbfd.c (warn_deprecated): Rename to ...
4635 (_bfd_warn_deprecated): ... this.
4636 * bfd-in2.h: Regenerate.
4638 2017-02-17 Pedro Alves <palves@redhat.com>
4640 * bfdio.c (real_ftell): Rename to ...
4641 (_bfd_real_ftell): ... this.
4642 (real_fseek): Rename to ...
4643 (_bfd_real_fseek): ... this.
4644 (real_fopen): Rename to ...
4645 (_bfd_real_fopen): ... this.
4646 * libbfd-in.h (real_ftell): Rename to ...
4647 (_bfd_real_ftell): ... this.
4648 (real_fseek): Rename to ...
4649 (_bfd_real_fseek): ... this.
4650 (real_fopen): Rename to ...
4651 (_bfd_real_fopen): ... this.
4652 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4653 * libbfd.h: Regenerate.
4655 2017-02-17 Pedro Alves <palves@redhat.com>
4657 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4658 * libbfd.c (read_unsigned_leb128): Rename to ...
4659 (_bfd_read_unsigned_leb128): ... this.
4660 (read_signed_leb128): Rename to ...
4661 (_bfd_read_signed_leb128): ... this.
4662 (safe_read_leb128): Rename to ...
4663 (_bfd_safe_read_leb128): ... this.
4664 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4665 (_bfd_read_unsigned_leb128): ... this.
4666 (read_signed_leb128): Rename to ...
4667 (_bfd_read_signed_leb128): ... this.
4668 (safe_read_leb128): Rename to ...
4669 (_bfd_safe_read_leb128): ... this.
4670 * libbfd.h: Renegerate.
4672 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4674 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4675 before trying to fine matching file and line information.
4677 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4679 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4680 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4681 not match current bfd, then reload debug information. Record bfd
4682 we're loading debug info for in the stash. If we have debug
4683 informatin in the cache then perform section placement before
4686 2017-02-16 Alan Modra <amodra@gmail.com>
4689 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4690 * elfxx-target.h (elf_backend_no_page_alias): Define.
4691 (elfNN_bed): Init new field.
4692 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4693 ensure PT_LOAD segment starts on a new page.
4694 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4696 2017-02-16 Alan Modra <amodra@gmail.com>
4699 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4702 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4704 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4705 * bfd-in2.h: Regenerated.
4707 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4710 * elf32-i386.c (elf_i386_relocate_section): Allow
4711 "lea foo@GOT, %reg" in PIC.
4713 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4716 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4717 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4718 error against local IFUNC symbol without a base register for
4721 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4723 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4724 `%P: %H:' with `info->callbacks->einfo'.
4725 (ppc_elf_relocate_section): Likewise.
4726 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4727 (ppc64_elf_edit_toc): Likewise.
4728 (ppc64_elf_relocate_section): Likewise.
4730 2017-02-14 Alan Modra <amodra@gmail.com>
4732 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4733 --gc-keep-exported, and test versioned field of sym rather than
4734 looking for @ in name.
4736 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4738 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4741 2017-02-13 Nick Clifton <nickc@redhat.com>
4744 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4747 2017-02-07 Andrew Waterman <andrew@sifive.com>
4749 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4750 entry size if PLT header is written.
4752 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4754 Fix sparc64 dynamic relocation processing to use the dynamic
4756 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4757 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4760 2017-02-03 Nick Clifton <nickc@redhat.com>
4763 * coffcode.h (coff_write_object_contents): Enlarge size of
4764 s_name_buf in order to avoid compile time warning about possible
4766 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4767 32-bits of insn value before printing into buffer.
4769 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4771 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4772 `max_local_dynindx'.
4773 (mips_elf_sort_hash_table): Handle it.
4774 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4775 symbols bump up `max_local_dynindx' rather than
4776 `max_non_got_dynindx'.
4778 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4780 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4781 `min_got_dynindx', `max_unref_got_dynindx' and
4782 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4783 (mips_elf_sort_hash_table): Adjust accordingly.
4785 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4787 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4788 to access the hash table.
4790 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4792 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4793 non-NULL `htab' to the beginning.
4795 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4797 * elflink.c (elf_gc_sweep): Wrap overlong line.
4799 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4801 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4802 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4803 * elfxx-mips.c (mips_elf_link_hash_table): Add
4804 `ignore_branch_isa' member.
4805 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4806 in branch relocation calculation as an error if
4807 `ignore_branch_isa' has been set.
4808 (_bfd_mips_elf_insn32): Rename to...
4809 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4810 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4811 Handle the new parameter.
4813 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4815 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4816 local variable dynobj.
4819 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4820 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4821 executable from read-only sections into sdynrelro.
4822 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4823 dynamic relocs in sdynrelro.
4824 (elf_backend_want_dynrelro): Define.
4826 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4828 * config.bfd (*-*-rtemsaout*): Mark as removed.
4830 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4832 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4833 (arm-*-rtems*): Move to (arm*-*-eabi*).
4834 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4835 (m68-*-rtems*): Move to (m68*-*-elf*).
4837 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4839 * config.bfd (*-*-rtemscoff*): Mark as removed.
4841 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4844 * elflink.c (bfd_elf_record_link_assignment): Revert last
4845 change and don't ever clear `forced_local'. Set `mark'
4847 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4849 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4850 (bfd_elf_size_dynamic_sections): ... here.
4851 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4852 and set `mark' instead in `__tls_get_addr_opt' processing.
4853 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4855 2017-01-24 Alan Modra <amodra@gmail.com>
4857 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4858 where dynamic relocs are preferable. Allow ifunc too.
4859 (ensure_undefweak_dynamic): New function.
4860 (allocate_dynrelocs): Use it here. Move plt handling last and
4861 don't make symbols dynamic, simplifying loop. Only make undef
4862 weak symbols with GOT entries dynamic. Correct condition
4863 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4864 comments. Remove goto.
4865 (ppc_elf_relocate_section): Correct test for using dynamic
4866 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4867 to suit. Set up explicit tls_index entries and implicit GOT
4868 tls_index entries resolvable at link time for
4869 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4870 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4871 (ensure_undefweak_dynamic): New function.
4872 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4873 with GOT entries dynamic. Remove unnecessary test of
4874 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4875 (ppc64_elf_relocate_section): Correct test for using dynamic
4876 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4877 to suit. Set up explicit tls_index entries and implicit GOT
4878 tls_index entries resolvable at link time for __tls_get_addr_opt.
4879 Simplify expression to clear mem for prelink.
4881 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4883 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4885 2017-01-20 Jiong Wang <jiong.wang@arm.com>
4887 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4888 (elf_backend_hash_symbol): Define.
4890 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4893 * elflink.c (bfd_elf_record_link_assignment): Clear any
4894 `forced_local' marking for DSO symbols that are not being
4897 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4899 * elfnn-riscv.c (riscv_elf_object_p): New function.
4901 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4904 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4906 (elf_x86_64_check_relocs): Create .eh_frame section for the
4908 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4909 .eh_frame section for the .plt.bnd section.
4910 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4911 for the .plt.bnd section.
4913 2017-01-12 Nick Clifton <nickc@redhat.com>
4916 * opncls.c (find_separate_debug_file): Add include_dirs
4917 parameter. Only include the directory part of the bfd's filename
4918 in search paths if include_dirs is true. Add a couple of extra
4919 locations for looking for debug files.
4920 ( bfd_follow_gnu_debuglink): Update invocation of
4921 find_separate_debug_file.
4922 (bfd_follow_gnu_debugaltlink): Likewise.
4923 (get_build_id): New function: Finds the build-id of the given bfd.
4924 (get_build_id_name): New function: Computes the name of the
4925 separate debug info file for a bfd, based upon its build-id.
4926 (check_build_id_file): New function: Checks to see if a separate
4927 debug info file exists at the given location, and that its
4928 build-id matches that of the original bfd.
4929 (bfd_follow_build_id_debuglink): New function: Finds a separate
4930 debug info file for a given bfd by using the build-id method.
4931 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4932 method of locating a separate debug info file before using the
4934 * bfd-in2.h: Regenerate.
4936 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
4939 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4940 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4941 elf_x86_64_eh_frame_plt_got.
4942 (elf_x86_64_size_dynamic_sections): Get unwind info from
4943 elf_x86_64_bnd_arch_bed for the BND PLT.
4945 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
4947 * config.bfd: Add entries for i686-redox and x86_64-redox.
4949 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4951 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
4953 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
4954 .eh_frame section to 4 bytes for x32.
4955 (elf_x86_64_check_relocs): Likewise.
4957 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4960 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
4961 (PLT_GOT_FDE_LENGTH): Likewise.
4962 (elf_i386_plt_layout): Add eh_frame_plt_got and
4963 eh_frame_plt_got_size.
4964 (elf_i386_plt): Updated.
4965 (elf_i386_link_hash_table): Add plt_got_eh_frame.
4966 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
4967 (elf_i386_size_dynamic_sections): Allocate and initialize
4968 .eh_frame section for .plt.got.
4969 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
4971 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
4972 eh_frame_plt_got_size.
4973 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
4974 (PLT_GOT_FDE_LENGTH): Likewise.
4975 (elf_x86_64_backend_data): Add eh_frame_plt_got and
4976 eh_frame_plt_got_size.
4977 (elf_x86_64_arch_bed): Updated.
4978 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
4979 eh_frame_plt_got_size.
4980 (elf_x86_64_nacl_arch_bed): Likewise.
4981 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
4982 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
4983 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4984 .eh_frame section for .plt.got.
4985 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4988 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4990 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
4991 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
4993 2017-01-09 Nick Clifton <nickc@redhat.com>
4995 * dwarf2.c (lookup_address_in_function_table): Return early if
4996 there are no functions in the given comp unit, or if the high
4997 address of the last function in the comp unit is less than the
5000 2017-01-09 Nick Clifton <nickc@redhat.com>
5003 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
5004 message if there are too many symbols to load.
5006 2017-01-04 James Clarke <jrtc27@jrtc27.com>
5008 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
5009 if relocs are cached.
5011 2017-01-03 Rich Felker <bugdal@aerifal.cx>
5014 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
5015 for R_MICROBLAZE_GOTOFF_64.
5017 2017-01-03 Nick Clifton <nickc@redhat.com>
5019 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
5020 warning about using a possibly uninitialised variable.
5022 2017-01-02 Alan Modra <amodra@gmail.com>
5024 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
5025 (allocate_plt_static, allocate_dynrelocs): Use it.
5027 2017-01-02 Alan Modra <amodra@gmail.com>
5029 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
5030 .PARISC.unwind section.
5032 2017-01-02 Alan Modra <amodra@gmail.com>
5035 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
5036 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
5037 indirect to GOT pointer relative code edit.
5039 2017-01-02 Alan Modra <amodra@gmail.com>
5041 Update year range in copyright notice of all files.
5043 For older changes see ChangeLog-2016
5045 Copyright (C) 2017 Free Software Foundation, Inc.
5047 Copying and distribution of this file, with or without modification,
5048 are permitted in any medium without royalty provided the copyright
5049 notice and this notice are preserved.
5055 version-control: never