1 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
4 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
5 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
6 (allocate_dynrelocs): Discard dynamic relocations if
7 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
9 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
12 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
13 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
15 (allocate_dynrelocs): Discard dynamic relocations if
16 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
18 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
21 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
22 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
23 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
24 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
25 (elf_m68k_relocate_section): Don't generate dynamic relocation
26 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
28 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
31 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
32 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
33 (allocate_dynrelocs): Discard dynamic relocations if
34 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
35 (elf32_hppa_relocate_section): Don't generate dynamic
36 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
38 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
41 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
42 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
43 (allocate_fptr): Don't allocate function pointer if
44 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
45 (allocate_dynrel_entries): Don't allocate dynamic relocation
46 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
47 (set_got_entry): Don't set GOT entry if
48 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
49 (set_pltoff_entry): Don't set PLTOFF entry if
50 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
51 (elfNN_ia64_relocate_section): Don't install dynamic relocation
52 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
54 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
57 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
58 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
59 (allocate_dynrelocs): Don't allocate dynamic relocations if
60 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
62 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
65 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
66 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
67 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
68 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
70 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
73 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
74 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
75 (tilepro_elf_relocate_section): Don't generate dynamic
76 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
77 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
78 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
79 (tilegx_elf_relocate_section): Don't generate dynamic
80 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
82 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
85 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
86 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
88 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
89 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
91 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
93 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
94 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
95 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
97 2017-10-12 James Bowman <james.bowman@ftdichip.com>
99 * bfd-in2.h: Regenerate.
100 * libbfd.h: Regenerate.
101 * elf32-ft32.c: Add HOWTO R_FT32_15.
102 * reloc.c: Add BFD_RELOC_FT32_15.
104 2017-10-12 Nick Clifton <nickc@redhat.com>
106 * reloc.c (enum bfd_reloc_status): Start values at 2.
107 * bfd-in2.h: Regenerate.
108 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
109 that a TRUE return indicates success. Compare the result of
110 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
111 (build_one_stub): Change sense of tests against aarch64_relocate
113 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
114 than FALSE, when an error is detected.
115 (elfNN_aarch64_final_link_relocate): Likewise.
117 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
119 * elf32-i386.c (elf_backend_hide_symbol): New.
120 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
121 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
122 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
124 2017-10-12 Alan Modra <amodra@gmail.com>
126 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
127 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
128 (bfd_elf_define_start_stop): Likewise.
130 2017-10-12 Alan Modra <amodra@gmail.com>
132 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
133 when executable rather than non-PIC.
134 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
135 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
137 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
139 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
141 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
142 (elf_external_linux_prpsinfo64_ugid32): ... this.
143 (swap_linux_prpsinfo32_out): Rename to...
144 (swap_linux_prpsinfo32_ugid32_out): ... this.
145 (elf_external_linux_prpsinfo64_ugid16): New structure.
146 (swap_linux_prpsinfo64_ugid16_out): New function.
147 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
148 (elf_backend_linux_prpsinfo64_ugid16): Define.
149 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
150 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
151 of the 64-bit Linux core PRPSINFO note.
152 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
154 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
156 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
158 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
159 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
160 (elf_external_ppc_linux_prpsinfo32)
161 (swap_ppc_linux_prpsinfo32_out): Move to...
162 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
163 (swap_linux_prpsinfo32_ugid32_out): ... these.
164 (elf_external_linux_prpsinfo32): Rename to...
165 (elf_external_linux_prpsinfo32_ugid16): ... this.
166 (swap_linux_prpsinfo32_out): Rename to...
167 (swap_linux_prpsinfo32_ugid16_out): ... this.
168 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
169 (elf_backend_linux_prpsinfo32_ugid16): Define.
170 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
171 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
172 of the 32-bit Linux core PRPSINFO note.
173 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
174 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
175 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
176 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
177 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
178 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
179 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
180 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
181 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
182 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
184 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
186 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
187 `gap' member ahead of `pr_flag'.
189 2017-10-11 Pedro Alves <palves@redhat.com>
191 * bfd.c (_doprnt): Rename to ...
192 (_bfd_doprnt): ... this.
193 (error_handler_internal): Adjust.
195 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
197 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
198 instead of incrementing it.
199 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
201 2017-10-10 Renlin Li <renlin.li@arm.com>
204 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
205 symbols into dynamic.
207 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
210 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
211 (riscv_elf_link_hash_table_create): Initialize max_alignment to
213 (_bfd_riscv_relax_section): Cache the max alignment of output
214 sections if possible.
216 2017-10-10 Alan Modra <amodra@gmail.com>
218 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
219 .opd whenever .opd is present and non-zero size. Move code
220 setting abiversion to/from output file earlier. Only set
221 u.opd.func_sec when --gc-sections. Read relocs and set up
222 u.opd.func_sec values here..
223 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
225 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
227 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
229 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
232 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
234 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
235 .interp section with "ld --no-dynamic-linker".
237 2017-10-09 Alan Modra <amodra@gmail.com>
240 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
241 funcinfo_hash_table and varinfo_hash_table.
243 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
245 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
246 in read-only section with minfo.
247 (sh_elf_size_dynamic_sections): Likewise.
249 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
251 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
254 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
256 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
257 this_hdr.sh_entsize only if section size > 0.
259 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
261 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
263 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
265 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
266 in read-only section with minfo.
267 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
269 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
271 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
274 2017-10-06 John Baldwin <jhb@FreeBSD.org>
276 * elf-bfd.h (struct elf_backend_data): Add
277 `elf_backend_grok_freebsd_prstatus'.
278 * elf.c (elfcore_grok_freebsd_note): Call
279 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
281 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
283 (elf_backend_grok_freebsd_prstatus): Define.
284 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
285 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
287 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
289 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
290 and has_non_got_reloc with zero_undefweak.
291 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
292 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
294 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
295 has_non_got_reloc with zero_undefweak.
296 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
297 has_got_reloc and has_non_got_reloc with zero_undefweak.
298 (elf_x86_link_hash_entry): Likewise.
300 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
302 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
303 (VERIFY_COPY_RELOC): Likewise.
305 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
307 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
308 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
309 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
311 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
313 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
314 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
315 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
317 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
319 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
320 * elf32-i386.c (elf_i386_relocate_section): Use it.
321 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
323 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
325 * elf32-i386.c (X86_SIZE_TYPE_P): New.
326 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
327 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
328 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
329 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
331 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
333 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
334 (PLT_LOCAL_IFUNC_P): Likewise.
335 * elf32-i386.c (elf_i386_relocate_section): Use them.
336 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
338 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
340 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
341 * elf32-i386.c (elf_i386_relocate_section): Use it.
342 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
344 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
346 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
347 * elf32-i386.c (elf_i386_relocate_section): Use it.
348 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
350 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
352 * elf32-i386.c (X86_PCREL_TYPE_P): New.
353 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
354 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
355 (X86_PCREL_TYPE_P): This.
356 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
357 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
358 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
360 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
362 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
364 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
365 * elf32-i386.c (elf_i386_tls_transition): Use it.
366 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
368 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
370 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
371 Dump dynamic relocation in read-only section with minfo if
373 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
374 (maybe_set_textrel): Likewise.
375 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
376 read-only section with minfo.
378 2017-10-05 John Baldwin <jhb@FreeBSD.org>
380 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
382 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
384 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
385 in read-only section with minfo.
386 (tilepro_elf_size_dynamic_sections): Likewise.
387 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
388 (tilegx_elf_size_dynamic_sections): Likewise.
390 2017-10-05 Pedro Alves <palves@redhat.com>
393 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
394 ellipsis parameter. Split out bfd_error_on_input code to..
395 (bfd_set_input_error): .. New function.
396 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
397 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
398 * bfd-in2.h: Regenerate.
400 2017-10-05 Alan Modra <amodra@gmail.com>
402 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
403 fini_array error value.
405 2017-10-05 Alan Modra <amodra@gmail.com>
408 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
410 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
412 (elf_fake_sections): Adjust calls. Exit immediately on failure.
413 (bfd_elf_set_group_contents): Add associated reloc section indices
416 2017-10-04 Alan Modra <amodra@gmail.com>
418 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
419 classify symbols for ELFv2.
421 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
424 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
425 undergoes default promotion.
426 * bfd-in2.h: Regenerate.
428 2017-10-02 Alan Modra <amodra@gmail.com>
430 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
431 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
433 2017-10-01 Alan Modra <amodra@gmail.com>
436 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
437 (add_line_info): Always put end_sequence last.
439 2017-10-01 Alan Modra <amodra@gmail.com>
442 * dwarf2.c (read_section): Allocate buffer with extra byte for
443 bfd_simple_get_relocated_section_contents rather than copying
446 2017-09-29 Alan Modra <amodra@gmail.com>
448 * merge.c (merge_strings): Return FALSE on malloc failure.
449 (_bfd_merge_sections): Return failures from record_section and
452 2017-09-28 Alan Modra <amodra@gmail.com>
455 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
456 a case where plugin_notice isn't called.
458 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
460 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
463 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
466 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
467 output_bfd to info->callbacks->minfo.
469 2017-09-26 Nick Clifton <nickc@redhat.com>
472 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
473 assertion failure if elf_x86_64_rtype_to_howto has already issued
476 2017-09-26 Alan Modra <amodra@gmail.com>
479 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
482 2017-09-26 Nick Clifton <nickc@redhat.com>
485 * dwarf2.c (read_formatted_entries): Fail early if we know that
486 the loop parsing data entries will overflow the end of the
489 2017-09-26 Alan Modra <amodra@gmail.com>
492 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
493 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
494 to stash->info_ptr_memory, and check die_ref is within that memory.
495 Set info_ptr_end correctly when another CU is refd. Check die_ref
496 for DW_FORM_ref4 etc. is within CU.
498 2017-09-26 Alan Modra <amodra@gmail.com>
501 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
502 (read_formatted_entries): Init "fe".
503 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
505 2017-09-26 Alan Modra <amodra@gmail.com>
508 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
509 bounds in inner loop.
511 2017-09-25 Alan Modra <amodra@gmail.com>
514 * dwarf1.c (parse_die): Sanity check pointer against section limit
515 before dereferencing.
516 (parse_line_table): Likewise.
518 2017-09-25 Alan Modra <amodra@gmail.com>
521 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
523 (parse_comp_unit): Likewise.
525 2017-09-25 Alan Modra <amodra@gmail.com>
528 * dwarf2.c (read_formatted_entries): Error on format_count zero.
530 2017-09-24 Alan Modra <amodra@gmail.com>
533 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
534 within section bounds.
536 2017-09-24 Alan Modra <amodra@gmail.com>
539 * dwarf2.c (decode_line_info): Properly free line sequences on error.
541 2017-09-24 Alan Modra <amodra@gmail.com>
544 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
545 pname param. Return status. Make name const. Don't abort,
546 return an error. Formatting. Exit if current info_ptr matches
547 orig_info_ptr. Update callers.
548 (scan_unit_for_symbols): Start at nesting_level of zero. Make
549 nested_funcs an array of structs for extensibility. Formatting.
551 2017-09-24 Alan Modra <amodra@gmail.com>
554 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
555 rather than dividing by zero.
557 2017-09-24 Alan Modra <amodra@gmail.com>
560 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
562 2017-09-24 Alan Modra <amodra@gmail.com>
565 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
567 2017-09-24 Alan Modra <amodra@gmail.com>
570 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
571 SHT_GNU_verneed section for sanity. Don't zalloc memory for
574 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
577 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
580 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
583 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
584 -1 if bfd_canonicalize_dynamic_reloc returns 0.
586 2017-09-22 Pedro Alves <palves@redhat.com>
587 Alan Modra <amodra@gmail.com>
589 * version.h: Add comment.
591 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
593 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
594 NT_S390_GS_BC, correct the previously swapped invocations of
595 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
597 2017-09-19 Alan Modra <amodra@gmail.com>
600 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
603 2017-09-19 Alan Modra <amodra@gmail.com>
606 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
607 symbols before calculating verrefs. Don't renumber dynsyms
608 after gc. Exclude .gnu.version when zero or one dynsym.
609 Localize some vars and reindent.
611 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
614 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
615 return from bfd_canonicalize_dynamic_reloc.
617 2017-09-15 Alan Modra <amodra@gmail.com>
620 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
621 overflows bfd_size_type.
623 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
626 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
627 to indicate if conversion is performed.
628 (elf_i386_check_relocs): Cache section contents and relocations
629 if conversion is performed.
630 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
631 contents and relocations if conversion is performed.
633 2017-09-14 Nick Clifton <nickc@redhat.com>
636 * peXXigen.c (pe_print_idata): Extend check for HintName vector
639 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
641 * elfxx-x86.h: Fix a typo in comments.
643 2017-09-09 Kamil Rytarowski <n54@gmx.com>
645 * elf32-nds32.c: Rename __BIT() to N32_BIT().
647 2017-09-09 Alan Modra <amodra@gmail.com>
649 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
652 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
654 * elf32-i386.c (elf_i386_relocate_section): Update usage of
655 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
656 (elf_i386_finish_dynamic_symbol): Likewise.
657 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
658 (elf_x86_64_finish_dynamic_symbol): Likewise.
659 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
660 (_bfd_x86_elf_fixup_symbol): Likewise.
662 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
664 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
665 check has_non_got_reloc.
667 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
670 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
671 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
672 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
673 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
674 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
675 and linker_def on __ehdr_start if it is referenced and not
677 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
678 and return TRUE when building executable, if a symbol has
679 non-GOT/non-PLT relocations in text section or there is no
681 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
683 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
685 * elfxx-x86.h: Update comments.
687 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
689 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
690 elf_x86_plt_layout_table with elf_x86_init_table.
691 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
693 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
695 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
696 (elf_x86_init_table): This.
697 (_bfd_x86_elf_link_setup_gnu_properties): Replace
698 elf_x86_plt_layout_table with elf_x86_init_table.
700 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
702 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
703 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
704 * configure: Regenerated.
705 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
706 and r_sym fields of plt_layout.
707 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
709 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
710 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
711 r_info nor r_sym fields.
712 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
714 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
716 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
718 * (_bfd_riscv_relax_align): Call bfd_set_error and
719 print an error message when unable to relax a .align directive.
721 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
723 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
724 (riscv_record_pcrel_hi_reloc): Add absolute argument.
725 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
726 R_RISCV_PCREL_HI20 relocs, and pass the result to
727 riscv_record_pcrel_hi_reloc.
729 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
731 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
732 r_type_p. Remove the converted argument. Replace
733 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
734 the new relocation type via r_type_p.
735 (elf_i386_relocate_section): Likewise.
736 (elf_i386_finish_dynamic_symbol): Likewise.
737 (need_convert_load): Removed.
738 (check_relocs_failed): Updated.
739 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
740 instead of setting need_convert_load.
741 (_bfd_i386_elf_convert_load): Removed.
742 * elf64-x86-64.c (need_convert_load): Removed.
743 (check_relocs_failed): Updated.
744 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
745 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
746 Return the new relocation type via r_type_p.
747 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
748 instead of setting need_convert_load.
749 (elf_x86_64_check_relocs): Don't check PIC if relocation has
751 (_bfd_x86_64_elf_convert_load): Removed.
752 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
753 with SYMBOL_REFERENCES_LOCAL_P.
754 (elf_x86_64_finish_dynamic_symbol): Likewise.
755 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
757 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
758 (_bfd_x86_elf_link_symbol_references_local): New function.
759 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
760 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
761 SYMBOL_REFERENCES_LOCAL_P.
762 (elf_x86_link_hash_entry): Add local_ref.
763 (elf_x86_link_hash_table): Remove convert_load.
764 (_bfd_i386_elf_convert_load): Removed.
765 (_bfd_x86_64_elf_convert_load): Likewise.
766 (_bfd_x86_elf_link_symbol_references_local): New.
768 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
770 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
771 (elf_x86_64_info_to_howto): Get the real relocation type by
772 masking out R_X86_64_converted_reloc_bit.
773 (elf_x86_64_check_tls_transition): Get the real relocation type
774 by masking out R_X86_64_converted_reloc_bit.
775 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
776 instead of setting converted_reloc.
777 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
778 instead of converted_reloc. Get the real relocation type by
779 masking out R_X86_64_converted_reloc_bit.
780 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
781 R_X86_64_converted_reloc_bit is valid.
782 * elfxx-x86.h (converted_reloc): Removed.
784 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
786 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
787 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
788 to get the relocation type again.
789 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
790 r_type when calling elf_x86_64_tls_transition. Don't use
791 ELF32_R_TYPE to get the relocation type again.
793 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
795 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
798 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
800 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
801 argument. Don't check relocation overflow. Avoid relocation
802 overflow if --no-relax is used. Set converted_reloc on symbol
803 if a GOTPCREL relocation is converted.
804 (elf_x86_64_relocate_section): Issue a fatal error and suggest
805 --no-relax if GOTPCREL relocation conversion leads to relocation
807 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
809 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
810 Edmar Wienskoski <edmar.wienskoski@nxp.com
812 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
813 (ppc_elf_check_relocs): Handle it.
814 (ppc_elf_vle_split20): New function.
815 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
817 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
820 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
821 for x86-64 if GOT_TLS_GDESC_P is true.
823 2017-09-03 Alan Modra <amodra@gmail.com>
826 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
828 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
830 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
831 tls_get_addr for x86-64 in one place.
833 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
835 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
836 with elfxx-x86.lo for 64-bit BFD.
837 * configure: Regenerated.
839 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
841 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
842 (_bfd_i386_elf_convert_load): This. Remove static.
843 (elf_i386_size_dynamic_sections): Removed.
844 (elf_backend_size_dynamic_sections): Likewise.
845 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
846 (_bfd_x86_64_elf_convert_load): This. Remove static.
847 (elf_x86_64_size_dynamic_sections): Removed.
848 (elf_backend_size_dynamic_sections): Likewise.
849 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
850 (elf_x86_allocate_dynrelocs): This. Make it static.
851 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
852 (elf_x86_allocate_local_dynreloc): This. Make it static.
853 (elf_i386_is_reloc_section): New function.
854 (elf_x86_64_is_reloc_section): Likewise.
855 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
856 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
857 Rearrange got_entry_size initialization.
858 (_bfd_x86_elf_size_dynamic_sections): New function.
859 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
860 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
861 (_bfd_i386_elf_convert_load): New.
862 (_bfd_x86_64_elf_convert_load): Likewise.
863 (_bfd_x86_elf_size_dynamic_sections): Likewise.
864 (elf_backend_size_dynamic_sections): Likewise.
865 (_bfd_x86_elf_allocate_dynrelocs): Removed.
866 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
868 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
870 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
873 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
875 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
876 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
878 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
880 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
881 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
882 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
883 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
884 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
885 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
887 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
889 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
890 (elf_i386_allocate_local_dynrelocs): Likewise.
891 (elf_i386_size_dynamic_sections): Replace
892 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
893 with _bfd_x86_elf_allocate_dynrelocs and
894 _bfd_x86_elf_allocate_local_dynrelocs.
895 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
896 (elf_x86_64_allocate_local_dynrelocs): Likewise.
897 (elf_x86_64_size_dynamic_sections): Replace
898 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
899 with _bfd_x86_elf_allocate_dynrelocs and
900 _bfd_x86_elf_allocate_local_dynrelocs.
901 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
902 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
903 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
904 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
906 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
908 * elf32-i386.c (is_i386_elf): Removed.
909 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
910 (elf_i386_size_dynamic_sections): Likewise.
911 (elf_i386_relocate_section): Likewise.
912 * elf64-x86-64.c (is_x86_64_elf): Removed.
913 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
915 (elf_x86_64_size_dynamic_sections): Likewise.
916 (elf_x86_64_relocate_section): Likewise.
917 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
919 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
922 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
924 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
925 (elf_i386_allocate_dynrelocs): Replace
926 elf_i386_compute_jump_table_size with
927 elf_x86_compute_jump_table_size.
928 (elf_i386_size_dynamic_sections): Likewise.
929 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
930 (elf_x86_64_allocate_dynrelocs): Replace
931 elf_x86_64_compute_jump_table_size with
932 elf_x86_compute_jump_table_size.
933 (elf_x86_64_size_dynamic_sections): Likewise.
934 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
936 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
937 (elf_x86_compute_jump_table_size): New.
939 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
941 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
943 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
944 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
946 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
948 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
949 with htab->is_vxworks.
950 (elf_i386_size_dynamic_sections): Likewise.
951 (elf_i386_relocate_section): Likewise.
952 (elf_i386_finish_dynamic_symbol): Likewise.
953 (elf_i386_finish_dynamic_sections): Likewise.
955 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
957 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
958 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
959 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
960 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
961 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
962 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
963 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
964 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
966 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
969 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
970 ELF_COMMON_DEF_P for common symbols.
972 2017-09-02 Alan Modra <amodra@gmail.com>
974 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
975 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
976 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
978 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
980 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
981 (elf_backend_gc_mark_hook): Likewise.
982 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
983 (elf_backend_gc_mark_hook): Likewise.
984 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
985 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
986 (elf_backend_gc_mark_hook): Likewise.
988 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
990 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
991 (elf_backend_adjust_dynamic_symbol): Likewise.
992 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
993 (elf_backend_adjust_dynamic_symbol): Likewise.
994 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
995 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
996 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
997 (_bfd_x86_elf_adjust_dynamic_symbol): New.
998 (elf_backend_adjust_dynamic_symbol): Likewise.
1000 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1002 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1005 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1007 * elf32-i386.c (elf_i386_mkobject): Removed.
1008 (bfd_elf32_mkobject): Likewise.
1009 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1010 (bfd_elf64_mkobject): Likewise.
1011 (bfd_elf32_mkobject): Likewise.
1012 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
1013 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1014 (bfd_elf64_mkobject): Likewise.
1015 (bfd_elf32_mkobject): Likewise.
1017 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1019 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1020 Call _bfd_x86_elf_link_setup_gnu_properties.
1021 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1022 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1024 (elf_x86_64_non_lazy_plt): Likewise.
1025 (elf_x86_64_lazy_bnd_plt): Likewise.
1026 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1027 (elf_x86_64_lazy_ibt_plt): Likewise.
1028 (elf_x32_lazy_ibt_plt): Likewise.
1029 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1030 (elf_x32_non_lazy_ibt_plt): Likewise.
1031 (elf_x86_64_nacl_plt): Likewise.
1032 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1033 _bfd_x86_elf_link_setup_gnu_properties.
1034 * elfxx-x86.c: Include elf-vxworks.h".
1035 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1036 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1037 comments for pic_plt0_entry and pic_plt_entry.
1038 (elf_x86_non_lazy_plt_layout): Likewise.
1039 (elf_x86_plt_layout_table): New.
1040 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1042 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1045 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1046 .eh_frame section for the second PLT.
1047 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1048 alignment of .eh_frame section for the second PLT.
1050 2017-09-01 Nick Clifton <nickc@redhat.com>
1053 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1056 2017-09-01 Nick Clifton <nickc@redhat.com>
1059 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1060 attribute buffer is NUL terminated.
1062 2017-08-31 Nick Clifton <nickc@redhat.com>
1065 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1066 to dwarf string sections.
1068 2017-08-31 Alan Modra <amodra@gmail.com>
1070 * po/SRC-POTFILES.in: Regenerate.
1072 2017-08-31 Alan Modra <amodra@gmail.com>
1074 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1075 for a section containing just a terminator. Allow multiple
1076 terminators at end of section.
1077 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1078 sections when not adding alignment. Assert on terminator in
1081 2017-08-31 Alan Modra <amodra@gmail.com>
1085 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1088 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1090 * configure.ac (bfd_backends): Add elf64.lo together with
1091 elfxx-x86.lo for 64-bit BFD.
1092 * configure: Regenerated.
1094 2017-08-31 James Bowman <james.bowman@ftdichip.com>
1096 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1099 2017-08-31 Alan Modra <amodra@gmail.com>
1102 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1103 before _close_and_cleanup. Call iovec->bclose after.
1104 (bfd_close): Remove code common to, and call, bfd_close_all_done.
1106 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1108 * elf32-i386.c (elf_i386_plt_type): Removed.
1109 (elf_i386_plt): Likewise.
1110 (elf_i386_get_synthetic_symtab): Updated. Call
1111 _bfd_x86_elf_get_synthetic_symtab.
1112 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1113 (elf_x86_64_plt): Likewise.
1114 (elf_x86_64_get_synthetic_symtab): Updated. Call
1115 _bfd_x86_elf_get_synthetic_symtab.
1116 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1117 (elf_x86_64_get_plt_got_vma): Likewise.
1118 (elf_i386_valid_plt_reloc_p): Likewise.
1119 (elf_x86_64_valid_plt_reloc_p): Likewise.
1120 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1121 * elfxx-x86.h (elf_x86_plt_type): New.
1122 (elf_x86_plt): Likewise.
1123 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1125 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1127 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1128 target_id instead of elf_machine_code.
1130 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1132 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1133 (elf_i386_lazy_plt_layout): Likewise.
1134 (elf_i386_non_lazy_plt_layout): Likewise.
1135 (elf_i386_plt_layout): Likewise.
1136 (elf_i386_link_hash_table): Likewise.
1137 (elf_i386_next_tls_desc_index): Likewise.
1138 (elf_i386_srelplt2): Likewise.
1139 (elf_i386_plt): Likewise.
1140 (elf_i386_lazy_plt): Likewise.
1141 (elf_i386_non_lazy_plt): Likewise.
1142 (elf_i386_link_hash_table_create): Likewise.
1143 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1144 (elf_i386_lazy_plt): Updated.
1145 (elf_i386_non_lazy_plt): Likewise.
1146 (elf_i386_lazy_ibt_plt): Likewise.
1147 (elf_i386_non_lazy_ibt_plt): Likewise.
1148 (elf_i386_allocate_dynrelocs): Likewise.
1149 (elf_i386_size_dynamic_sections): Likewise.
1150 (elf_i386_relocate_section): Likewise.
1151 (elf_i386_finish_dynamic_symbol): Likewise.
1152 (elf_i386_finish_dynamic_sections): Likewise.
1153 (elf_i386_get_synthetic_symtab): Likewise.
1154 (elf_i386_link_setup_gnu_properties): Likewise.
1155 (elf_i386_nacl_plt): Likewise.
1156 * elf64-x86-64.c (ABI_64_P): Removed.
1157 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1158 (ELF32_DYNAMIC_INTERPRETER): Likewise.
1159 (elf_x86_64_lazy_plt_layout): Likewise.
1160 (elf_x86_64_non_lazy_plt_layout): Likewise.
1161 (elf_x86_64_plt_layout): Likewise.
1162 (elf_x86_64_link_hash_table): Likewise.
1163 (elf_x86_64_plt): Likewise.
1164 (elf_x86_64_lazy_plt): Likewise.
1165 (elf_x86_64_non_lazy_plt): Likewise.
1166 (elf_x86_64_link_hash_table_create): Likewise.
1167 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1168 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1169 (elf_x86_64_lazy_plt): Updated.
1170 (elf_x86_64_non_lazy_plt): Likewise.
1171 (elf_x86_64_lazy_bnd_plt): Likewise.
1172 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1173 (elf_x86_64_lazy_ibt_plt): Likewise.
1174 (elf_x32_lazy_ibt_plt): Likewise.
1175 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1176 (elf_x32_non_lazy_ibt_plt): Likewise.
1177 (elf_x86_64_allocate_dynrelocs): Likewise.
1178 (elf_x86_64_size_dynamic_sections): Likewise.
1179 (elf_x86_64_relocate_section): Likewise.
1180 (elf_x86_64_finish_dynamic_symbol): Likewise.
1181 (elf_x86_64_finish_dynamic_sections): Likewise.
1182 (elf_x86_64_get_synthetic_symtab): Likewise.
1183 (elf_x86_64_link_setup_gnu_properties): Likewise.
1184 (elf_x86_64_nacl_plt): Likewise.
1185 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1187 (ELF32_DYNAMIC_INTERPRETER): New.
1188 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1189 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1190 (_bfd_x86_elf_link_hash_table_create): Likewise.
1191 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1192 (elf_x86_link_hash_table_free): This. Make it static.
1193 * elfxx-x86.h: Don't include "objalloc.h".
1195 (elf_x86_lazy_plt_layout): Likewise.
1196 (elf_x86_non_lazy_plt_layout): Likewise.
1197 (elf_x86_plt_layout): Likewise.
1198 (_bfd_x86_elf_link_hash_table_create): Likewise.
1199 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1200 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1201 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1202 srelplt2 and next_tls_desc_index.
1203 (_bfd_x86_elf_link_hash_table_free): Removed.
1205 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1207 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1208 branch offset interpretation.
1210 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1213 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1215 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1217 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1218 (elf_x86_64_srelplt2): Likewise.
1220 2017-08-30 Alan Modra <amodra@gmail.com>
1222 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1223 (ppc64_elf_tls_optimize): Set it.
1224 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1225 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1226 addis would add zero.
1227 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1228 (ppc_elf_tls_optimize): Set it.
1229 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1230 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1232 2017-08-30 Alan Modra <amodra@gmail.com>
1234 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1235 __tls_get_addr call sequences to LE, don't move the addi down
1236 to the nop. Replace the bl with addi and leave the nop alone.
1238 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1240 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1242 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1244 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1246 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1248 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1249 (BFD64_BACKENDS): Likewise.
1250 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1251 (BFD64_BACKENDS_CFILES): Likewise.
1252 * Makefile.in: Regenerated.
1253 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1254 elf32-i386.lo and elf64-x86-64.lo.
1255 * configure: Regenerated.
1256 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1257 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1258 "objalloc.h" and "hashtab.h".
1259 (ELIMINATE_COPY_RELOCS): Removed.
1260 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1261 (SYMBOL_NO_COPYRELOC): Likewise.
1262 (elf_i386_link_hash_entry): Likewise.
1263 (GOT_UNKNOWN): Likewise.
1264 (GOT_NORMAL): Likewise.
1265 (GOT_TLS_GD): Likewise.
1266 (elf_i386_hash_entry): Likewise.
1267 (elf_i386_obj_tdata): Likewise.
1268 (elf_i386_tdata): Likewise.
1269 (elf_i386_local_got_tls_type): Likewise.
1270 (elf_i386_local_tlsdesc_gotent): Likewise.
1271 (elf_i386_hash_table): Likewise.
1272 (elf_i386_link_hash_newfunc): Likewise.
1273 (elf_i386_local_htab_hash): Likewise.
1274 (elf_i386_local_htab_eq): Likewise.
1275 (elf_i386_get_local_sym_hash): Likewise.
1276 (elf_i386_link_hash_table_free): Likewise.
1277 (elf_i386_copy_indirect_symbol): Likewise.
1278 (elf_i386_fixup_symbol): Likewise.
1279 (elf_i386_readonly_dynrelocs): Likewise.
1280 (elf_i386_always_size_sections): Likewise.
1281 (elf_i386_set_tls_module_base): Likewise.
1282 (elf_i386_dtpoff_base): Likewise.
1283 (compare_relocs): Likewise.
1284 (elf_i386_hash_symbol): Likewise.
1285 (elf_i386_parse_gnu_properties): Likewise.
1286 (elf_i386_merge_gnu_properties): Likewise.
1287 (elf_i386_link_check_relocs): Likewise.
1288 (elf_i386_merge_symbol_attribute): Likewise.
1289 (bfd_elf32_bfd_link_check_relocs): Likewise.
1290 (elf_backend_copy_indirect_symbol): Likewise.
1291 (elf_backend_always_size_sections): Likewise.
1292 (elf_backend_omit_section_dynsym): Likewise.
1293 (elf_backend_hash_symbol): Likewise.
1294 (elf_backend_fixup_symbol): Likewise.
1295 (elf_backend_parse_gnu_properties): Likewise.
1296 (elf_backend_merge_gnu_properties): Likewise.
1297 (elf_backend_merge_symbol_attribute): Likewise.
1298 (elf_i386_mkobject): Updated.
1299 (elf_i386_link_hash_table_create): Likewise.
1300 (elf_i386_check_tls_transition): Likewise.
1301 (elf_i386_tls_transition): Likewise.
1302 (elf_i386_convert_load_reloc): Likewise.
1303 (elf_i386_check_relocs): Likewise.
1304 (elf_i386_adjust_dynamic_symbol): Likewise.
1305 (elf_i386_allocate_dynrelocs): Likewise.
1306 (elf_i386_convert_load): Likewise.
1307 (elf_i386_size_dynamic_sections): Likewise.
1308 (elf_i386_relocate_section): Likewise.
1309 (elf_i386_finish_dynamic_symbol ): Likewise.
1310 (elf_i386_finish_dynamic_sections): Likewise.
1311 (elf_i386_output_arch_local_syms): Likewise.
1312 (elf_i386_get_synthetic_symtab): Likewise.
1313 (elf_i386_link_setup_gnu_properties): Likewise.
1314 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1315 of elf_link_hash_table, as base.
1316 (elf_i386_next_tls_desc_index): New.
1317 (elf_i386_srelplt2): Likewise.
1318 (elf_i386_plt): Likewise.
1319 (elf_i386_lazy_plt): Likewise.
1320 (elf_i386_non_lazy_plt): Likewise.
1321 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1322 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1323 "objalloc.h" and "hashtab.h".
1324 (ELIMINATE_COPY_RELOCS): Removed.
1325 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1326 (SYMBOL_NO_COPYRELOC): Likewise.
1327 (elf_x86_64_link_hash_entry): Likewise.
1328 (GOT_UNKNOWN): Likewise.
1329 (GOT_NORMAL): Likewise.
1330 (GOT_TLS_GD): Likewise.
1331 (elf_x86_64_hash_entry): Likewise.
1332 (elf_x86_64_obj_tdata): Likewise.
1333 (elf_x86_64_tdata): Likewise.
1334 (elf_x86_64_local_got_tls_type): Likewise.
1335 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1336 (elf_x86_64_hash_table): Likewise.
1337 (elf_x86_64_link_hash_newfunc): Likewise.
1338 (elf_x86_64_local_htab_hash): Likewise.
1339 (elf_x86_64_local_htab_eq): Likewise.
1340 (elf_x86_64_get_local_sym_hash): Likewise.
1341 (elf_x86_64_link_hash_table_free): Likewise.
1342 (elf_x86_64_copy_indirect_symbol): Likewise.
1343 (elf_x86_64_fixup_symbol): Likewise.
1344 (elf_x86_64_readonly_dynrelocs): Likewise.
1345 (elf_x86_64_always_size_sections): Likewise.
1346 (elf_x86_64_set_tls_module_base): Likewise.
1347 (elf_x86_64_dtpoff_base): Likewise.
1348 (compare_relocs): Likewise.
1349 (elf_x86_64_merge_symbol_attribute): Likewise.
1350 (elf_x86_64_hash_symbol): Likewise.
1351 (elf_x86_64_parse_gnu_properties): Likewise.
1352 (elf_x86_64_merge_gnu_properties): Likewise.
1353 (elf_x86_64_link_check_relocs): Likewise.
1354 (elf_backend_copy_indirect_symbol): Likewise.
1355 (elf_backend_always_size_sections): Likewise.
1356 (bfd_elf64_bfd_link_check_relocs): Likewise.
1357 (elf_backend_merge_symbol_attribute): Likewise.
1358 (elf_backend_hash_symbol): Likewise.
1359 (elf_backend_omit_section_dynsym): Likewise.
1360 (elf_backend_fixup_symbol): Likewise.
1361 (elf_backend_parse_gnu_properties): Likewise.
1362 (elf_backend_merge_gnu_properties): Likewise.
1363 (bfd_elf32_bfd_link_check_relocs): Likewise.
1364 (elf_x86_64_mkobject): Updated.
1365 (elf_x86_64_link_hash_table_create): Likewise.
1366 (elf_x86_64_check_tls_transition): Likewise.
1367 (elf_x86_64_tls_transition): Likewise.
1368 (elf_x86_64_convert_load_reloc): Likewise.
1369 (elf_x86_64_check_relocs): Likewise.
1370 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1371 (elf_x86_64_allocate_dynrelocs): Likewise.
1372 (elf_x86_64_convert_load): Likewise.
1373 (elf_x86_64_size_dynamic_sections): Likewise.
1374 (elf_x86_64_relocate_section): Likewise.
1375 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1376 (elf_x86_64_finish_dynamic_sections): Likewise.
1377 (elf_x86_64_output_arch_local_syms): Likewise.
1378 (elf_x86_64_get_synthetic_symtab): Likewise.
1379 (elf_x86_64_link_setup_gnu_properties): Likewise.
1380 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1381 instead of elf_link_hash_table, as base.
1382 (elf_x86_64_next_tls_desc_index): New.
1383 (elf_x86_64_srelplt2): Likewise.
1384 (elf_x86_64_plt): Likewise.
1385 (elf_x86_64_lazy_plt): Likewise.
1386 (elf_x86_64_non_lazy_plt): Likewise.
1387 * elfxx-x86.c: New file.
1388 * elfxx-x86.h: Likewise.
1390 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1392 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1394 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1396 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1398 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1399 sections before checking dynamic relocations and free invalid
1400 PLT section contents.
1401 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1403 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1405 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1406 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1408 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1411 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1413 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1415 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1417 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1419 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1421 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1424 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1425 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1426 Add a has_no_copy_on_protected bitfield.
1427 (elf_has_no_copy_on_protected): New.
1428 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1429 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1430 (elf_merge_gnu_property_list): Likewise.
1431 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1432 to FALSE for elf_has_no_copy_on_protected.
1433 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1434 (elf_i386_link_hash_entry): Add def_protected.
1435 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1436 when checking info->nocopyreloc.
1437 (elf_i386_link_setup_gnu_properties): Don't set
1438 extern_protected_data here.
1439 (elf_i386_merge_symbol_attribute): New function.
1440 (elf_backend_merge_symbol_attribute): New.
1441 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1442 (elf_x86_64_link_hash_entry): Add def_protected.
1443 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1444 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1445 when checking info->nocopyreloc.
1446 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1447 relocation run-time overflow and unresolvable R_X86_64_32S
1448 relocation against protected data symbol defined in shared object
1449 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1450 (elf_x86_64_link_setup_gnu_properties): Don't set
1451 extern_protected_data here.
1452 (elf_x86_64_merge_symbol_attribute): New function.
1453 (elf_backend_merge_symbol_attribute): New.
1455 2017-08-26 Alan Modra <amodra@gmail.com>
1457 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1458 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1459 (ppc_elf_relocate_section): Comment fix.
1460 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1461 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1462 Support dynamic relocs for TPREL16 when non-pic too.
1463 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1464 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1467 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1469 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1470 "symbol" in comments.
1471 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1473 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1476 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1477 R_X86_64_PC32 relocation run-time overflow and unresolvable
1478 R_X86_64_32S relocation with -z nocopyreloc.
1480 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1482 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1483 Undefined symbols may not have a type.
1484 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1486 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1488 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1489 bfd_link_info. Report shared, PIE or PDE object based on
1491 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1492 (elf_x86_64_relocate_section): Likewise.
1494 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1496 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1497 for function symbols.
1498 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1500 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1502 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1503 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1504 is set on any input relocatable file.
1505 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1507 2017-08-23 Alan Modra <amodra@gmail.com>
1510 * elf64-ppc.c (ensure_undef_dynamic): Rename from
1511 ensure_undefweak_dynamic. Handle undefined too.
1512 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1513 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1514 (allocate_dynrelocs): Discard undefined non-default visibility
1515 relocs first. Make undefined syms dynamic. Tidy goto.
1517 2017-08-21 Alan Modra <amodra@gmail.com>
1518 H.J. Lu <hongjiu.lu@intel.com>
1521 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
1522 * elflink.c (bfd_elf_define_start_stop): Rewrite.
1524 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
1527 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
1528 undefined weak symbols.
1530 2017-08-18 Nick Clifton <nickc@redhat.com>
1533 * tekhex.c (getsym): Fix check for source pointer walking off the
1534 end of the input buffer.
1536 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
1539 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
1540 relocations in debug sections, change abort to _bfd_error_handler.
1542 2017-08-14 Nick Clifton <nickc@redhat.com>
1545 * elf.c (setup_group): Check for an empty or very small group
1547 * po/bfd.pot: Regenerate.
1549 2017-08-14 Alan Modra <amodra@gmail.com>
1552 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
1553 alignment padding here.
1554 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
1555 in a reverse pass over sections.
1557 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
1560 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
1561 for @plt suffixes first.
1562 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1564 2017-08-08 Nick Clifton <nickc@redhat.com>
1567 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
1568 small section lengths.
1569 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
1571 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
1572 there is enough data present in the note.
1574 2017-08-08 Alan Modra <amodra@gmail.com>
1577 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
1578 got.refcount for GOTOFF relocs, just create .got section.
1580 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
1582 * elflink.c (elf_link_add_object_symbols): Move common symbol
1583 check after bed->common_definition.
1585 2017-08-07 Alan Modra <amodra@gmail.com>
1588 * elflink.c (bfd_elf_final_link): Don't segfault when sections
1589 needed to define various dynamic tags have been discarded.
1591 2017-08-07 Nick Clifton <nickc@redhat.com>
1594 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
1595 has not been set then use the bfd returned by
1596 _bfd_elf_link_setup_gnu_properties. If that is null then search
1597 through all the input bfds selecting the first normal, ELF format
1599 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1601 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1603 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
1605 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
1606 (elf_i386_check_tls_transition): Check tls_get_addr directly.
1607 (elf_i386_convert_load_reloc): Update tls_get_addr check.
1608 (elf_i386_link_check_relocs): New function.
1609 (bfd_elf32_bfd_link_check_relocs): New.
1610 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
1612 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
1613 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
1614 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
1615 (elf_x86_64_link_check_relocs): New function.
1616 (bfd_elf64_bfd_link_check_relocs): New.
1617 (bfd_elf32_bfd_link_check_relocs): Likewise.
1619 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1622 * elflink.c (elf_link_add_object_symbols): Treat common symbol
1623 as undefined for --no-define-common.
1625 2017-08-05 Alan Modra <amodra@gmail.com>
1627 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
1628 hppa_link_hash_table.
1630 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
1632 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
1633 entries for sysregs with negative indices.
1635 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1637 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
1638 isn't the S/390 specific elf data.
1639 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1641 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
1643 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
1644 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
1645 [R_RISCV_ADD16]: Likewise.
1646 [R_RISCV_ADD32]: Likewise.
1647 [R_RISCV_ADD64]: Likewise.
1648 [R_RISCV_SUB6]: Likewise.
1649 [R_RISCV_SUB8]: Likewise.
1650 [R_RISCV_SUB16]: Likewise.
1651 [R_RISCV_SUB32]: Likewise.
1652 [R_RISCV_SUB64]: Likewise.
1654 2017-07-31 Alan Modra <amodra@gmail.com>
1656 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
1657 without ld.so checks.
1659 2017-07-29 Alan Modra <amodra@gmail.com>
1662 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
1663 (ppc64_elf_merge_symbol): Set non_zero_localentry.
1664 (is_elfv2_localentry0): Test non_zero_localentry.
1665 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
1667 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1669 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
1670 pointer check for htab->elf.irelplt.
1671 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1673 2017-07-27 Nick Clifton <nickc@redhat.com>
1676 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
1678 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
1680 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
1682 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
1684 (evax_bfd_print_emh): Check for invalid string lengths.
1686 2017-07-25 Nick Clifton <nickc@redhat.com>
1688 * po/fr.po: Updated French translation.
1690 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
1693 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
1694 16-bit absolute branches into 10-bit pc-relative branches on the
1695 MSP430 as well as the MSP430X.
1697 2017-07-25 Alan Modra <amodra@gmail.com>
1699 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
1700 (stub_eh_frame_size): New function.
1701 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
1702 (group_sections): Init group tls_get_addr_opt_bctrl.
1703 (ppc64_elf_size_stubs): Update sizing and initialization of
1704 .eh_frame. Iteration over stubs via group list.
1705 (ppc64_elf_build_stubs): Iterate over stubs via group list.
1706 (ppc64_elf_finish_dynamic_sections): Update finalization of
1709 2017-07-24 Nick Clifton <nickc@redhat.com>
1712 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
1713 of the relocs to the canonicalize_one_reloc routine.
1714 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
1715 for the _bfd_mach_o_canonicalize_one_reloc field.
1716 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
1717 res_base parameter. Use to check for corrupt pair relocs.
1718 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
1720 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
1722 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
1725 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
1726 enough data in the record before attempting to parse it.
1727 (_bfd_vms_slurp_eeom): Likewise.
1729 (_bfd_vms_slurp_egsd): Check for an invalid section index.
1730 (image_set_ptr): Likewise.
1731 (alpha_vms_slurp_relocs): Likewise.
1733 (alpha_vms_object_p): Check for a truncated record.
1735 2017-07-24 Nick Clifton <nickc@redhat.com>
1738 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
1739 an unrecognized reloc and sets the bfd_error value.
1740 * libbfd.h: Regenerate.
1741 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
1743 * elf32-i386.c (elf_i386_relocate_section): Likewise.
1744 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1745 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1746 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
1747 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1749 2017-07-23 Alan Modra <amodra@gmail.com>
1751 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
1754 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
1757 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
1758 reloc_class_ifunc for ifunc symbols.
1760 2017-07-19 Nick Clifton <nickc@redhat.com>
1763 * archive.c (bfd_generic_archive_p): If the bfd does not have the
1764 correct magic bytes at the start, set the error to wrong format
1765 and clear the format selector before returning NULL.
1767 2017-07-19 Nick Clifton <nickc@redhat.com>
1770 * coff-rs6000.c (_bfd_strntol): New function.
1771 (_bfd_strntoll): New function.
1772 (GET_VALUE_IN_FIELD): New macro.
1773 (EQ_VALUE_IN_FIELD): new macro.
1774 (_bfd_xcoff_slurp_armap): Use new macros.
1775 (_bfd_xcoff_archive_p): Likewise.
1776 (_bfd_xcoff_read_ar_hdr): Likewise.
1777 (_bfd_xcoff_openr_next_archived_file): Likewise.
1778 (_bfd_xcoff_stat_arch_elt): Likewise.
1779 * coff64-rs6000.c (_bfd_strntol): New function.
1780 (_bfd_strntoll): New function.
1781 (GET_VALUE_IN_FIELD): New macro.
1782 (xcoff64_slurp_armap): Use new macros.
1784 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
1785 John Eric Martin <John.Martin@emmicro-us.com>
1787 * bfd-in2.h: Regenerate.
1788 * libbfd.h: Regenerate.
1789 * elf32-arc.c (JLI): Define.
1790 * reloc.c: Add JLI relocations.
1792 2017-07-18 Nick Clifton <nickc@redhat.com>
1795 * coff-sh.c: Fix spelling typos.
1796 * compress.c: Likewise.
1797 * cpu-pdp11.c: Likewise.
1798 * ecofflink.c: Likewise.
1799 * elf-m10300.c: Likewise.
1801 * elf32-arm.c: Likewise.
1802 * elf32-m68k.c: Likewise.
1803 * elf32-nds32.c: Likewise.
1804 * elf32-ppc.c: Likewise.
1805 * elf32-sh.c: Likewise.
1806 * elf32-v850.c: Likewise.
1807 * elf64-ppc.c: Likewise.
1808 * elf64-x86-64.c: Likewise.
1809 * elflink.c: Likewise.
1810 * elfnn-aarch64.c: Likewise.
1811 * elfxx-mips.c: Likewise.
1813 * sunos.c: Likewise.
1814 * vms-alpha.c: Likewise.
1815 * xcofflink.c: Likewise.
1817 2017-07-18 Nick Clifton <nickc@redhat.com>
1820 * coffcode.h (handle_COMDAT): Replace abort with an error message
1823 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1826 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
1829 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1831 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
1833 2017-07-16 Alan Modra <amodra@gmail.com>
1835 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
1836 __tls_index GOT entries when using __tls_get_addr_opt stub.
1837 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1839 2017-07-12 Alan Modra <amodra@gmail.com>
1841 * po/es.po: Update from translationproject.org/latest/bfd/.
1842 * po/fi.po: Likewise.
1843 * po/fr.po: Likewise.
1844 * po/id.po: Likewise.
1845 * po/ja.po: Likewise.
1846 * po/ro.po: Likewise.
1847 * po/ru.po: Likewise.
1848 * po/sr.po: Likewise.
1849 * po/sv.po: Likewise.
1850 * po/tr.po: Likewise.
1851 * po/uk.po: Likewise.
1852 * po/vi.po: Likewise.
1853 * po/zh_CN.po: Likewise.
1854 * po/hr.po: New file from translationproject.org.
1855 * configure.ac (ALL_LINGUAS): Add hr. Sort.
1856 * configure: Regenerate.
1858 2017-07-12 Nick Clifton <nickc@redhat.com>
1860 Fix compile time warnings using gcc 7.1.1.
1861 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
1863 (elf_xtensa_get_gotplt_section): Increase length of got_name
1865 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
1866 default return of FALSE.
1867 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
1868 default return of FALSE.
1870 2017-07-12 Alan Modra <amodra@gmail.com>
1872 * binary.c (binary_set_section_contents): Don't print filepos in
1874 (coff_write_object_contents): Cast size_t for error message.
1875 (coff_slurp_line_table): Don't use bfd_vma symndx.
1876 (coff_slurp_reloc_table): Remove unneeded cast.
1877 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
1879 (find_abstract_instance_name): Likewise.
1880 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
1881 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
1882 (elf32_arm_check_relocs): Make r_symndx an int.
1883 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
1885 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
1887 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
1889 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
1890 * elf32-s390.c (elf_s390_check_relocs): Likewise.
1891 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
1892 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
1893 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1894 * elf64-s390.c (elf_s390_check_relocs): Likewise.
1895 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1896 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
1897 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
1898 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1899 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
1900 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
1901 and use %lu for error message.
1902 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
1903 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
1906 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
1908 (elf32_arm_final_link_relocate): Likewise.
1909 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
1910 * coffcode.h (styp_to_sec_flags): Likewise.
1911 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
1912 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
1913 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
1914 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
1915 (elf32_bfin_merge_private_bfd_data): Likewise.
1916 * elf32-cris.c (cris_elf_relocate_section): Likewise.
1917 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1918 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
1919 (i370_elf_relocate_section): Likewise.
1920 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
1921 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
1922 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
1923 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
1924 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
1925 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
1926 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
1927 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
1928 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1929 * ieee.c (ieee_write_id, read_id): Likewise.
1930 * mach-o.c (bfd_mach_o_write_contents): Likewise.
1931 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
1932 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
1933 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
1934 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
1935 * stabs.c (_bfd_link_section_stabs): Likewise.
1937 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
1939 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
1940 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
1941 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
1942 * coff-sh.c (sh_relax_section): Likewise.
1943 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
1944 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
1945 * coffcode.h (coff_slurp_reloc_table): Likewise.
1946 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1947 (_bfd_coff_read_string_table): Likewise.
1948 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
1949 * compress.c (bfd_get_full_section_contents): Likewise.
1950 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
1951 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
1952 * elf.c (bfd_elf_string_from_elf_section): Likewise.
1953 * elf32-arc.c (arc_special_overflow_checks): Likewise.
1954 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
1955 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
1956 (elf32_arm_write_section): Likewise.
1957 * elf32-bfin.c (bfin_relocate_section): Likewise.
1958 (bfinfdpic_relocate_section): Likewise.
1959 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1960 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
1961 * elf32-i386.c (elf_i386_tls_transition): Likewise.
1962 (elf_i386_relocate_section): Likewise.
1963 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
1964 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
1965 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1966 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1967 * elf32-metag.c (elf_metag_relocate_section): Likewise.
1968 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
1969 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
1970 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
1971 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
1972 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
1973 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
1974 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
1975 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
1976 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
1977 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
1978 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
1979 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
1980 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
1981 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
1982 * elf32-sh.c (sh_elf_relax_section): Likewise.
1983 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
1984 (sh_elf_relocate_section): Likewise.
1985 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
1986 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1987 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
1988 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1989 * elf32-v850.c (v850_elf_relax_section): Likewise.
1990 * elf32-vax.c (elf_vax_check_relocs): Likewise.
1991 (elf_vax_relocate_section): Likewise.
1992 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
1993 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
1994 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
1995 (do_fix_for_relocatable_link): Likewise.
1996 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
1997 (elf64_alpha_relax_with_lituse): Likewise.
1998 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
1999 (elf_hppa_final_link_relocate): Likewise.
2000 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2001 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2002 (elf64_vms_link_add_object_symbols): Likewise.
2003 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2004 (mmix_final_link_relocate): Likewise.
2005 * elf64-s390.c (invalid_tls_insn): Likewise.
2006 (elf_s390_relocate_section): Likewise.
2007 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2008 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2009 (elf_x86_64_relocate_section): Likewise.
2010 * elfcode.h (elf_slurp_symbol_table): Likewise.
2011 * elfcore.h (elf_core_file_p): Likewise.
2012 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2013 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2014 (elfNN_aarch64_relocate_section): Likewise.
2015 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2016 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2017 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2018 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2019 (_bfd_mips_elf_relocate_section): Likewise.
2020 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2021 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2022 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2023 * ieee.c (ieee_slurp_external_symbols): Likewise.
2024 * ihex.c (ihex_write_object_content): Likewise.
2025 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2026 * merge.c (_bfd_merged_section_offset): Likewise.
2027 * mmo.c (mmo_write_loc_chunk): Likewise.
2028 (mmo_write_object_contents): Likewise.
2029 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2030 * stabs.c (_bfd_link_section_stabs): Likewise.
2031 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2033 2017-07-11 Alan Modra <amodra@gmail.com>
2035 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2037 2017-07-11 Alan Modra <amodra@gmail.com>
2039 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2040 instruction" error using _bfd_error_handler, not einfo.
2042 2017-07-10 Nick Clifton <nickc@redhat.com>
2044 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2045 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2047 2017-07-07 John Baldwin <jhb@FreeBSD.org>
2049 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2051 2017-07-07 Alan Modra <amodra@gmail.com>
2053 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2055 2017-07-07 Alan Modra <amodra@gmail.com>
2057 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2058 as long long. Move code replacing "ll" with "I64", and simplify.
2060 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2062 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2065 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2067 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2069 (line_info_add_file_name): Likewise.
2070 (decode_line_info): Likewise.
2072 2017-07-04 Tristan Gingold <gingold@adacore.com>
2074 * version.m4: Bump version to 2.29.51
2075 * configure: Regenerate.
2077 2017-07-04 Jiong Wang <jiong.wang@arm.com>
2079 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2080 sanity check at the head of this function.
2082 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2084 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2085 dwarf_line_str_size.
2086 (struct attr_abbrev): Add field implicit_const.
2087 (dwarf_debug_sections): Add .debug_line_str.
2088 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2089 (dwarf_debug_section_assert): Add static assertion.
2090 (read_indirect_line_string): New.
2091 (read_abbrevs): Support DW_FORM_implicit_const.
2092 (is_str_attr): Support DW_FORM_line_strp.
2093 (read_attribute_value): Support DW_FORM_line_strp and
2094 DW_FORM_implicit_const.
2095 (read_attribute): Support DW_FORM_implicit_const.
2096 (line_info_add_include_dir, line_info_add_include_dir_stub):
2097 (line_info_add_file_name, read_formatted_entries): New.
2098 (decode_line_info, parse_comp_unit): Support DWARF 5.
2099 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2101 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2103 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2104 abort statement that was put for symbols that are not dynamic.
2106 2017-07-03 Tristan Gingold <gingold@adacore.com>
2108 * po/bfd.pot: Regenerate
2110 2017-07-03 Alan Modra <amodra@gmail.com>
2112 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2113 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
2114 * elf.c (setup_group): Use "Lx" to print sh_size.
2115 (_bfd_elf_setup_sections): Remove unnecessary cast and print
2116 unknown section type in hex.
2117 (copy_special_section_fields): Style fix.
2118 (bfd_section_from_shdr): Correct format for sh_link. Use a
2119 common error message for all the variants of unrecognized
2121 (assign_file_positions_for_load_sections): Use "Lx" for lma
2122 adjust error message.
2123 (assign_file_positions_for_non_load_sections): Formatting.
2124 (rewrite_elf_program_header): Formatting. Use "Lx" for
2125 bfd_vma values in error messages.
2126 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2127 ELF_R_SYM value to type expected by format.
2128 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2130 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2131 (elf_link_input_bfd): Use "Lx" for r_info.
2132 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2134 2017-07-03 Alan Modra <amodra@gmail.com>
2136 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2137 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2138 Microsoft C library variant of long long format specifier.
2139 (PRINT20): Cast value to bfd_uint64_t not long long.
2140 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2141 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2142 long long. Don't cast to bfd_vma.
2143 * elf32-score.c (score3_bfd_getl48): Likewise.
2144 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2146 2017-07-03 Alan Modra <amodra@gmail.com>
2148 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2150 (bfd_elf_print_symbol): Don't cast symbol->flags.
2151 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2152 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2153 _bfd_error_handler argument order.
2154 (ppc_elf_merge_private_bfd_data): Don't cast flags.
2156 2017-07-03 Alan Modra <amodra@gmail.com>
2158 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
2159 AC_TYPE_LONG_DOUBLE.
2160 * configure: Regenerate.
2161 * config.in: Regenerate.
2163 2017-06-29 Andrew Waterman <andrew@sifive.com>
2165 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2168 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2170 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2171 unless it is undefined weak.
2172 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2173 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2175 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2176 is not dynamic in PIC, abort.
2178 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2181 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2182 undefined weak symbols into dynamic.
2183 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2184 relocation for non-dynamic symbols.
2185 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2187 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2189 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2190 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2191 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2192 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2193 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2196 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
2198 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2199 (elfcore_write_s390_gs_bc): Likewise.
2200 * elf.c (elfcore_grok_s390_gs_cb): New function.
2201 (elfcore_grok_s390_gs_bc): New function.
2202 (elfcore_grok_note): Call them.
2203 (elfcore_write_s390_gs_cb): New function.
2204 (elfcore_write_s390_gs_bc): New function.
2205 (elfcore_write_register_note): Call them.
2207 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2209 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2210 bfd_get_file_size. Check archive element size.
2211 (_bfd_generic_get_section_contents_in_window): Likewise.
2213 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2215 * bfd-in2.h: Regenerated.
2216 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2217 (bfd_get_file_size): Likewise.
2219 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2220 Matthew Fortune <matthew.fortune@imgtec.com>
2222 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2223 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2224 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2225 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2227 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2228 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2229 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2230 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2231 `bfd_mach_mips_interaptiv_mr2' entries.
2232 * bfd-in2.h: Regenerate.
2234 2017-06-27 Nick Clifton <nickc@redhat.com>
2236 * tekhex.c (pass_over): Revert accidental conversion of a local
2237 array to a static array.
2239 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2242 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2243 reloc addend if necessary. Adjust diff only if
2244 shrinked_insn_address < end_address.
2246 2017-06-27 Alan Modra <amodra@gmail.com>
2249 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2250 (_bfd_generic_get_section_contents_in_window): Likewise.
2252 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2254 * elfnn-riscv.c (perform_relocation): Support the new
2255 R_RISCV_32_PCREL relocation.
2256 (riscv_elf_relocate_section): Likewise.
2257 * elfxx-riscv.c (howto_table): Likewise.
2258 (riscv_reloc_map): Likewise.
2259 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2260 * libbfd.h: Regenerate.
2262 2017-06-27 Alan Modra <amodra@gmail.com>
2265 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2266 Use unsigned file pointer type, and remove cast.
2267 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2268 Add "count", not "sz".
2270 2017-06-26 Pedro Alves <palves@redhat.com>
2273 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2276 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2279 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2282 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2284 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2285 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2286 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2287 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2288 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2290 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2293 * compress.c (bfd_get_full_section_contents): Don't check the
2295 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2296 reject a section whose size + offset is greater than the size
2298 (_bfd_generic_get_section_contents_in_window): Likewise.
2300 2017-06-26 Nick Clifton <nickc@redhat.com>
2303 * tekhex.c (getvalue): Check for the source pointer exceeding the
2304 end pointer before the first byte is read.
2306 2017-06-26 Nick Clifton <nickc@redhat.com>
2309 * opncls.c (get_build_id): Check that the section is big enough
2310 to contain the whole note.
2311 * compress.c (bfd_get_full_section_contents): Check for and reject
2312 a section whose size is greater than the size of the entire file.
2313 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2314 contain a notes section.
2316 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2318 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2320 (elf_s390_modify_segment_map): Likewise.
2321 (bfd_elf_s390_set_options): Lisewise.
2323 2017-06-26 Alan Modra <amodra@gmail.com>
2325 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2327 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2328 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2329 .preinit_array on --just-syms bfds.
2330 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2331 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2332 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2334 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2336 * elf.c (find_link): Bounds check "hint".
2338 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2340 * elf32-arm.c (using_thumb_only): Update list of architectures in
2341 BFD_ASSERT for which the logic is valid.
2342 (using_thumb2_bl): Likewise.
2343 (using_thumb2): Likewise and return true for ARMv8-R.
2344 (arch_has_arm_nop): Likewise.
2345 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2346 merging logic. Update commentis for value 15 of v8m_baseline,
2347 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2348 merging of value 15 of Tag_CPU_arch.
2350 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2352 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2353 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2354 * bfd-in2.h: Regenerate.
2356 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2358 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2359 the error_alignment label forward. Properly align program
2360 property note section.
2362 2017-06-22 Eric Christopher <echristo@gmail.com>
2364 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2365 abs to fix a truncation warning.
2367 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2369 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2370 local undefined weak symbol to 0.
2371 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2373 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2375 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2376 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2377 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2378 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2379 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2380 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2381 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2382 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2384 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2386 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2387 (elf_i386_lazy_ibt_plt_entry): Likewise.
2388 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2389 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2390 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2391 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2392 (elf_i386_lazy_plt_layout): Likewise.
2393 (elf_i386_non_lazy_plt_layout): Likewise.
2394 (elf_i386_link_hash_entry): Add plt_second.
2395 (elf_i386_link_hash_table): Add plt_second and
2396 plt_second_eh_frame.
2397 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2398 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2399 the second PLT. Check the second PLT.
2400 (elf_i386_relocate_section): Use the second PLT to resolve
2401 PLT reference if needed.
2402 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2404 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2405 second PLT. Generate unwind info for the second PLT.
2406 (elf_i386_plt_type): Add plt_second.
2407 (elf_i386_get_synthetic_symtab): Support the second PLT.
2408 (elf_i386_parse_gnu_properties): Support
2409 GNU_PROPERTY_X86_FEATURE_1_AND.
2410 (elf_i386_merge_gnu_properties): Support
2411 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2412 on GNU_PROPERTY_X86_FEATURE_1_IBT
2413 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2414 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2415 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2416 is set on all relocatable inputs.
2417 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2418 (elf_x32_lazy_ibt_plt_entry): Likewise.
2419 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2420 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2421 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2422 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2423 (elf_x86_64_lazy_ibt_plt): Likewise.
2424 (elf_x32_lazy_ibt_plt): Likewise.
2425 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2426 (elf_x32_non_lazy_ibt_plt): Likewise.
2427 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2428 (elf_x86_64_parse_gnu_properties): Support
2429 GNU_PROPERTY_X86_FEATURE_1_AND.
2430 (elf_x86_64_merge_gnu_properties): Support
2431 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2432 on GNU_PROPERTY_X86_FEATURE_1_IBT
2433 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2434 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2435 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2436 is set on all relocatable inputs.
2438 2017-06-22 Nick Clifton <nickc@redhat.com>
2441 * som.c (setup_sections): NUL terminate the space_strings buffer.
2442 Check that the space.name field does not index beyond the end of
2443 the space_strings buffer.
2445 2017-06-21 Nick Clifton <nickc@redhat.com>
2448 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2450 2017-06-21 Nick Clifton <nickc@redhat.com>
2453 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2454 type of the size parameter.
2455 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2456 length of the counted string.
2457 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2458 (_bfd_vms_save_counted_string): Likewise.
2459 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2460 _bfd_vms_save_counted_string.
2461 (_bfd_vms_slurp_ehdr): Likewise.
2462 (_bfd_vms_slurp_egsd): Likewise.
2463 (Parse_module): Likewise.
2465 2017-06-21 Alan Modra <amodra@gmail.com>
2467 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2468 calls before tocsave calls.
2469 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2472 2017-06-21 Nick Clifton <nickc@redhat.com>
2475 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2476 bfd_get_full_section_contents returns no contents.
2478 2017-06-21 Nick Clifton <nickc@redhat.com>
2481 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2484 2017-06-21 Nick Clifton <nickc@redhat.com>
2487 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2489 (image_set_ptr): Likewise.
2490 (alpha_vms_fix_sec_rel): Likewise.
2491 (alpha_vms_slurp_relocs): Likewise.
2493 2017-06-21 Nick Clifton <nickc@redhat.com>
2496 * ieee.c (ieee_slurp_sections): Check for a NULL return from
2498 (ieee_archive_p): Likewise.
2499 (ieee_object_p): Likewise.
2501 2017-06-21 Nick Clifton <nickc@redhat.com>
2504 * elf.c (setup_group): Zero the group section pointer list after
2505 allocation so that loops can be caught. Check for NULL pointers
2506 when processing a group list.
2508 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2510 * elf-s390.h: New file.
2511 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2513 (elf_s390_additional_program_headers): New function.
2514 (elf_s390_modify_segment_map): New function.
2515 (bfd_elf_s390_set_options): New function.
2516 (elf_backend_additional_program_headers)
2517 (elf_backend_modify_segment_map): Add macro definitions.
2519 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
2522 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
2523 the DYNAMIC bit instead of bfd_count_sections.
2525 2017-06-19 Nick Clifton <nickc@redhat.com>
2528 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
2530 (evax_bfd_print_eeom): Likewise.
2531 (evax_bfd_print_egsd): Check for an overlarge record length.
2532 (evax_bfd_print_etir): Likewise.
2534 2017-06-19 Nick Clifton <nickc@redhat.com>
2537 * libieee.h (struct common_header_type): Add end_p field.
2538 * ieee.c (this_byte_and_next): Do not advance input_p beyond
2540 (read_id): Check for a length that exceeds the remaining bytes in
2542 (ieee_seek): Initialise end_p.
2543 (ieee_archive_p): Likewise.
2544 (ieee_object_p): Likewise.
2546 2017-06-19 Nick Clifton <nickc@redhat.com>
2549 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
2550 before reading the EIHS structure entries.
2552 2017-06-19 Nick Clifton <nickc@redhat.com>
2555 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
2556 gsd_size. Check that there are enough bytes remaining to read the
2557 type and size of the next egsd. Check that the size of the egsd
2558 does not exceed the size of the record.
2560 2017-06-19 Alan Modra <amodra@gmail.com>
2562 * config.bfd: Correct targ_underscore for cris.
2564 2017-06-18 Alan Modra <amodra@gmail.com>
2566 * config.bfd: Correct targ_underscore for epiphany, ip2k,
2567 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
2569 2017-06-16 Nick Clifton <nickc@redhat.com>
2571 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
2572 bucketlist is empty because there are no symbols to add to the
2575 2017-06-16 Alan Modra <amodra@gmail.com>
2581 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
2582 (BFD_JUMP_TABLE_LINK): Likewise.
2583 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
2584 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
2585 (bfd_elf_define_start_stop): New function.
2586 * linker.c (bfd_generic_define_start_stop): New function.
2587 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
2589 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
2590 * aout-target.h (MY_bfd_define_start_stop): Define.
2591 * aout-tic30.c (MY_bfd_define_start_stop): Define.
2592 * binary.c (binary_bfd_define_start_stop): Define.
2593 * bout.c (b_out_bfd_define_start_stop): Define.
2594 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
2595 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
2596 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
2597 * coffcode.h (coff_bfd_define_start_stop): Define.
2598 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
2599 * i386msdos.c (msdos_bfd_define_start_stop): Define.
2600 * i386os9k.c (os9k_bfd_define_start_stop): Define.
2601 * ieee.c (ieee_bfd_define_start_stop): Define.
2602 * ihex.c (ihex_bfd_define_start_stop): Define.
2603 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
2604 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
2605 * mmo.c (mmo_bfd_define_start_stop): Define.
2606 * nlm-target.h (nlm_bfd_define_start_stop): Define.
2607 * oasys.c (oasys_bfd_define_start_stop): Define.
2608 * pef.c (bfd_pef_bfd_define_start_stop): Define.
2609 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
2610 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
2611 * som.c (som_bfd_define_start_stop): Define.
2612 * srec.c (srec_bfd_define_start_stop): Define.
2613 * tekhex.c (tekhex_bfd_define_start_stop): Define.
2614 * versados.c (versados_bfd_define_start_stop): Define.
2615 * vms-alpha.c (vms_bfd_define_start_stop): Define.
2616 (alpha_vms_bfd_define_start_stop): Define.
2617 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
2618 * bfd-in2.h: Regenerate.
2619 * libbfd.h: Regenerate.
2621 2017-06-16 Jiong Wang <jiong.wang@arm.com>
2623 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
2624 SYMBOL_REFERENCES_LOCAL.
2626 2017-06-15 Jiong Wang <jiong.wang@arm.com>
2629 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
2630 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
2631 runtime for if there needs copy relocation elimination.
2632 (need_copy_relocation_p): New function. Return true for symbol with
2633 pc-relative references and if it's against read-only sections.
2634 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
2635 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
2636 that are related with accessing external objects.
2637 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
2638 in elfNN_aarch64_check_relocs.
2640 2017-06-15 Nick Clifton <nickc@redhat.com>
2643 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
2646 (ieee_archive_p): Likewise.
2648 2017-06-15 Nick Clifton <nickc@redhat.com>
2651 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
2653 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
2655 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
2656 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
2657 keep both windowed and call0 ABI PLT definitions.
2658 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
2659 elf_xtensa_*_plt_entry endex.
2660 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
2662 2017-06-14 Nick Clifton <nickc@redhat.com>
2665 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
2668 2017-06-14 Nick Clifton <nickc@redhat.com>
2671 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
2672 maximum value for the ascic pointer. Check that name processing
2673 does not read beyond this value.
2674 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
2677 2017-06-14 Nick Clifton <nickc@redhat.com>
2680 * versados.c (versados_mkobject): Zero the allocated tdata structure.
2681 (process_otr): Check for an invalid offset in the otr structure.
2683 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
2685 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
2687 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
2693 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
2694 vtable field to a union.
2695 (_bfd_elf_is_start_stop): Removed.
2696 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
2697 __start_SECNAME and __stop_SECNAME symbols.
2698 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
2699 * elflink.c (_bfd_elf_is_start_stop): Removed.
2700 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
2701 _bfd_elf_is_start_stop.
2702 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
2703 __stop_SECNAME symbols. Updated.
2704 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2705 (bfd_elf_gc_record_vtinherit): Likewise.
2706 (bfd_elf_gc_record_vtentry): Likewise.
2708 2017-06-13 Nick Clifton <nickc@redhat.com>
2711 * elflink.c (elf_link_adjust_relocs): Generate an error when
2712 encountering a reloc against a symbol removed by garbage
2715 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
2717 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
2718 to merge_gnu_properties.
2719 * elf-properties.c (elf_merge_gnu_properties): Add struct
2720 bfd_link_info * and pass it to merge_gnu_properties.
2721 (elf_merge_gnu_property_list): Add struct bfd_link_info *
2722 and pass it to elf_merge_gnu_properties.
2723 (_bfd_elf_link_setup_gnu_properties): Pass info to
2724 elf_merge_gnu_property_list.
2725 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
2727 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
2729 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
2732 * binary.c (binary_set_section_contents): Scale lma by octets
2733 per byte to set filepos.
2735 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2737 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
2740 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2742 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
2745 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2747 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
2748 patched section contents for TLS IE reloc.
2749 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
2751 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2753 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
2754 RELOC_FOR_GLOBAL_SYMBOL macro.
2756 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2758 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
2761 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2763 * config/tc-arc.c (md_undefined_symbol): Changed.
2764 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
2766 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2768 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
2771 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2773 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
2774 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
2776 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2778 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
2781 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
2783 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
2784 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
2785 is non-zero. Add clarifying comments.
2787 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
2789 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
2790 name. Use local IFUNC symbol name string to report unsupported
2791 non-PIC call to IFUNC function.
2792 (elf_i386_relocate_section): Dump local IFUNC name with minfo
2793 when generating R_386_IRELATIVE relocation.
2794 (elf_i386_finish_dynamic_symbol): Likewise.
2795 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
2797 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
2798 when generating R_X86_64_IRELATIVE relocation.
2799 (elf_x86_64_finish_dynamic_symbol): Likewise.
2801 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2803 * elf.c (setup_group): Make sure BFD sections are created for all
2804 group sections in the input file when processing SHF_GROUP
2806 (bfd_section_from_shdr): Avoid duplicating logic already
2807 implemented in `setup_group'.
2809 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
2812 * peXXigen.c (pe_print_idata): Use the address of the first thunk
2813 if the hint address is zero.
2815 2017-06-06 James Clarke <jrtc27@jrtc27.com>
2818 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
2819 ELF_COMMON_DEF_P for common symbols.
2821 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
2823 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
2824 SEC_GROUP sections as SEC_EXCLUDE.
2825 (bfd_elf_set_group_contents): Replace use of abort with an assert.
2826 (assign_section_numbers): Use resolve_section_groups flag instead
2827 of relocatable link type.
2828 (_bfd_elf_init_private_section_data): Use resolve_section_groups
2829 flag instead of checking the final_link flag for part of the
2830 checks in here. Fix white space as a result.
2831 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
2832 instead of relocatable link type.
2833 (bfd_elf_final_link): Likewise.
2835 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2837 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
2839 * elf32-score.c (score_elf_final_link_relocate): Likewise.
2840 (s3_bfd_score_elf_check_relocs): Likewise.
2841 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2842 (score_elf_final_link_relocate): Likewise.
2843 (s7_bfd_score_elf_check_relocs): Likewise.
2845 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2847 * elflink.c (init_reloc_cookie_rels): Remove unused variable
2850 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
2852 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
2853 from `reloc_count' rather than decrementing it.
2854 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
2855 `reloc_count' by `int_rels_per_ext_rel'.
2856 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
2857 `reloc_count' by `int_rels_per_ext_rel' for last relocation
2858 entry determination.
2859 (s3_bfd_score_elf_check_relocs): Likewise.
2860 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
2861 (s7_bfd_score_elf_relocate_section): Likewise.
2862 (s7_bfd_score_elf_check_relocs): Likewise.
2863 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
2864 prototype and function.
2865 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
2866 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
2867 triple rather than once the sum of REL and RELA relocation entry
2869 (bfd_elf64_get_reloc_upper_bound): Remove macro.
2870 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
2871 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
2872 storage allocation size determination.
2873 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
2874 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
2875 by `int_rels_per_ext_rel' for last relocation entry
2877 (bfd_elf_final_link): Do not multiply `reloc_count' by
2878 `int_rels_per_ext_rel' for internal relocation storage
2879 allocation size determination.
2880 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
2881 `int_rels_per_ext_rel' for last relocation entry determination.
2882 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2883 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2884 (_bfd_mips_elf_relocate_section): Likewise.
2886 2017-06-05 Alan Modra <amodra@gmail.com>
2889 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
2891 2017-06-01 John Baldwin <jhb@FreeBSD.org>
2893 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
2894 determine structure sizes.
2895 (elfcore_grok_freebsd_prstatus): Likewise.
2897 2017-06-01 Alan Modra <amodra@gmail.com>
2899 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
2900 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
2902 (is_elfv2_localentry0): New function.
2903 (ppc64_elf_tls_setup): Default params->plt_localentry0.
2904 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
2905 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
2906 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
2907 optimized localentry:0 stubs.
2908 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
2909 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
2911 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
2913 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
2915 2017-05-30 Casey Smith <clegg89@gmail.com>
2918 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
2919 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
2921 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
2923 * cpu-arc.c (arc_compatible): New function.
2925 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
2927 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
2929 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
2932 * bfdio.c (bfd_get_file_size): New function.
2933 * bfd-in2.h: Regenerated.
2935 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
2937 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
2940 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
2942 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
2943 dynobj instead of htab->elf.dynobj.
2945 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
2947 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
2949 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
2950 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
2951 actual number of internal relocations retrieved. Adjust
2952 function description.
2953 (bfd_elf64_canonicalize_reloc): Remove macro.
2954 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
2956 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
2958 * archures.c (bfd_mach_sparc_v9m8): Define.
2959 (bfd_mach_sparc_v8plusm8): Likewise.
2960 (bfd_mach_sparc_v9_p): Adjust to M8.
2961 (bfd_mach_sparc_64bit_p): Likewise.
2962 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
2963 bfd_mach_sparc_v8plusm8.
2964 * bfd-in2.h: Regenerated.
2965 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
2967 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
2968 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
2969 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
2971 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
2972 bfd_mach_sparc_v8plusm8.
2974 2017-05-19 Alan Modra <amodra@gmail.com>
2976 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
2977 debug and special sections when no non-note alloc sections in an
2980 2017-05-18 Alan Modra <amodra@gmail.com>
2982 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
2983 * elf-m10300.c: Likewise.
2985 * elf32-arc.c: Likewise.
2986 * elf32-bfin.c: Likewise.
2987 * elf32-m68k.c: Likewise.
2988 * elf32-nds32.c: Likewise.
2989 * elf32-tilepro.c: Likewise.
2990 * elflink.c: Likewise.
2991 * elfnn-aarch64.c: Likewise.
2992 * elfnn-riscv.c: Likewise.
2993 * elfxx-tilegx.c: Likewise.
2994 * mach-o.c: Likewise.
2995 * peXXigen.c: Likewise.
2996 * vms-alpha.c: Likewise.
2997 * vms-lib.c: Likewise.
2999 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3002 * elflink.c (elf_gc_mark_debug_section): New function.
3003 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3004 referenced by kept debug sections.
3006 2017-05-16 Alan Modra <amodra@gmail.com>
3008 * elf-m10300.c: Rename occurrences of non_ir_ref.
3009 * elf32-arm.c: Likewise.
3010 * elf32-bfin.c: Likewise.
3011 * elf32-cr16.c: Likewise.
3012 * elf32-cris.c: Likewise.
3013 * elf32-d10v.c: Likewise.
3014 * elf32-dlx.c: Likewise.
3015 * elf32-fr30.c: Likewise.
3016 * elf32-frv.c: Likewise.
3017 * elf32-hppa.c: Likewise.
3018 * elf32-i370.c: Likewise.
3019 * elf32-i386.c: Likewise.
3020 * elf32-iq2000.c: Likewise.
3021 * elf32-lm32.c: Likewise.
3022 * elf32-m32c.c: Likewise.
3023 * elf32-m32r.c: Likewise.
3024 * elf32-m68hc1x.c: Likewise.
3025 * elf32-m68k.c: Likewise.
3026 * elf32-mcore.c: Likewise.
3027 * elf32-metag.c: Likewise.
3028 * elf32-microblaze.c: Likewise.
3029 * elf32-moxie.c: Likewise.
3030 * elf32-msp430.c: Likewise.
3031 * elf32-mt.c: Likewise.
3032 * elf32-nios2.c: Likewise.
3033 * elf32-or1k.c: Likewise.
3034 * elf32-ppc.c: Likewise.
3035 * elf32-rl78.c: Likewise.
3036 * elf32-s390.c: Likewise.
3037 * elf32-score.c: Likewise.
3038 * elf32-score7.c: Likewise.
3039 * elf32-sh.c: Likewise.
3040 * elf32-tic6x.c: Likewise.
3041 * elf32-tilepro.c: Likewise.
3042 * elf32-v850.c: Likewise.
3043 * elf32-vax.c: Likewise.
3044 * elf32-xstormy16.c: Likewise.
3045 * elf32-xtensa.c: Likewise.
3046 * elf64-alpha.c: Likewise.
3047 * elf64-hppa.c: Likewise.
3048 * elf64-ia64-vms.c: Likewise.
3049 * elf64-mmix.c: Likewise.
3050 * elf64-ppc.c: Likewise.
3051 * elf64-s390.c: Likewise.
3052 * elf64-sh64.c: Likewise.
3053 * elf64-x86-64.c: Likewise.
3054 * elflink.c: Likewise.
3055 * elfnn-aarch64.c: Likewise.
3056 * elfnn-ia64.c: Likewise.
3057 * elfnn-riscv.c: Likewise.
3058 * elfxx-mips.c: Likewise.
3059 * elfxx-sparc.c: Likewise.
3060 * elfxx-tilegx.c: Likewise.
3061 * linker.c: Likewise.
3063 2017-05-16 Alan Modra <amodra@gmail.com>
3065 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3066 * elflink.c (elf_link_add_object_symbols): Update to use
3068 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3070 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3072 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3074 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3076 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3078 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3079 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3081 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3083 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3085 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3087 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3088 to plt_second/plt_second_eh_frame.
3089 (elf_x86_64_link_hash_newfunc): Updated.
3090 (elf_x86_64_allocate_dynrelocs): Likewise.
3091 (elf_x86_64_size_dynamic_sections): Likewise.
3092 (elf_x86_64_relocate_section): Likewise.
3093 (elf_x86_64_finish_dynamic_symbol): Likewise.
3094 (elf_x86_64_finish_dynamic_sections): Likewise.
3095 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3096 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3098 (elf_backend_setup_gnu_properties): Updated. Create the
3099 .plt.sec section instead of the .plt.sec section.
3101 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3103 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3104 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3105 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3107 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3109 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3110 (bfd_elf64_set_reloc): Define.
3111 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3113 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3115 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3116 (struct bfd_target): New field _bfd_set_reloc.
3117 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3118 * reloc.c (_bfd_generic_set_reloc): New function.
3119 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3120 * nlm-target.h (nlm_set_reloc): Likewise.
3121 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3122 * aout-tic30.c (MY_set_reloc): Likewise.
3123 * aout-target.h (MY_set_reloc): Likewise.
3124 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3125 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3126 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3127 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3128 * aout-adobe.c (aout_32_set_reloc): Likewise.
3129 * bout.c (b_out_set_reloc): Likewise.
3130 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3131 * i386os9k.c (aout_32_set_reloc): Likewise.
3132 * ieee.c (ieee_set_reloc): Likewise.
3133 * oasys.c (oasys_set_reloc): Likewise.
3134 * som.c (som_set_reloc): Likewise.
3135 * versados.c (versados_set_reloc): Likewise.
3136 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3137 _bfd_generic_set_reloc.
3138 (rs6000_xcoff64_aix_vec): LIkewise.
3139 * libbfd.c (_bfd_norelocs_set_reloc): New function.
3140 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3141 * i386msdos.c (msdos_set_reloc): Define to
3142 _bfd_norelocs_set_reloc.
3143 * elfcode.h (elf_set_reloc): Define.
3144 * bfd-in2.h: Regenerated.
3146 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
3149 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3150 for IFUNC function address.
3152 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
3154 * elf32-arc.c (FEATURE_LIST_NAME): Define.
3155 (CONFLICT_LIST): Likewise.
3156 (opcode/arc-attrs.h): Include.
3157 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3158 (arc_extract_features): New file.
3159 (arc_stralloc): Likewise.
3160 (arc_elf_merge_attributes): Likewise.
3161 (arc_elf_merge_private_bfd_data): Use object attributes.
3162 (bfd_arc_get_mach_from_attributes): New function.
3163 (arc_elf_object_p): Use object attributes.
3164 (arc_elf_final_write_processing): Likewise.
3165 (elf32_arc_obj_attrs_arg_type): New function.
3166 (elf32_arc_obj_attrs_handle_unknown): Likewise.
3167 (elf32_arc_section_from_shdr): Likewise.
3168 (elf_backend_obj_attrs_vendor): Define.
3169 (elf_backend_obj_attrs_section): Likewise.
3170 (elf_backend_obj_attrs_arg_type): Likewise.
3171 (elf_backend_obj_attrs_section_type): Likewise.
3172 (elf_backend_obj_attrs_handle_unknown): Likewise.
3173 (elf_backend_section_from_shdr): Likewise.
3175 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
3178 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3179 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3180 and the destination is a Thumb symbol.
3182 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3184 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3185 initializer to silence GCC 4.2.
3186 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3188 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3190 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3191 (LAZY_PLT_ENTRY_SIZE): This.
3192 (NON_LAZY_PLT_ENTRY_SIZE): New.
3193 (elf_x86_64_plt0_entry): Renamed to ...
3194 (elf_x86_64_lazy_plt0_entry): This.
3195 (elf_x86_64_plt_entry): Renamed to ...
3196 (elf_x86_64_lazy_plt_entry): This.
3197 (elf_x86_64_bnd_plt0_entry): Renamed to ...
3198 (elf_x86_64_lazy_bnd_plt0_entry): This.
3199 (elf_x86_64_legacy_plt_entry): Removed.
3200 (elf_x86_64_bnd_plt_entry): Renamed to ...
3201 (elf_x86_64_lazy_bnd_plt_entry): This.
3202 (elf_x86_64_legacy_plt2_entry): Renamed to ...
3203 (elf_x86_64_non_lazy_plt_entry): This.
3204 (elf_x86_64_bnd_plt2_entry): Renamed to ...
3205 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3206 (elf_x86_64_eh_frame_plt): Renamed to ...
3207 (elf_x86_64_eh_frame_lazy_plt): This.
3208 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3209 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3210 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3211 (elf_x86_64_eh_frame_non_lazy_plt): This.
3212 (elf_x86_64_lazy_plt_layout): New.
3213 (elf_x86_64_non_lazy_plt_layout): Likewise.
3214 (elf_x86_64_plt_layout): Likewise.
3215 (elf_x86_64_backend_data): Remove PLT layout information. Add
3216 os for target system.
3217 (GET_PLT_ENTRY_SIZE): Removed.
3218 (elf_x86_64_lazy_plt): New.
3219 (elf_x86_64_non_lazy_plt): Likewise.
3220 (elf_x86_64_lazy_bnd_plt): Likewise.
3221 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3222 (elf_x86-64_arch_bed): Updated.
3223 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3224 (elf_x86_64_create_dynamic_sections): Removed.
3225 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3226 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3227 (elf_x86-64_adjust_dynamic_symbol): Updated.
3228 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3229 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3230 size for PLT0 if there is no PLT0. Get plt_entry_size from
3231 non_lazy_plt for non-lazy PLT entries.
3232 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3233 from non_lazy_plt for non-lazy PLT entries.
3234 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3235 if there is no PLT0.
3236 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3237 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3238 entries with non-lazy PLT layout. Don't fill the second and third
3239 slots in the PLT entry if there is no PLT0.
3240 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3241 if there is no PLT0. Set sh_entsize on the .plt.got section.
3242 (compare_relocs): New.
3243 (elf_x86_64_plt_type): Likewise.
3244 (elf_x86_64_plt): Likewise.
3245 (elf_x86_64_nacl_plt): New. Forward declaration.
3246 (elf_x86_64_get_plt_sym_val): Removed.
3247 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3248 against all dynamic relocations.
3249 (elf_x86_64_link_setup_gnu_properties): New function.
3250 (elf_backend_create_dynamic_sections): Updated.
3251 (elf_backend_setup_gnu_properties): New.
3252 (elf_x86_64_nacl_plt): New.
3253 (elf_x86_64_nacl_arch_bed): Updated.
3255 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3257 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3258 (LAZY_PLT_ENTRY_SIZE): This.
3259 (NON_LAZY_PLT_ENTRY_SIZE): New.
3260 (elf_i386_plt0_entry): Renamed to ...
3261 (elf_i386_lazy_plt0_entry): This.
3262 (elf_i386_plt_entry): Renamed to ...
3263 (elf_i386_lazy_plt_entry): This.
3264 (elf_i386_pic_plt0_entry): Renamed to ...
3265 (elf_i386_pic_lazy_plt0_entry): This.
3266 (elf_i386_pic_plt_entry): Renamed to ...
3267 (elf_i386_pic_lazy_plt_entry): This.
3268 (elf_i386_got_plt_entry): Renamed to ...
3269 (elf_i386_non_lazy_plt_entry): This.
3270 (elf_i386_pic_got_plt_entry): Renamed to ...
3271 (elf_i386_pic_non_lazy_plt_entry): This.
3272 (elf_i386_eh_frame_plt): Renamed to ...
3273 (elf_i386_eh_frame_lazy_plt): This.
3274 (elf_i386_eh_frame_plt_got): Renamed to ...
3275 (elf_i386_eh_frame_non_lazy_plt): This.
3276 (elf_i386_plt_layout): Renamed to ...
3277 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3278 eh_frame_plt_got_size.
3279 (elf_i386_non_lazy_plt_layout): New.
3280 (elf_i386_plt_layout): Likewise.
3281 (elf_i386_non_lazy_plt): Likewise.
3282 (GET_PLT_ENTRY_SIZE): Removed.
3283 (elf_i386_plt): Renamed to ...
3284 (elf_i386_lazy_plt): This.
3285 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3286 (elf_i386_arch_bed): Updated.
3287 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3288 (elf_i386_create_dynamic_sections): Removed.
3289 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3290 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3291 (elf_i386_adjust_dynamic_symbol): Updated.
3292 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3293 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3294 size for PLT0 if there is no PLT0.
3295 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3296 output section is discarded only if GOT isn't empty.
3297 (elf_i386_relocate_section): Updated. Properly get PLT index
3298 if there is no PLT0.
3299 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3300 second and third slots in the PLT entry if there is no PLT0.
3301 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3302 if there is no PLT0. Set sh_entsize on the .plt.got section.
3303 (elf_i386_nacl_plt): Forward declaration.
3304 (elf_i386_get_plt_sym_val): Removed.
3305 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3306 against all dynamic relocations.
3307 (elf_i386_link_setup_gnu_properties): New function.
3308 (elf_backend_create_dynamic_sections): Updated.
3309 (elf_backend_setup_gnu_properties): New.
3310 (elf_i386_nacl_plt): Updated.
3311 (elf_i386_nacl_arch_bed): Likewise.
3312 (elf_i386_vxworks_arch_bed): Likewise.
3314 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3316 * elflink.c (elf_output_implib): Remove executable flag from import
3318 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3319 library is a relocatable object file.
3321 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3324 * elf32-avr.c (avr_should_move_sym): New function.
3325 (avr_should_reduce_sym_size): Likewise.
3326 (avr_should_increase_sym_size): Likewise.
3327 (elf32_avr_relax_delete_bytes): Adjust symbol values
3328 and sizes by calling new functions.
3330 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3332 * config.bfd (riscv32-*): Enable rv64.
3334 2017-05-02 Alan Modra <amodra@gmail.com>
3337 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3338 rather than h->root.type == bfd_link_hash_new.
3339 (bfd_elf_record_link_assignment): Similarly, call
3340 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3342 2017-04-29 Alan Modra <amodra@gmail.com>
3345 * reloc.c (reloc_offset_in_range): New function.
3346 (bfd_perform_relocation, bfd_install_relocation): Use it.
3347 (_bfd_final_link_relocate): Likewise.
3349 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3351 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3352 before using .plt.got.
3353 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3355 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3357 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3358 instead of "+=" to update 0.
3360 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3362 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3363 .plt.got section here.
3364 (elf_i386_check_relocs): Don't create the .plt.got section.
3365 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3366 the .plt.got and .plt.bnd sections here.
3367 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3370 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3372 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3374 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3375 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3376 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3377 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3380 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3382 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3384 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3385 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3386 the first relocatable ELF input with GNU properties.
3388 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3390 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3391 VxWorks for non-PIC.
3393 2017-04-27 Alan Modra <amodra@gmail.com>
3395 * elf-bfd.h (struct elf_backend_data): Make asection param of
3396 elf_backend_eh_frame_address_size const.
3397 (_bfd_elf_eh_frame_address_size): Likewise.
3398 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3399 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3400 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3401 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3402 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3403 (next_cie_fde_offset): Constify params.
3404 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3406 2017-04-27 Alan Modra <amodra@gmail.com>
3408 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3409 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3410 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3412 (offset_adjust): New function.
3413 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3414 (adjust_eh_frame_local_symbols): Likewise.
3415 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3416 after changing anything. Return true if anything changed.
3417 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3418 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3420 2017-04-27 Alan Modra <amodra@gmail.com>
3422 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3425 2017-04-27 Alan Modra <amodra@gmail.com>
3427 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3428 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3429 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3430 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3431 for undef and undefweak dyn_relocs.
3432 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3433 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3434 (allocate_got, allocate_dynrelocs): Likewise.
3435 (ppc64_elf_relocate_section): Likewise.
3437 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3439 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3440 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3441 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3442 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3444 2017-04-26 Nick Clifton <nickc@redhat.com>
3447 * reloc.c (bfd_perform_relocation): Check for a negative address
3450 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3453 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3455 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3456 (elf_backend_always_renumber_dynsyms): Define.
3457 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3458 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3459 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3460 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3462 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3464 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3466 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3467 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3468 sections have been created.
3470 2017-04-26 Nick Clifton <nickc@redhat.com>
3473 * compress.c (bfd_init_section_compress_status): Check the return
3474 value from bfd_malloc.
3476 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3478 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3479 no_finish_dynamic_symbol.
3480 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3482 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3483 weak symbol, don't make it dynamic.
3484 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3485 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3486 relocation for GOT reference.
3487 (elf_x86_64_finish_dynamic_symbol): Abort if
3488 no_finish_dynamic_symbol isn't 0.
3490 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3493 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3494 undefined weak symbol, don't make it dynamic.
3495 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3496 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3497 relocation for R_386_GOT32.
3499 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3502 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3504 2017-04-23 Alan Modra <amodra@gmail.com>
3507 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3508 * elf.c (lcomm_sym): New.
3509 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3510 * bfd-in2.h: Regenerate.
3512 2017-04-23 Alan Modra <amodra@gmail.com>
3515 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3516 parameters and comment.
3517 (_bfd_elf_get_reloc_section): Delete.
3518 (_bfd_elf_plt_get_reloc_section): Declare.
3519 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3520 New functions. Don't blindly skip over assumed .rel/.rela prefix.
3522 (_bfd_elf_get_reloc_section): ..here. Delete.
3523 (assign_section_numbers): Call elf_get_reloc_section.
3524 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
3525 * elfxx-target.h (elf_backend_get_reloc_section): Update.
3527 2017-04-23 Alan Modra <amodra@gmail.com>
3530 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
3533 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3536 * elf32-i386.c (elf_i386_link_hash_entry): Add
3537 no_finish_dynamic_symbol.
3538 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
3539 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
3540 symbol, don't make it dynamic in PIE.
3541 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
3542 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3543 relocation for R_386_GOT32
3544 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
3547 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3551 * elflink.c (elf_link_add_object_symbols): Require
3552 --no-dynamic-linker with -E/--dynamic-list when creating
3555 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3557 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
3560 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3562 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
3563 dynamic symbol sorting.
3565 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
3568 * elflink.c (elf_link_add_object_symbols): Preserve
3569 dynamic_ref_after_ir_def when restoring the symbol table for
3570 unneeded dynamic object.
3572 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
3575 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
3576 on on undefined IFUNC symbol in the second PLT.
3578 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
3580 * peXXigen.c (pe_print_reloc): Correct chunk_end.
3582 2017-04-19 Alan Modra <amodra@gmail.com>
3584 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
3585 or make dynamic for info->dynamic_undefined_weak 0 and 1.
3586 * elf32-ppc.c:Formatting.
3587 (ensure_undefweak_dynamic): Don't make dynamic when
3588 info->dynamic_undefined_weak is zero.
3589 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3590 info->dynamic_undefined_weak. Discard undef dyn_relocs when
3591 not default visibility. Discard undef and undefweak
3593 (ppc_elf_relocate_section): Adjust to suit.
3594 * elf64-ppc.c: Formatting.
3595 (ensure_undefweak_dynamic): Don't make dynamic when
3596 info->dynamic_undefined_weak is zero.
3597 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3598 info->dynamic_undefined_weak. Discard them earlier.
3600 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
3603 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
3604 before generating the version definition section.
3606 2017-04-17 Alan Modra <amodra@gmail.com>
3608 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
3609 state when a regular object file defines a symbol with
3610 incompatible type to that defined by an earlier shared lib.
3612 2017-04-13 Alan Modra <amodra@gmail.com>
3614 * coffcode.h: Wrap some overly long _bfd_error_handler args.
3616 * elf32-arm.c: Likewise.
3617 * elf32-i386.c: Likewise.
3618 * elf32-mep.c: Likewise.
3619 * elf64-ia64-vms.c: Likewise.
3620 * elf64-x86-64.c: Likewise.
3621 * elflink.c: Likewise.
3622 * elfnn-ia64.c: Likewise.
3623 * elfxx-mips.c: Likewise.
3625 2017-04-13 Alan Modra <amodra@gmail.com>
3627 * aoutx.h: Use %B and %A in error messages throughout file.
3628 * aout-cris.c: Likewise.
3629 * archive.c: Likewise.
3630 * binary.c: Likewise.
3631 * coff-rs6000.c: Likewise.
3632 * coff-tic4x.c: Likewise.
3633 * coffcode.h: Likewise.
3634 * coffgen.c: Likewise.
3635 * cofflink.c: Likewise.
3636 * coffswap.h: Likewise.
3637 * cpu-arm.c: Likewise.
3638 * elf-eh-frame.c: Likewise.
3639 * elf-m10300.c: Likewise.
3641 * elf32-arc.c: Likewise.
3642 * elf32-arm.c: Likewise.
3643 * elf32-bfin.c: Likewise.
3644 * elf32-frv.c: Likewise.
3645 * elf32-iq2000.c: Likewise.
3646 * elf32-m32c.c: Likewise.
3647 * elf32-microblaze.c: Likewise.
3648 * elf32-nds32.c: Likewise.
3649 * elf32-rl78.c: Likewise.
3650 * elf32-rx.c: Likewise.
3651 * elf32-score.c: Likewise.
3652 * elf32-score7.c: Likewise.
3653 * elf32-sh64.c: Likewise.
3654 * elf32-v850.c: Likewise.
3655 * elf32-vax.c: Likewise.
3656 * elf32-visium.c: Likewise.
3657 * elf64-ia64-vms.c: Likewise.
3658 * elf64-mmix.c: Likewise.
3659 * elf64-sh64.c: Likewise.
3660 * elfcode.h: Likewise.
3661 * elfnn-aarch64.c: Likewise.
3662 * elfnn-ia64.c: Likewise.
3663 * elfxx-mips.c: Likewise.
3664 * hpux-core.c: Likewise.
3667 * linker.c: Likewise.
3668 * merge.c: Likewise.
3670 * oasys.c: Likewise.
3671 * pdp11.c: Likewise.
3672 * peXXigen.c: Likewise.
3673 * rs6000-core.c: Likewise.
3674 * vms-alpha.c: Likewise.
3675 * xcofflink.c: Likewise.
3677 2017-04-13 Alan Modra <amodra@gmail.com>
3679 * bfd.c (PRINT_TYPE): Define.
3680 (_doprnt): New function.
3681 (error_handler_internal): Use _doprnt.
3682 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
3683 calls in their natural order, throughout file.
3684 * coff-mcore.c: Likewise.
3685 * coff-ppc.c: Likewise.
3686 * coff-tic80.c: Likewise.
3687 * cofflink.c: Likewise.
3688 * elf-s390-common.c: Likewise.
3690 * elf32-arm.c: Likewise.
3691 * elf32-i386.c: Likewise.
3692 * elf32-m32r.c: Likewise.
3693 * elf32-msp430.c: Likewise.
3694 * elf32-spu.c: Likewise.
3695 * elf64-ia64-vms.c: Likewise.
3696 * elf64-sparc.c: Likewise.
3697 * elf64-x86-64.c: Likewise.
3698 * elflink.c: Likewise.
3699 * elfnn-aarch64.c: Likewise.
3700 * elfnn-ia64.c: Likewise.
3701 * elfxx-mips.c: Likewise.
3703 2017-04-13 Alan Modra <amodra@gmail.com>
3705 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
3706 branch veneers" error. Fix double space and format message.
3707 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
3708 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
3710 2017-04-13 Alan Modra <amodra@gmail.com>
3712 * bfd-in2.h: Regenerate.
3714 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3716 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
3717 extra `\n' in warning/error messages.
3718 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
3719 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3721 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3723 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
3724 processor-specific properties with generic ELF target vector.
3726 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
3728 * elf32-sparc.c (elf_backend_fixup_symbol): New.
3729 * elf64-sparc.c (elf_backend_fixup_symbol): New.
3730 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
3731 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
3733 (link_hash_newfunc): Initialize has_got_reloc and
3735 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
3737 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
3739 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
3741 (_bfd_sparc_elf_fixup_symbol): New function.
3742 (allocate_dynrelocs): Don't allocate space for dynamic
3743 relocations and discard relocations against resolved undefined
3744 weak symbols in executable. Don't make resolved undefined weak
3745 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
3746 relocation against undefined weak symbols in PIE.
3747 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
3748 relocations against resolved undefined weak symbols in PIE
3749 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
3750 without ynamic PLT/GOT relocations for resolved undefined weak
3752 Don't generate dynamic relocation against resolved undefined
3753 weak symbol in executable.
3754 (pie_finish_undefweak_symbol): New function.
3755 (_bfd_sparc_elf_finish_dynamic_sections): Call
3756 pie_finish_undefweak_symbol on all symbols in PIE.
3757 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
3758 (_bfd_sparc_elf_fixup_symbol): New function.
3760 2017-04-10 Nick Clifton <nickc@redhat.com>
3762 * config.bfd: Remove ns32k from obsolete list.
3764 2017-04-10 Alan Modra <amodra@gmail.com>
3767 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
3768 (special_sections_i): Likewise for .init_array.
3769 (special_sections_p): Likewise for .preinit_array.
3771 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
3775 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
3776 ELF_COMMON_DEF_P for common symbols.
3777 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3778 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
3779 * elflink.c (_bfd_elf_merge_symbol): Revert commits
3780 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
3781 07492f668d2173da7a2bda3707ff0985e0f460b6.
3783 2017-04-07 Pedro Alves <palves@redhat.com>
3785 * opncls.c (bfd_get_debug_link_info): Rename to...
3786 (bfd_get_debug_link_info_1): ... this. Change type of second
3787 parameter to void pointer. Adjust.
3788 (bfd_get_debug_link_info): Reimplement on top of
3789 bfd_get_debug_link_info_1.
3790 (separate_debug_file_exists, separate_alt_debug_file_exists):
3791 Change type of second parameter to void pointer. Adjust.
3792 (get_func_type, check_func_type): Change type of second parameter
3794 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
3795 the callback functions instead of passing the address of a local.
3796 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
3797 find_separate_debug_file.
3798 (get_alt_debug_link_info_shim): Change type of second parameter to
3799 void pointer. Adjust.
3800 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
3801 find_separate_debug_file.
3802 (get_build_id_name, bfd_boolean check_build_id_file): Change type
3803 of second parameter to void pointer. Adjust.
3804 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
3805 pointer local to find_separate_debug_file.
3807 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
3809 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
3810 external symbols with a definition.
3811 (_bfd_coff_gc_mark_extra_sections): Fix typo.
3813 2017-04-07 Alan Modra <amodra@gmail.com>
3815 * po/SRC-POTFILES.in: Regenerate.
3817 2017-04-05 Alan Modra <amodra@gmail.com>
3819 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
3822 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
3824 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
3825 numbers for DataDirectory entry indicies passed to
3828 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
3830 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
3831 each GNU_MBIND section and align GNU_MBIND section to page size.
3832 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
3833 segment for each GNU_MBIND section.
3834 (_bfd_elf_init_private_section_data): Copy sh_info from input
3835 for GNU_MBIND section.
3837 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
3839 * elfnn-riscv.c (GP_NAME): Delete.
3840 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
3841 (_bfd_riscv_relax_lui): Likewise.
3843 2017-04-04 Nick Clifton <nickc@redhat.com>
3846 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
3848 (bfd_elf_final_link): Only initialize the extended symbol index
3849 section if there are extended symbol tables to list.
3851 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
3853 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
3854 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
3855 * configure.ac (elf): Add elf-properties.lo.
3856 * Makefile.in: Regenerated.
3857 * configure: Likewise.
3858 * elf-bfd.h (elf_property_kind): New.
3859 (elf_property): Likewise.
3860 (elf_property_list): Likewise.
3861 (elf_properties): Likewise.
3862 (_bfd_elf_parse_gnu_properties): Likewise.
3863 (_bfd_elf_get_property): Likewise.
3864 (_bfd_elf_link_setup_gnu_properties): Likewise.
3865 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
3866 and setup_gnu_properties.
3867 (elf_obj_tdata): Add properties.
3868 * elf-properties.c: New file.
3869 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
3870 (elf_i386_merge_gnu_properties): Likewise.
3871 (elf_backend_parse_gnu_properties): Likewise.
3872 (elf_backend_merge_gnu_properties): Likewise.
3873 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3874 (elf_x86_64_merge_gnu_properties): Likewise.
3875 (elf_backend_parse_gnu_properties): Likewise.
3876 (elf_backend_merge_gnu_properties): Likewise.
3877 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
3878 (elf_backend_parse_gnu_properties): Likewise.
3879 (elf_backend_setup_gnu_properties): Likewise.
3880 (elfNN_bed): Add elf_backend_parse_gnu_properties,
3881 elf_backend_merge_gnu_properties and
3882 elf_backend_setup_gnu_properties.
3884 2017-03-30 Pip Cet <pipcet@gmail.com>
3886 * elf32-wasm32.c: Add relocation code, two relocs.
3887 * reloc.c: Add wasm32 relocations.
3888 * libbfd.h: Regenerate.
3889 * bfd-in2.h: Regenerate.
3890 * bfd/po/bfd.pot: Regenerate.
3892 2017-03-29 Nick Clifton <nickc@redhat.com>
3895 * coff-bfd.h (struct coff_section_data): Add new fields:
3896 saved_bias and bias.
3897 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
3898 computed for PE binaries.
3899 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
3902 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
3905 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
3906 to handle a local symbol with a hash-symbol-entry; without PLT.
3907 Add BFD_ASSERT for an incidental case with GOT entry present.
3908 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
3909 isn't forced-or-set local.
3911 2017-03-27 Pip Cet <pipcet@gmail.com>
3913 * wasm-module.c: New file to support WebAssembly modules.
3914 * wasm-module.h: New file to support WebAssembly modules.
3915 * doc/webassembly.texi: Start documenting wasm-module.c.
3916 * config.bfd: Add wasm_vec.
3917 * targets.c: Likewise.
3918 * configure.ac: Likewise.
3919 * Makefile.am: Add entries for wasm-module.c.
3920 * Makefile.in: Regenerate.
3921 * configure: Regenerate.
3922 * po/SRC-POTFILES.in: Regenerate.
3924 2017-03-27 Pip Cet <pipcet@gmail.com>
3926 * cpu-wasm32.c: New file to support wasm32 architecture.
3927 * elf32-wasm32.c: New file to support wasm32 architecture.
3928 * Makefile.am: Add wasm32 architecture.
3929 * archures.c: Likewise.
3930 * config.bfd: Likewise.
3931 * configure.ac: Likewise.
3932 * targets.c: Likewise.
3933 * Makefile.in: Regenerate.
3934 * bfd-in2.h: Regenerate.
3935 * configure: Regenerate.
3936 * po/SRC-POTFILES.in: Regenerate.
3938 2017-03-20 Alan Modra <amodra@gmail.com>
3941 * elf64-ppc.c (compare_symbols): Stabilize sort.
3943 2017-03-18 Alan Modra <amodra@gmail.com>
3945 * elf64-ppc.c (struct ppc_link_hash_table): Add
3946 local_ifunc_resolver and maybe_local_ifunc_resolver.
3947 (ppc_build_one_stub): Set flags on emitting dynamic
3948 relocation to ifunc.
3949 (ppc64_elf_relocate_section): Likewise.
3950 (ppc64_elf_finish_dynamic_symbol): Likewise.
3951 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
3952 local dynamic relocs to ifuncs.
3953 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
3954 local_ifunc_resolver and maybe_local_ifunc_resolver.
3955 (ppc_elf_relocate_section): Set flag on emitting dynamic
3956 relocation to ifuncs.
3957 (ppc_elf_finish_dynamic_symbol): Likewise.
3958 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
3959 dynamic relocs to ifuncs.
3961 2017-03-13 Nick Clifton <nickc@redhat.com>
3964 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
3965 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
3966 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
3967 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
3968 * bfd-in2.h: Regenerate.
3969 * libbfd.h: Regenerate.
3970 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
3972 (IS_AARCH64_TLSDESC_RELOC): Likewise.
3973 (elfNN_aarch64_howto_table): Likewise.
3974 (aarch64_tls_transition_without_check): Likewise.
3975 (aarch64_reloc_got_type): Likewise.
3976 (elfNN_aarch64_final_link_relocate): Likewise.
3977 (elfNN_aarch64_tls_relax): Likewise.
3978 (elfNN_aarch64_relocate_section): Likewise.
3979 (elfNN_aarch64_gc_sweep_hook): Likewise.
3980 (elfNN_aarch64_check_relocs): Likewise.
3981 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3982 (_bfd_aarch64_elf_resolve_relocation): Likewise.
3984 2017-03-11 Alan Modra <amodra@gmail.com>
3986 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
3987 parameter is in fact used. Whitespace fixes.
3988 * elf64-ppc.c: Likewise.
3990 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
3992 * rs6000-core.c (CORE_NEW): Simplify macro when
3993 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
3995 2017-03-07 Alan Modra <amodra@gmail.com>
3999 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4002 2017-03-05 Alan Modra <amodra@gmail.com>
4004 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4005 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4006 (next_cie_fde_offset): New function.
4007 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4008 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4009 four bytes. Align CIEs to four or eight bytes depending on
4010 per_encoding_aligned8. Align FDEs according to their encoding.
4011 Pad last FDE to output section alignment.
4012 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4014 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4015 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4016 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4018 2017-03-02 Martin Bickel <binutils@ineranves.de>
4021 * elf.c (rewrite_elf_program_header): Do not issue a warning for
4022 empty segments which have a zero filesz, but a non-zero memsz.
4024 2017-03-02 Alan Modra <amodra@gmail.com>
4026 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4028 2017-02-28 Alan Modra <amodra@gmail.com>
4030 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4031 (ppc64_elf_relocate_section): Likewise.
4033 2017-02-28 Alan Modra <amodra@gmail.com>
4036 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4037 rather than elf32_nios2_hash_table or elf_hash_table.
4038 (create_got_section): Likewise.
4039 (nios2_elf32_finish_dynamic_symbol): Likewise.
4040 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4041 (nios2_elf32_size_dynamic_sections): Likewise.
4042 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4043 vars. Use htab equivalents directly instead. Don't create
4044 all dynamic sections on needing just the GOT. Use a goto
4045 rather than a fall-through with reloc test. Ensure
4046 htab->dynobj is set when making dynamic sreloc section.
4047 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4048 equivalent directly instead. Don't segfault on looking for
4049 .dynamic when dynamic sections have not been created. Don't
4050 segfault on .got.plt being discarded.
4051 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4052 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4053 fixme and another not so relevant comment.
4054 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4055 already set, set hash table dynobj on creating .sbss.
4057 2017-02-28 Alan Modra <amodra@gmail.com>
4059 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4060 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4061 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4062 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4063 (ppc64_elf_relocate_section): Likewise.
4064 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4065 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4066 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4067 * libbfd.h: Regenerate.
4068 * bfd-in2.h: Regenerate.
4070 2017-02-28 Alan Modra <amodra@gmail.com>
4072 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4073 dynamic .data.rel.ro read-only.
4074 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4075 rather than section flags when deciding where copy reloc goes.
4076 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4077 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4078 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4079 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4080 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4081 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4082 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4083 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4084 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4085 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4086 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4087 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4088 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4089 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4090 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4091 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4092 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4093 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4094 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4096 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4098 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4099 `jalr $0, $25' instruction encoding.
4101 2017-02-27 Nick Clifton <nickc@redhat.com>
4104 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4105 generating a seg-fault when encountering a symbol that has been
4106 deleted by garbage collection.
4108 2017-02-25 Alan Modra <amodra@gmail.com>
4110 * elf32-arc.c (struct dynamic_sections): Delete.
4111 (enum dyn_section_types): Delete.
4112 (dyn_section_names): Delete.
4113 (arc_create_dynamic_sections): Delete.
4114 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
4115 segfault on discarded .rela.plt section.
4116 (elf_arc_size_dynamic_sections): Formatting. Don't call
4117 arc_create_dynamic_sections. Don't allocate memory for sections
4118 handled by the generic linker. Correct code finding relocs in
4119 read-only sections. Set SEC_EXCLUDE on zero size .got,
4120 .got.plt, and .dynbss sections. Do set .interp for pies.
4122 2017-02-24 Andrew Waterman <andrew@sifive.com>
4124 * elfnn-riscv.c (GP_NAME): New macro.
4125 (riscv_global_pointer_value): Use it.
4126 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4127 output section, consider only that section's alignment.
4129 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4131 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4132 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4133 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4134 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4136 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4138 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4139 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4142 2017-02-23 Alan Modra <amodra@gmail.com>
4145 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4147 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4148 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4151 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
4154 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4155 processing ahead of the call to `elf_gc_sweep_symbol'.
4157 2017-02-22 Nick Clifton <nickc@redhat.com>
4160 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4161 created section 4-byte alignment.
4163 2017-02-22 Alan Modra <amodra@gmail.com>
4165 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4166 on .got or .plt output section being discarded by script.
4167 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
4170 2017-02-21 Alan Modra <amodra@gmail.com>
4172 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4173 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4175 2017-02-20 Alan Modra <amodra@gmail.com>
4178 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4179 if DT_RELSZ/DT_RELASZ is zero.
4181 2017-02-17 Nick Clifton <nickc@redhat.com>
4183 * compress.c (bfd_get_full_section_contents): Remember to reduce
4184 compressed size by the sizeof the compression header when
4185 decompressing the contents.
4187 2017-02-17 Pedro Alves <palves@redhat.com>
4189 * srec.c (Chunk): Rename to ...
4190 (_bfd_srec_len): ... this.
4191 (S3Forced): Rename to ...
4192 (_bfd_srec_forceS3): ... this.
4193 * objcopy.c: Adjust all references.
4195 2017-02-17 Pedro Alves <palves@redhat.com>
4197 * archive.c (bsd_write_armap): Rename to ...
4198 (_bfd_bsd_write_armap): ... this.
4199 (coff_write_armap): Rename to ...
4200 (_bfd_coff_write_armap): ... this.
4201 * libbfd-in.h (bsd_write_armap): Rename to ...
4202 (_bfd_bsd_write_armap): ... this.
4203 (coff_write_armap): Rename to ...
4204 (_bfd_coff_write_armap): ... this.
4205 * aout-target.h, aout-tic30.c: Adjust all users.
4206 * libbfd.h: Regenerate.
4208 2017-02-17 Pedro Alves <palves@redhat.com>
4210 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4211 (warn_deprecated): Rename to ...
4212 (_bfd_warn_deprecated): ... this.
4213 * libbfd.c (warn_deprecated): Rename to ...
4214 (_bfd_warn_deprecated): ... this.
4215 * bfd-in2.h: Regenerate.
4217 2017-02-17 Pedro Alves <palves@redhat.com>
4219 * bfdio.c (real_ftell): Rename to ...
4220 (_bfd_real_ftell): ... this.
4221 (real_fseek): Rename to ...
4222 (_bfd_real_fseek): ... this.
4223 (real_fopen): Rename to ...
4224 (_bfd_real_fopen): ... this.
4225 * libbfd-in.h (real_ftell): Rename to ...
4226 (_bfd_real_ftell): ... this.
4227 (real_fseek): Rename to ...
4228 (_bfd_real_fseek): ... this.
4229 (real_fopen): Rename to ...
4230 (_bfd_real_fopen): ... this.
4231 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4232 * libbfd.h: Regenerate.
4234 2017-02-17 Pedro Alves <palves@redhat.com>
4236 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4237 * libbfd.c (read_unsigned_leb128): Rename to ...
4238 (_bfd_read_unsigned_leb128): ... this.
4239 (read_signed_leb128): Rename to ...
4240 (_bfd_read_signed_leb128): ... this.
4241 (safe_read_leb128): Rename to ...
4242 (_bfd_safe_read_leb128): ... this.
4243 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4244 (_bfd_read_unsigned_leb128): ... this.
4245 (read_signed_leb128): Rename to ...
4246 (_bfd_read_signed_leb128): ... this.
4247 (safe_read_leb128): Rename to ...
4248 (_bfd_safe_read_leb128): ... this.
4249 * libbfd.h: Renegerate.
4251 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4253 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4254 before trying to fine matching file and line information.
4256 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4258 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4259 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4260 not match current bfd, then reload debug information. Record bfd
4261 we're loading debug info for in the stash. If we have debug
4262 informatin in the cache then perform section placement before
4265 2017-02-16 Alan Modra <amodra@gmail.com>
4268 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4269 * elfxx-target.h (elf_backend_no_page_alias): Define.
4270 (elfNN_bed): Init new field.
4271 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4272 ensure PT_LOAD segment starts on a new page.
4273 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4275 2017-02-16 Alan Modra <amodra@gmail.com>
4278 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4281 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4283 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4284 * bfd-in2.h: Regenerated.
4286 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4289 * elf32-i386.c (elf_i386_relocate_section): Allow
4290 "lea foo@GOT, %reg" in PIC.
4292 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4295 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4296 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4297 error against local IFUNC symbol without a base register for
4300 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4302 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4303 `%P: %H:' with `info->callbacks->einfo'.
4304 (ppc_elf_relocate_section): Likewise.
4305 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4306 (ppc64_elf_edit_toc): Likewise.
4307 (ppc64_elf_relocate_section): Likewise.
4309 2017-02-14 Alan Modra <amodra@gmail.com>
4311 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4312 --gc-keep-exported, and test versioned field of sym rather than
4313 looking for @ in name.
4315 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4317 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4320 2017-02-13 Nick Clifton <nickc@redhat.com>
4323 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4326 2017-02-07 Andrew Waterman <andrew@sifive.com>
4328 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4329 entry size if PLT header is written.
4331 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4333 Fix sparc64 dynamic relocation processing to use the dynamic
4335 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4336 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4339 2017-02-03 Nick Clifton <nickc@redhat.com>
4342 * coffcode.h (coff_write_object_contents): Enlarge size of
4343 s_name_buf in order to avoid compile time warning about possible
4345 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4346 32-bits of insn value before printing into buffer.
4348 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4350 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4351 `max_local_dynindx'.
4352 (mips_elf_sort_hash_table): Handle it.
4353 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4354 symbols bump up `max_local_dynindx' rather than
4355 `max_non_got_dynindx'.
4357 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4359 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4360 `min_got_dynindx', `max_unref_got_dynindx' and
4361 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4362 (mips_elf_sort_hash_table): Adjust accordingly.
4364 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4366 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4367 to access the hash table.
4369 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4371 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4372 non-NULL `htab' to the beginning.
4374 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4376 * elflink.c (elf_gc_sweep): Wrap overlong line.
4378 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4380 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4381 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4382 * elfxx-mips.c (mips_elf_link_hash_table): Add
4383 `ignore_branch_isa' member.
4384 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4385 in branch relocation calculation as an error if
4386 `ignore_branch_isa' has been set.
4387 (_bfd_mips_elf_insn32): Rename to...
4388 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4389 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4390 Handle the new parameter.
4392 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4394 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4395 local variable dynobj.
4398 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4399 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4400 executable from read-only sections into sdynrelro.
4401 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4402 dynamic relocs in sdynrelro.
4403 (elf_backend_want_dynrelro): Define.
4405 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4407 * config.bfd (*-*-rtemsaout*): Mark as removed.
4409 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4411 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4412 (arm-*-rtems*): Move to (arm*-*-eabi*).
4413 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4414 (m68-*-rtems*): Move to (m68*-*-elf*).
4416 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4418 * config.bfd (*-*-rtemscoff*): Mark as removed.
4420 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4423 * elflink.c (bfd_elf_record_link_assignment): Revert last
4424 change and don't ever clear `forced_local'. Set `mark'
4426 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4428 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4429 (bfd_elf_size_dynamic_sections): ... here.
4430 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4431 and set `mark' instead in `__tls_get_addr_opt' processing.
4432 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4434 2017-01-24 Alan Modra <amodra@gmail.com>
4436 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4437 where dynamic relocs are preferable. Allow ifunc too.
4438 (ensure_undefweak_dynamic): New function.
4439 (allocate_dynrelocs): Use it here. Move plt handling last and
4440 don't make symbols dynamic, simplifying loop. Only make undef
4441 weak symbols with GOT entries dynamic. Correct condition
4442 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4443 comments. Remove goto.
4444 (ppc_elf_relocate_section): Correct test for using dynamic
4445 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4446 to suit. Set up explicit tls_index entries and implicit GOT
4447 tls_index entries resolvable at link time for
4448 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4449 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4450 (ensure_undefweak_dynamic): New function.
4451 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4452 with GOT entries dynamic. Remove unnecessary test of
4453 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4454 (ppc64_elf_relocate_section): Correct test for using dynamic
4455 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4456 to suit. Set up explicit tls_index entries and implicit GOT
4457 tls_index entries resolvable at link time for __tls_get_addr_opt.
4458 Simplify expression to clear mem for prelink.
4460 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4462 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4464 2017-01-20 Jiong Wang <jiong.wang@arm.com>
4466 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4467 (elf_backend_hash_symbol): Define.
4469 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4472 * elflink.c (bfd_elf_record_link_assignment): Clear any
4473 `forced_local' marking for DSO symbols that are not being
4476 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4478 * elfnn-riscv.c (riscv_elf_object_p): New function.
4480 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4483 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4485 (elf_x86_64_check_relocs): Create .eh_frame section for the
4487 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4488 .eh_frame section for the .plt.bnd section.
4489 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4490 for the .plt.bnd section.
4492 2017-01-12 Nick Clifton <nickc@redhat.com>
4495 * opncls.c (find_separate_debug_file): Add include_dirs
4496 parameter. Only include the directory part of the bfd's filename
4497 in search paths if include_dirs is true. Add a couple of extra
4498 locations for looking for debug files.
4499 ( bfd_follow_gnu_debuglink): Update invocation of
4500 find_separate_debug_file.
4501 (bfd_follow_gnu_debugaltlink): Likewise.
4502 (get_build_id): New function: Finds the build-id of the given bfd.
4503 (get_build_id_name): New function: Computes the name of the
4504 separate debug info file for a bfd, based upon its build-id.
4505 (check_build_id_file): New function: Checks to see if a separate
4506 debug info file exists at the given location, and that its
4507 build-id matches that of the original bfd.
4508 (bfd_follow_build_id_debuglink): New function: Finds a separate
4509 debug info file for a given bfd by using the build-id method.
4510 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4511 method of locating a separate debug info file before using the
4513 * bfd-in2.h: Regenerate.
4515 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
4518 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4519 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4520 elf_x86_64_eh_frame_plt_got.
4521 (elf_x86_64_size_dynamic_sections): Get unwind info from
4522 elf_x86_64_bnd_arch_bed for the BND PLT.
4524 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
4526 * config.bfd: Add entries for i686-redox and x86_64-redox.
4528 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4530 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
4532 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
4533 .eh_frame section to 4 bytes for x32.
4534 (elf_x86_64_check_relocs): Likewise.
4536 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4539 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
4540 (PLT_GOT_FDE_LENGTH): Likewise.
4541 (elf_i386_plt_layout): Add eh_frame_plt_got and
4542 eh_frame_plt_got_size.
4543 (elf_i386_plt): Updated.
4544 (elf_i386_link_hash_table): Add plt_got_eh_frame.
4545 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
4546 (elf_i386_size_dynamic_sections): Allocate and initialize
4547 .eh_frame section for .plt.got.
4548 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
4550 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
4551 eh_frame_plt_got_size.
4552 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
4553 (PLT_GOT_FDE_LENGTH): Likewise.
4554 (elf_x86_64_backend_data): Add eh_frame_plt_got and
4555 eh_frame_plt_got_size.
4556 (elf_x86_64_arch_bed): Updated.
4557 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
4558 eh_frame_plt_got_size.
4559 (elf_x86_64_nacl_arch_bed): Likewise.
4560 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
4561 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
4562 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4563 .eh_frame section for .plt.got.
4564 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4567 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4569 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
4570 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
4572 2017-01-09 Nick Clifton <nickc@redhat.com>
4574 * dwarf2.c (lookup_address_in_function_table): Return early if
4575 there are no functions in the given comp unit, or if the high
4576 address of the last function in the comp unit is less than the
4579 2017-01-09 Nick Clifton <nickc@redhat.com>
4582 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
4583 message if there are too many symbols to load.
4585 2017-01-04 James Clarke <jrtc27@jrtc27.com>
4587 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
4588 if relocs are cached.
4590 2017-01-03 Rich Felker <bugdal@aerifal.cx>
4593 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
4594 for R_MICROBLAZE_GOTOFF_64.
4596 2017-01-03 Nick Clifton <nickc@redhat.com>
4598 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
4599 warning about using a possibly uninitialised variable.
4601 2017-01-02 Alan Modra <amodra@gmail.com>
4603 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
4604 (allocate_plt_static, allocate_dynrelocs): Use it.
4606 2017-01-02 Alan Modra <amodra@gmail.com>
4608 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
4609 .PARISC.unwind section.
4611 2017-01-02 Alan Modra <amodra@gmail.com>
4614 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
4615 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
4616 indirect to GOT pointer relative code edit.
4618 2017-01-02 Alan Modra <amodra@gmail.com>
4620 Update year range in copyright notice of all files.
4622 For older changes see ChangeLog-2016
4624 Copyright (C) 2017 Free Software Foundation, Inc.
4626 Copying and distribution of this file, with or without modification,
4627 are permitted in any medium without royalty provided the copyright
4628 notice and this notice are preserved.
4634 version-control: never