1 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
4 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
5 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
6 (elf_s390_relocate_section): Don't generate dynamic relocation
7 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
8 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
9 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
10 (elf_s390_relocate_section): Don't generate dynamic relocation
11 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
13 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
16 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
17 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
18 (allocate_dynrelocs): Discard dynamic relocations if
19 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
21 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
24 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
25 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
27 (allocate_dynrelocs): Discard dynamic relocations if
28 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
30 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
33 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
34 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
35 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
36 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
37 (elf_m68k_relocate_section): Don't generate dynamic relocation
38 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
40 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
43 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
44 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
45 (allocate_dynrelocs): Discard dynamic relocations if
46 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
47 (elf32_hppa_relocate_section): Don't generate dynamic
48 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
50 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
53 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
54 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
55 (allocate_fptr): Don't allocate function pointer if
56 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
57 (allocate_dynrel_entries): Don't allocate dynamic relocation
58 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
59 (set_got_entry): Don't set GOT entry if
60 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
61 (set_pltoff_entry): Don't set PLTOFF entry if
62 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
63 (elfNN_ia64_relocate_section): Don't install dynamic relocation
64 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
66 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
69 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
70 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
71 (allocate_dynrelocs): Don't allocate dynamic relocations if
72 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
74 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
77 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
78 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
79 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
80 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
82 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
85 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
86 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
87 (tilepro_elf_relocate_section): Don't generate dynamic
88 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
89 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
90 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
91 (tilegx_elf_relocate_section): Don't generate dynamic
92 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
94 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
97 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
98 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
100 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
101 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
103 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
105 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
106 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
107 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
109 2017-10-12 James Bowman <james.bowman@ftdichip.com>
111 * bfd-in2.h: Regenerate.
112 * libbfd.h: Regenerate.
113 * elf32-ft32.c: Add HOWTO R_FT32_15.
114 * reloc.c: Add BFD_RELOC_FT32_15.
116 2017-10-12 Nick Clifton <nickc@redhat.com>
118 * reloc.c (enum bfd_reloc_status): Start values at 2.
119 * bfd-in2.h: Regenerate.
120 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
121 that a TRUE return indicates success. Compare the result of
122 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
123 (build_one_stub): Change sense of tests against aarch64_relocate
125 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
126 than FALSE, when an error is detected.
127 (elfNN_aarch64_final_link_relocate): Likewise.
129 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
131 * elf32-i386.c (elf_backend_hide_symbol): New.
132 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
133 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
134 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
136 2017-10-12 Alan Modra <amodra@gmail.com>
138 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
139 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
140 (bfd_elf_define_start_stop): Likewise.
142 2017-10-12 Alan Modra <amodra@gmail.com>
144 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
145 when executable rather than non-PIC.
146 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
147 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
149 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
151 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
153 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
154 (elf_external_linux_prpsinfo64_ugid32): ... this.
155 (swap_linux_prpsinfo32_out): Rename to...
156 (swap_linux_prpsinfo32_ugid32_out): ... this.
157 (elf_external_linux_prpsinfo64_ugid16): New structure.
158 (swap_linux_prpsinfo64_ugid16_out): New function.
159 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
160 (elf_backend_linux_prpsinfo64_ugid16): Define.
161 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
162 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
163 of the 64-bit Linux core PRPSINFO note.
164 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
166 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
168 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
170 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
171 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
172 (elf_external_ppc_linux_prpsinfo32)
173 (swap_ppc_linux_prpsinfo32_out): Move to...
174 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
175 (swap_linux_prpsinfo32_ugid32_out): ... these.
176 (elf_external_linux_prpsinfo32): Rename to...
177 (elf_external_linux_prpsinfo32_ugid16): ... this.
178 (swap_linux_prpsinfo32_out): Rename to...
179 (swap_linux_prpsinfo32_ugid16_out): ... this.
180 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
181 (elf_backend_linux_prpsinfo32_ugid16): Define.
182 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
183 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
184 of the 32-bit Linux core PRPSINFO note.
185 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
186 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
187 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
188 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
189 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
190 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
191 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
192 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
193 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
194 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
196 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
198 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
199 `gap' member ahead of `pr_flag'.
201 2017-10-11 Pedro Alves <palves@redhat.com>
203 * bfd.c (_doprnt): Rename to ...
204 (_bfd_doprnt): ... this.
205 (error_handler_internal): Adjust.
207 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
209 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
210 instead of incrementing it.
211 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
213 2017-10-10 Renlin Li <renlin.li@arm.com>
216 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
217 symbols into dynamic.
219 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
222 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
223 (riscv_elf_link_hash_table_create): Initialize max_alignment to
225 (_bfd_riscv_relax_section): Cache the max alignment of output
226 sections if possible.
228 2017-10-10 Alan Modra <amodra@gmail.com>
230 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
231 .opd whenever .opd is present and non-zero size. Move code
232 setting abiversion to/from output file earlier. Only set
233 u.opd.func_sec when --gc-sections. Read relocs and set up
234 u.opd.func_sec values here..
235 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
237 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
239 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
241 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
244 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
246 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
247 .interp section with "ld --no-dynamic-linker".
249 2017-10-09 Alan Modra <amodra@gmail.com>
252 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
253 funcinfo_hash_table and varinfo_hash_table.
255 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
257 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
258 in read-only section with minfo.
259 (sh_elf_size_dynamic_sections): Likewise.
261 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
263 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
266 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
268 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
269 this_hdr.sh_entsize only if section size > 0.
271 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
273 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
275 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
277 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
278 in read-only section with minfo.
279 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
281 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
283 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
286 2017-10-06 John Baldwin <jhb@FreeBSD.org>
288 * elf-bfd.h (struct elf_backend_data): Add
289 `elf_backend_grok_freebsd_prstatus'.
290 * elf.c (elfcore_grok_freebsd_note): Call
291 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
293 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
295 (elf_backend_grok_freebsd_prstatus): Define.
296 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
297 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
299 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
301 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
302 and has_non_got_reloc with zero_undefweak.
303 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
304 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
306 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
307 has_non_got_reloc with zero_undefweak.
308 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
309 has_got_reloc and has_non_got_reloc with zero_undefweak.
310 (elf_x86_link_hash_entry): Likewise.
312 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
314 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
315 (VERIFY_COPY_RELOC): Likewise.
317 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
319 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
320 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
321 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
323 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
325 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
326 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
327 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
329 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
331 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
332 * elf32-i386.c (elf_i386_relocate_section): Use it.
333 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
335 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
337 * elf32-i386.c (X86_SIZE_TYPE_P): New.
338 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
339 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
340 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
341 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
343 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
345 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
346 (PLT_LOCAL_IFUNC_P): Likewise.
347 * elf32-i386.c (elf_i386_relocate_section): Use them.
348 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
350 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
352 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
353 * elf32-i386.c (elf_i386_relocate_section): Use it.
354 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
356 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
358 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
359 * elf32-i386.c (elf_i386_relocate_section): Use it.
360 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
362 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
364 * elf32-i386.c (X86_PCREL_TYPE_P): New.
365 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
366 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
367 (X86_PCREL_TYPE_P): This.
368 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
369 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
370 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
372 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
374 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
376 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
377 * elf32-i386.c (elf_i386_tls_transition): Use it.
378 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
380 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
382 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
383 Dump dynamic relocation in read-only section with minfo if
385 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
386 (maybe_set_textrel): Likewise.
387 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
388 read-only section with minfo.
390 2017-10-05 John Baldwin <jhb@FreeBSD.org>
392 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
394 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
396 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
397 in read-only section with minfo.
398 (tilepro_elf_size_dynamic_sections): Likewise.
399 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
400 (tilegx_elf_size_dynamic_sections): Likewise.
402 2017-10-05 Pedro Alves <palves@redhat.com>
405 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
406 ellipsis parameter. Split out bfd_error_on_input code to..
407 (bfd_set_input_error): .. New function.
408 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
409 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
410 * bfd-in2.h: Regenerate.
412 2017-10-05 Alan Modra <amodra@gmail.com>
414 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
415 fini_array error value.
417 2017-10-05 Alan Modra <amodra@gmail.com>
420 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
422 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
424 (elf_fake_sections): Adjust calls. Exit immediately on failure.
425 (bfd_elf_set_group_contents): Add associated reloc section indices
428 2017-10-04 Alan Modra <amodra@gmail.com>
430 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
431 classify symbols for ELFv2.
433 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
436 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
437 undergoes default promotion.
438 * bfd-in2.h: Regenerate.
440 2017-10-02 Alan Modra <amodra@gmail.com>
442 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
443 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
445 2017-10-01 Alan Modra <amodra@gmail.com>
448 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
449 (add_line_info): Always put end_sequence last.
451 2017-10-01 Alan Modra <amodra@gmail.com>
454 * dwarf2.c (read_section): Allocate buffer with extra byte for
455 bfd_simple_get_relocated_section_contents rather than copying
458 2017-09-29 Alan Modra <amodra@gmail.com>
460 * merge.c (merge_strings): Return FALSE on malloc failure.
461 (_bfd_merge_sections): Return failures from record_section and
464 2017-09-28 Alan Modra <amodra@gmail.com>
467 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
468 a case where plugin_notice isn't called.
470 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
472 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
475 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
478 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
479 output_bfd to info->callbacks->minfo.
481 2017-09-26 Nick Clifton <nickc@redhat.com>
484 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
485 assertion failure if elf_x86_64_rtype_to_howto has already issued
488 2017-09-26 Alan Modra <amodra@gmail.com>
491 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
494 2017-09-26 Nick Clifton <nickc@redhat.com>
497 * dwarf2.c (read_formatted_entries): Fail early if we know that
498 the loop parsing data entries will overflow the end of the
501 2017-09-26 Alan Modra <amodra@gmail.com>
504 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
505 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
506 to stash->info_ptr_memory, and check die_ref is within that memory.
507 Set info_ptr_end correctly when another CU is refd. Check die_ref
508 for DW_FORM_ref4 etc. is within CU.
510 2017-09-26 Alan Modra <amodra@gmail.com>
513 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
514 (read_formatted_entries): Init "fe".
515 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
517 2017-09-26 Alan Modra <amodra@gmail.com>
520 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
521 bounds in inner loop.
523 2017-09-25 Alan Modra <amodra@gmail.com>
526 * dwarf1.c (parse_die): Sanity check pointer against section limit
527 before dereferencing.
528 (parse_line_table): Likewise.
530 2017-09-25 Alan Modra <amodra@gmail.com>
533 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
535 (parse_comp_unit): Likewise.
537 2017-09-25 Alan Modra <amodra@gmail.com>
540 * dwarf2.c (read_formatted_entries): Error on format_count zero.
542 2017-09-24 Alan Modra <amodra@gmail.com>
545 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
546 within section bounds.
548 2017-09-24 Alan Modra <amodra@gmail.com>
551 * dwarf2.c (decode_line_info): Properly free line sequences on error.
553 2017-09-24 Alan Modra <amodra@gmail.com>
556 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
557 pname param. Return status. Make name const. Don't abort,
558 return an error. Formatting. Exit if current info_ptr matches
559 orig_info_ptr. Update callers.
560 (scan_unit_for_symbols): Start at nesting_level of zero. Make
561 nested_funcs an array of structs for extensibility. Formatting.
563 2017-09-24 Alan Modra <amodra@gmail.com>
566 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
567 rather than dividing by zero.
569 2017-09-24 Alan Modra <amodra@gmail.com>
572 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
574 2017-09-24 Alan Modra <amodra@gmail.com>
577 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
579 2017-09-24 Alan Modra <amodra@gmail.com>
582 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
583 SHT_GNU_verneed section for sanity. Don't zalloc memory for
586 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
589 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
592 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
595 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
596 -1 if bfd_canonicalize_dynamic_reloc returns 0.
598 2017-09-22 Pedro Alves <palves@redhat.com>
599 Alan Modra <amodra@gmail.com>
601 * version.h: Add comment.
603 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
605 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
606 NT_S390_GS_BC, correct the previously swapped invocations of
607 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
609 2017-09-19 Alan Modra <amodra@gmail.com>
612 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
615 2017-09-19 Alan Modra <amodra@gmail.com>
618 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
619 symbols before calculating verrefs. Don't renumber dynsyms
620 after gc. Exclude .gnu.version when zero or one dynsym.
621 Localize some vars and reindent.
623 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
626 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
627 return from bfd_canonicalize_dynamic_reloc.
629 2017-09-15 Alan Modra <amodra@gmail.com>
632 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
633 overflows bfd_size_type.
635 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
638 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
639 to indicate if conversion is performed.
640 (elf_i386_check_relocs): Cache section contents and relocations
641 if conversion is performed.
642 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
643 contents and relocations if conversion is performed.
645 2017-09-14 Nick Clifton <nickc@redhat.com>
648 * peXXigen.c (pe_print_idata): Extend check for HintName vector
651 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
653 * elfxx-x86.h: Fix a typo in comments.
655 2017-09-09 Kamil Rytarowski <n54@gmx.com>
657 * elf32-nds32.c: Rename __BIT() to N32_BIT().
659 2017-09-09 Alan Modra <amodra@gmail.com>
661 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
664 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
666 * elf32-i386.c (elf_i386_relocate_section): Update usage of
667 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
668 (elf_i386_finish_dynamic_symbol): Likewise.
669 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
670 (elf_x86_64_finish_dynamic_symbol): Likewise.
671 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
672 (_bfd_x86_elf_fixup_symbol): Likewise.
674 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
676 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
677 check has_non_got_reloc.
679 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
682 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
683 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
684 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
685 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
686 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
687 and linker_def on __ehdr_start if it is referenced and not
689 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
690 and return TRUE when building executable, if a symbol has
691 non-GOT/non-PLT relocations in text section or there is no
693 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
695 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
697 * elfxx-x86.h: Update comments.
699 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
701 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
702 elf_x86_plt_layout_table with elf_x86_init_table.
703 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
705 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
707 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
708 (elf_x86_init_table): This.
709 (_bfd_x86_elf_link_setup_gnu_properties): Replace
710 elf_x86_plt_layout_table with elf_x86_init_table.
712 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
714 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
715 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
716 * configure: Regenerated.
717 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
718 and r_sym fields of plt_layout.
719 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
721 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
722 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
723 r_info nor r_sym fields.
724 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
726 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
728 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
730 * (_bfd_riscv_relax_align): Call bfd_set_error and
731 print an error message when unable to relax a .align directive.
733 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
735 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
736 (riscv_record_pcrel_hi_reloc): Add absolute argument.
737 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
738 R_RISCV_PCREL_HI20 relocs, and pass the result to
739 riscv_record_pcrel_hi_reloc.
741 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
743 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
744 r_type_p. Remove the converted argument. Replace
745 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
746 the new relocation type via r_type_p.
747 (elf_i386_relocate_section): Likewise.
748 (elf_i386_finish_dynamic_symbol): Likewise.
749 (need_convert_load): Removed.
750 (check_relocs_failed): Updated.
751 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
752 instead of setting need_convert_load.
753 (_bfd_i386_elf_convert_load): Removed.
754 * elf64-x86-64.c (need_convert_load): Removed.
755 (check_relocs_failed): Updated.
756 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
757 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
758 Return the new relocation type via r_type_p.
759 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
760 instead of setting need_convert_load.
761 (elf_x86_64_check_relocs): Don't check PIC if relocation has
763 (_bfd_x86_64_elf_convert_load): Removed.
764 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
765 with SYMBOL_REFERENCES_LOCAL_P.
766 (elf_x86_64_finish_dynamic_symbol): Likewise.
767 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
769 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
770 (_bfd_x86_elf_link_symbol_references_local): New function.
771 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
772 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
773 SYMBOL_REFERENCES_LOCAL_P.
774 (elf_x86_link_hash_entry): Add local_ref.
775 (elf_x86_link_hash_table): Remove convert_load.
776 (_bfd_i386_elf_convert_load): Removed.
777 (_bfd_x86_64_elf_convert_load): Likewise.
778 (_bfd_x86_elf_link_symbol_references_local): New.
780 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
782 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
783 (elf_x86_64_info_to_howto): Get the real relocation type by
784 masking out R_X86_64_converted_reloc_bit.
785 (elf_x86_64_check_tls_transition): Get the real relocation type
786 by masking out R_X86_64_converted_reloc_bit.
787 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
788 instead of setting converted_reloc.
789 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
790 instead of converted_reloc. Get the real relocation type by
791 masking out R_X86_64_converted_reloc_bit.
792 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
793 R_X86_64_converted_reloc_bit is valid.
794 * elfxx-x86.h (converted_reloc): Removed.
796 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
798 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
799 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
800 to get the relocation type again.
801 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
802 r_type when calling elf_x86_64_tls_transition. Don't use
803 ELF32_R_TYPE to get the relocation type again.
805 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
807 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
810 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
812 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
813 argument. Don't check relocation overflow. Avoid relocation
814 overflow if --no-relax is used. Set converted_reloc on symbol
815 if a GOTPCREL relocation is converted.
816 (elf_x86_64_relocate_section): Issue a fatal error and suggest
817 --no-relax if GOTPCREL relocation conversion leads to relocation
819 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
821 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
822 Edmar Wienskoski <edmar.wienskoski@nxp.com
824 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
825 (ppc_elf_check_relocs): Handle it.
826 (ppc_elf_vle_split20): New function.
827 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
829 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
832 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
833 for x86-64 if GOT_TLS_GDESC_P is true.
835 2017-09-03 Alan Modra <amodra@gmail.com>
838 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
840 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
842 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
843 tls_get_addr for x86-64 in one place.
845 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
847 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
848 with elfxx-x86.lo for 64-bit BFD.
849 * configure: Regenerated.
851 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
853 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
854 (_bfd_i386_elf_convert_load): This. Remove static.
855 (elf_i386_size_dynamic_sections): Removed.
856 (elf_backend_size_dynamic_sections): Likewise.
857 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
858 (_bfd_x86_64_elf_convert_load): This. Remove static.
859 (elf_x86_64_size_dynamic_sections): Removed.
860 (elf_backend_size_dynamic_sections): Likewise.
861 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
862 (elf_x86_allocate_dynrelocs): This. Make it static.
863 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
864 (elf_x86_allocate_local_dynreloc): This. Make it static.
865 (elf_i386_is_reloc_section): New function.
866 (elf_x86_64_is_reloc_section): Likewise.
867 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
868 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
869 Rearrange got_entry_size initialization.
870 (_bfd_x86_elf_size_dynamic_sections): New function.
871 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
872 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
873 (_bfd_i386_elf_convert_load): New.
874 (_bfd_x86_64_elf_convert_load): Likewise.
875 (_bfd_x86_elf_size_dynamic_sections): Likewise.
876 (elf_backend_size_dynamic_sections): Likewise.
877 (_bfd_x86_elf_allocate_dynrelocs): Removed.
878 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
880 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
882 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
885 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
887 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
888 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
890 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
892 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
893 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
894 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
895 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
896 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
897 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
899 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
901 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
902 (elf_i386_allocate_local_dynrelocs): Likewise.
903 (elf_i386_size_dynamic_sections): Replace
904 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
905 with _bfd_x86_elf_allocate_dynrelocs and
906 _bfd_x86_elf_allocate_local_dynrelocs.
907 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
908 (elf_x86_64_allocate_local_dynrelocs): Likewise.
909 (elf_x86_64_size_dynamic_sections): Replace
910 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
911 with _bfd_x86_elf_allocate_dynrelocs and
912 _bfd_x86_elf_allocate_local_dynrelocs.
913 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
914 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
915 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
916 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
918 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
920 * elf32-i386.c (is_i386_elf): Removed.
921 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
922 (elf_i386_size_dynamic_sections): Likewise.
923 (elf_i386_relocate_section): Likewise.
924 * elf64-x86-64.c (is_x86_64_elf): Removed.
925 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
927 (elf_x86_64_size_dynamic_sections): Likewise.
928 (elf_x86_64_relocate_section): Likewise.
929 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
931 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
934 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
936 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
937 (elf_i386_allocate_dynrelocs): Replace
938 elf_i386_compute_jump_table_size with
939 elf_x86_compute_jump_table_size.
940 (elf_i386_size_dynamic_sections): Likewise.
941 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
942 (elf_x86_64_allocate_dynrelocs): Replace
943 elf_x86_64_compute_jump_table_size with
944 elf_x86_compute_jump_table_size.
945 (elf_x86_64_size_dynamic_sections): Likewise.
946 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
948 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
949 (elf_x86_compute_jump_table_size): New.
951 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
953 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
955 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
956 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
958 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
960 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
961 with htab->is_vxworks.
962 (elf_i386_size_dynamic_sections): Likewise.
963 (elf_i386_relocate_section): Likewise.
964 (elf_i386_finish_dynamic_symbol): Likewise.
965 (elf_i386_finish_dynamic_sections): Likewise.
967 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
969 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
970 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
971 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
972 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
973 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
974 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
975 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
976 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
978 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
981 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
982 ELF_COMMON_DEF_P for common symbols.
984 2017-09-02 Alan Modra <amodra@gmail.com>
986 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
987 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
988 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
990 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
992 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
993 (elf_backend_gc_mark_hook): Likewise.
994 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
995 (elf_backend_gc_mark_hook): Likewise.
996 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
997 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
998 (elf_backend_gc_mark_hook): Likewise.
1000 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1002 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1003 (elf_backend_adjust_dynamic_symbol): Likewise.
1004 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1005 (elf_backend_adjust_dynamic_symbol): Likewise.
1006 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1007 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1008 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1009 (_bfd_x86_elf_adjust_dynamic_symbol): New.
1010 (elf_backend_adjust_dynamic_symbol): Likewise.
1012 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1014 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1017 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1019 * elf32-i386.c (elf_i386_mkobject): Removed.
1020 (bfd_elf32_mkobject): Likewise.
1021 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1022 (bfd_elf64_mkobject): Likewise.
1023 (bfd_elf32_mkobject): Likewise.
1024 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
1025 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1026 (bfd_elf64_mkobject): Likewise.
1027 (bfd_elf32_mkobject): Likewise.
1029 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1031 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1032 Call _bfd_x86_elf_link_setup_gnu_properties.
1033 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1034 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1036 (elf_x86_64_non_lazy_plt): Likewise.
1037 (elf_x86_64_lazy_bnd_plt): Likewise.
1038 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1039 (elf_x86_64_lazy_ibt_plt): Likewise.
1040 (elf_x32_lazy_ibt_plt): Likewise.
1041 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1042 (elf_x32_non_lazy_ibt_plt): Likewise.
1043 (elf_x86_64_nacl_plt): Likewise.
1044 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1045 _bfd_x86_elf_link_setup_gnu_properties.
1046 * elfxx-x86.c: Include elf-vxworks.h".
1047 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1048 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1049 comments for pic_plt0_entry and pic_plt_entry.
1050 (elf_x86_non_lazy_plt_layout): Likewise.
1051 (elf_x86_plt_layout_table): New.
1052 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1054 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1057 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1058 .eh_frame section for the second PLT.
1059 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1060 alignment of .eh_frame section for the second PLT.
1062 2017-09-01 Nick Clifton <nickc@redhat.com>
1065 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1068 2017-09-01 Nick Clifton <nickc@redhat.com>
1071 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1072 attribute buffer is NUL terminated.
1074 2017-08-31 Nick Clifton <nickc@redhat.com>
1077 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1078 to dwarf string sections.
1080 2017-08-31 Alan Modra <amodra@gmail.com>
1082 * po/SRC-POTFILES.in: Regenerate.
1084 2017-08-31 Alan Modra <amodra@gmail.com>
1086 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1087 for a section containing just a terminator. Allow multiple
1088 terminators at end of section.
1089 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1090 sections when not adding alignment. Assert on terminator in
1093 2017-08-31 Alan Modra <amodra@gmail.com>
1097 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1100 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1102 * configure.ac (bfd_backends): Add elf64.lo together with
1103 elfxx-x86.lo for 64-bit BFD.
1104 * configure: Regenerated.
1106 2017-08-31 James Bowman <james.bowman@ftdichip.com>
1108 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1111 2017-08-31 Alan Modra <amodra@gmail.com>
1114 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1115 before _close_and_cleanup. Call iovec->bclose after.
1116 (bfd_close): Remove code common to, and call, bfd_close_all_done.
1118 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1120 * elf32-i386.c (elf_i386_plt_type): Removed.
1121 (elf_i386_plt): Likewise.
1122 (elf_i386_get_synthetic_symtab): Updated. Call
1123 _bfd_x86_elf_get_synthetic_symtab.
1124 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1125 (elf_x86_64_plt): Likewise.
1126 (elf_x86_64_get_synthetic_symtab): Updated. Call
1127 _bfd_x86_elf_get_synthetic_symtab.
1128 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1129 (elf_x86_64_get_plt_got_vma): Likewise.
1130 (elf_i386_valid_plt_reloc_p): Likewise.
1131 (elf_x86_64_valid_plt_reloc_p): Likewise.
1132 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1133 * elfxx-x86.h (elf_x86_plt_type): New.
1134 (elf_x86_plt): Likewise.
1135 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1137 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1139 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1140 target_id instead of elf_machine_code.
1142 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1144 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1145 (elf_i386_lazy_plt_layout): Likewise.
1146 (elf_i386_non_lazy_plt_layout): Likewise.
1147 (elf_i386_plt_layout): Likewise.
1148 (elf_i386_link_hash_table): Likewise.
1149 (elf_i386_next_tls_desc_index): Likewise.
1150 (elf_i386_srelplt2): Likewise.
1151 (elf_i386_plt): Likewise.
1152 (elf_i386_lazy_plt): Likewise.
1153 (elf_i386_non_lazy_plt): Likewise.
1154 (elf_i386_link_hash_table_create): Likewise.
1155 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1156 (elf_i386_lazy_plt): Updated.
1157 (elf_i386_non_lazy_plt): Likewise.
1158 (elf_i386_lazy_ibt_plt): Likewise.
1159 (elf_i386_non_lazy_ibt_plt): Likewise.
1160 (elf_i386_allocate_dynrelocs): Likewise.
1161 (elf_i386_size_dynamic_sections): Likewise.
1162 (elf_i386_relocate_section): Likewise.
1163 (elf_i386_finish_dynamic_symbol): Likewise.
1164 (elf_i386_finish_dynamic_sections): Likewise.
1165 (elf_i386_get_synthetic_symtab): Likewise.
1166 (elf_i386_link_setup_gnu_properties): Likewise.
1167 (elf_i386_nacl_plt): Likewise.
1168 * elf64-x86-64.c (ABI_64_P): Removed.
1169 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1170 (ELF32_DYNAMIC_INTERPRETER): Likewise.
1171 (elf_x86_64_lazy_plt_layout): Likewise.
1172 (elf_x86_64_non_lazy_plt_layout): Likewise.
1173 (elf_x86_64_plt_layout): Likewise.
1174 (elf_x86_64_link_hash_table): Likewise.
1175 (elf_x86_64_plt): Likewise.
1176 (elf_x86_64_lazy_plt): Likewise.
1177 (elf_x86_64_non_lazy_plt): Likewise.
1178 (elf_x86_64_link_hash_table_create): Likewise.
1179 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1180 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1181 (elf_x86_64_lazy_plt): Updated.
1182 (elf_x86_64_non_lazy_plt): Likewise.
1183 (elf_x86_64_lazy_bnd_plt): Likewise.
1184 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1185 (elf_x86_64_lazy_ibt_plt): Likewise.
1186 (elf_x32_lazy_ibt_plt): Likewise.
1187 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1188 (elf_x32_non_lazy_ibt_plt): Likewise.
1189 (elf_x86_64_allocate_dynrelocs): Likewise.
1190 (elf_x86_64_size_dynamic_sections): Likewise.
1191 (elf_x86_64_relocate_section): Likewise.
1192 (elf_x86_64_finish_dynamic_symbol): Likewise.
1193 (elf_x86_64_finish_dynamic_sections): Likewise.
1194 (elf_x86_64_get_synthetic_symtab): Likewise.
1195 (elf_x86_64_link_setup_gnu_properties): Likewise.
1196 (elf_x86_64_nacl_plt): Likewise.
1197 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1199 (ELF32_DYNAMIC_INTERPRETER): New.
1200 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1201 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1202 (_bfd_x86_elf_link_hash_table_create): Likewise.
1203 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1204 (elf_x86_link_hash_table_free): This. Make it static.
1205 * elfxx-x86.h: Don't include "objalloc.h".
1207 (elf_x86_lazy_plt_layout): Likewise.
1208 (elf_x86_non_lazy_plt_layout): Likewise.
1209 (elf_x86_plt_layout): Likewise.
1210 (_bfd_x86_elf_link_hash_table_create): Likewise.
1211 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1212 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1213 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1214 srelplt2 and next_tls_desc_index.
1215 (_bfd_x86_elf_link_hash_table_free): Removed.
1217 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1219 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1220 branch offset interpretation.
1222 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1225 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1227 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1229 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1230 (elf_x86_64_srelplt2): Likewise.
1232 2017-08-30 Alan Modra <amodra@gmail.com>
1234 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1235 (ppc64_elf_tls_optimize): Set it.
1236 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1237 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1238 addis would add zero.
1239 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1240 (ppc_elf_tls_optimize): Set it.
1241 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1242 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1244 2017-08-30 Alan Modra <amodra@gmail.com>
1246 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1247 __tls_get_addr call sequences to LE, don't move the addi down
1248 to the nop. Replace the bl with addi and leave the nop alone.
1250 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1252 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1254 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1256 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1258 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1260 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1261 (BFD64_BACKENDS): Likewise.
1262 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1263 (BFD64_BACKENDS_CFILES): Likewise.
1264 * Makefile.in: Regenerated.
1265 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1266 elf32-i386.lo and elf64-x86-64.lo.
1267 * configure: Regenerated.
1268 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1269 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1270 "objalloc.h" and "hashtab.h".
1271 (ELIMINATE_COPY_RELOCS): Removed.
1272 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1273 (SYMBOL_NO_COPYRELOC): Likewise.
1274 (elf_i386_link_hash_entry): Likewise.
1275 (GOT_UNKNOWN): Likewise.
1276 (GOT_NORMAL): Likewise.
1277 (GOT_TLS_GD): Likewise.
1278 (elf_i386_hash_entry): Likewise.
1279 (elf_i386_obj_tdata): Likewise.
1280 (elf_i386_tdata): Likewise.
1281 (elf_i386_local_got_tls_type): Likewise.
1282 (elf_i386_local_tlsdesc_gotent): Likewise.
1283 (elf_i386_hash_table): Likewise.
1284 (elf_i386_link_hash_newfunc): Likewise.
1285 (elf_i386_local_htab_hash): Likewise.
1286 (elf_i386_local_htab_eq): Likewise.
1287 (elf_i386_get_local_sym_hash): Likewise.
1288 (elf_i386_link_hash_table_free): Likewise.
1289 (elf_i386_copy_indirect_symbol): Likewise.
1290 (elf_i386_fixup_symbol): Likewise.
1291 (elf_i386_readonly_dynrelocs): Likewise.
1292 (elf_i386_always_size_sections): Likewise.
1293 (elf_i386_set_tls_module_base): Likewise.
1294 (elf_i386_dtpoff_base): Likewise.
1295 (compare_relocs): Likewise.
1296 (elf_i386_hash_symbol): Likewise.
1297 (elf_i386_parse_gnu_properties): Likewise.
1298 (elf_i386_merge_gnu_properties): Likewise.
1299 (elf_i386_link_check_relocs): Likewise.
1300 (elf_i386_merge_symbol_attribute): Likewise.
1301 (bfd_elf32_bfd_link_check_relocs): Likewise.
1302 (elf_backend_copy_indirect_symbol): Likewise.
1303 (elf_backend_always_size_sections): Likewise.
1304 (elf_backend_omit_section_dynsym): Likewise.
1305 (elf_backend_hash_symbol): Likewise.
1306 (elf_backend_fixup_symbol): Likewise.
1307 (elf_backend_parse_gnu_properties): Likewise.
1308 (elf_backend_merge_gnu_properties): Likewise.
1309 (elf_backend_merge_symbol_attribute): Likewise.
1310 (elf_i386_mkobject): Updated.
1311 (elf_i386_link_hash_table_create): Likewise.
1312 (elf_i386_check_tls_transition): Likewise.
1313 (elf_i386_tls_transition): Likewise.
1314 (elf_i386_convert_load_reloc): Likewise.
1315 (elf_i386_check_relocs): Likewise.
1316 (elf_i386_adjust_dynamic_symbol): Likewise.
1317 (elf_i386_allocate_dynrelocs): Likewise.
1318 (elf_i386_convert_load): Likewise.
1319 (elf_i386_size_dynamic_sections): Likewise.
1320 (elf_i386_relocate_section): Likewise.
1321 (elf_i386_finish_dynamic_symbol ): Likewise.
1322 (elf_i386_finish_dynamic_sections): Likewise.
1323 (elf_i386_output_arch_local_syms): Likewise.
1324 (elf_i386_get_synthetic_symtab): Likewise.
1325 (elf_i386_link_setup_gnu_properties): Likewise.
1326 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1327 of elf_link_hash_table, as base.
1328 (elf_i386_next_tls_desc_index): New.
1329 (elf_i386_srelplt2): Likewise.
1330 (elf_i386_plt): Likewise.
1331 (elf_i386_lazy_plt): Likewise.
1332 (elf_i386_non_lazy_plt): Likewise.
1333 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1334 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1335 "objalloc.h" and "hashtab.h".
1336 (ELIMINATE_COPY_RELOCS): Removed.
1337 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1338 (SYMBOL_NO_COPYRELOC): Likewise.
1339 (elf_x86_64_link_hash_entry): Likewise.
1340 (GOT_UNKNOWN): Likewise.
1341 (GOT_NORMAL): Likewise.
1342 (GOT_TLS_GD): Likewise.
1343 (elf_x86_64_hash_entry): Likewise.
1344 (elf_x86_64_obj_tdata): Likewise.
1345 (elf_x86_64_tdata): Likewise.
1346 (elf_x86_64_local_got_tls_type): Likewise.
1347 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1348 (elf_x86_64_hash_table): Likewise.
1349 (elf_x86_64_link_hash_newfunc): Likewise.
1350 (elf_x86_64_local_htab_hash): Likewise.
1351 (elf_x86_64_local_htab_eq): Likewise.
1352 (elf_x86_64_get_local_sym_hash): Likewise.
1353 (elf_x86_64_link_hash_table_free): Likewise.
1354 (elf_x86_64_copy_indirect_symbol): Likewise.
1355 (elf_x86_64_fixup_symbol): Likewise.
1356 (elf_x86_64_readonly_dynrelocs): Likewise.
1357 (elf_x86_64_always_size_sections): Likewise.
1358 (elf_x86_64_set_tls_module_base): Likewise.
1359 (elf_x86_64_dtpoff_base): Likewise.
1360 (compare_relocs): Likewise.
1361 (elf_x86_64_merge_symbol_attribute): Likewise.
1362 (elf_x86_64_hash_symbol): Likewise.
1363 (elf_x86_64_parse_gnu_properties): Likewise.
1364 (elf_x86_64_merge_gnu_properties): Likewise.
1365 (elf_x86_64_link_check_relocs): Likewise.
1366 (elf_backend_copy_indirect_symbol): Likewise.
1367 (elf_backend_always_size_sections): Likewise.
1368 (bfd_elf64_bfd_link_check_relocs): Likewise.
1369 (elf_backend_merge_symbol_attribute): Likewise.
1370 (elf_backend_hash_symbol): Likewise.
1371 (elf_backend_omit_section_dynsym): Likewise.
1372 (elf_backend_fixup_symbol): Likewise.
1373 (elf_backend_parse_gnu_properties): Likewise.
1374 (elf_backend_merge_gnu_properties): Likewise.
1375 (bfd_elf32_bfd_link_check_relocs): Likewise.
1376 (elf_x86_64_mkobject): Updated.
1377 (elf_x86_64_link_hash_table_create): Likewise.
1378 (elf_x86_64_check_tls_transition): Likewise.
1379 (elf_x86_64_tls_transition): Likewise.
1380 (elf_x86_64_convert_load_reloc): Likewise.
1381 (elf_x86_64_check_relocs): Likewise.
1382 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1383 (elf_x86_64_allocate_dynrelocs): Likewise.
1384 (elf_x86_64_convert_load): Likewise.
1385 (elf_x86_64_size_dynamic_sections): Likewise.
1386 (elf_x86_64_relocate_section): Likewise.
1387 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1388 (elf_x86_64_finish_dynamic_sections): Likewise.
1389 (elf_x86_64_output_arch_local_syms): Likewise.
1390 (elf_x86_64_get_synthetic_symtab): Likewise.
1391 (elf_x86_64_link_setup_gnu_properties): Likewise.
1392 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1393 instead of elf_link_hash_table, as base.
1394 (elf_x86_64_next_tls_desc_index): New.
1395 (elf_x86_64_srelplt2): Likewise.
1396 (elf_x86_64_plt): Likewise.
1397 (elf_x86_64_lazy_plt): Likewise.
1398 (elf_x86_64_non_lazy_plt): Likewise.
1399 * elfxx-x86.c: New file.
1400 * elfxx-x86.h: Likewise.
1402 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1404 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1406 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1408 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1410 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1411 sections before checking dynamic relocations and free invalid
1412 PLT section contents.
1413 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1415 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1417 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1418 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1420 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1423 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1425 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1427 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1429 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1431 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1433 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1436 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1437 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1438 Add a has_no_copy_on_protected bitfield.
1439 (elf_has_no_copy_on_protected): New.
1440 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1441 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1442 (elf_merge_gnu_property_list): Likewise.
1443 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1444 to FALSE for elf_has_no_copy_on_protected.
1445 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1446 (elf_i386_link_hash_entry): Add def_protected.
1447 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1448 when checking info->nocopyreloc.
1449 (elf_i386_link_setup_gnu_properties): Don't set
1450 extern_protected_data here.
1451 (elf_i386_merge_symbol_attribute): New function.
1452 (elf_backend_merge_symbol_attribute): New.
1453 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1454 (elf_x86_64_link_hash_entry): Add def_protected.
1455 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1456 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1457 when checking info->nocopyreloc.
1458 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1459 relocation run-time overflow and unresolvable R_X86_64_32S
1460 relocation against protected data symbol defined in shared object
1461 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1462 (elf_x86_64_link_setup_gnu_properties): Don't set
1463 extern_protected_data here.
1464 (elf_x86_64_merge_symbol_attribute): New function.
1465 (elf_backend_merge_symbol_attribute): New.
1467 2017-08-26 Alan Modra <amodra@gmail.com>
1469 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1470 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1471 (ppc_elf_relocate_section): Comment fix.
1472 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1473 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1474 Support dynamic relocs for TPREL16 when non-pic too.
1475 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1476 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1479 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1481 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1482 "symbol" in comments.
1483 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1485 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1488 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1489 R_X86_64_PC32 relocation run-time overflow and unresolvable
1490 R_X86_64_32S relocation with -z nocopyreloc.
1492 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1494 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1495 Undefined symbols may not have a type.
1496 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1498 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1500 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1501 bfd_link_info. Report shared, PIE or PDE object based on
1503 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1504 (elf_x86_64_relocate_section): Likewise.
1506 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1508 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1509 for function symbols.
1510 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1512 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1514 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1515 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1516 is set on any input relocatable file.
1517 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1519 2017-08-23 Alan Modra <amodra@gmail.com>
1522 * elf64-ppc.c (ensure_undef_dynamic): Rename from
1523 ensure_undefweak_dynamic. Handle undefined too.
1524 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1525 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1526 (allocate_dynrelocs): Discard undefined non-default visibility
1527 relocs first. Make undefined syms dynamic. Tidy goto.
1529 2017-08-21 Alan Modra <amodra@gmail.com>
1530 H.J. Lu <hongjiu.lu@intel.com>
1533 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
1534 * elflink.c (bfd_elf_define_start_stop): Rewrite.
1536 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
1539 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
1540 undefined weak symbols.
1542 2017-08-18 Nick Clifton <nickc@redhat.com>
1545 * tekhex.c (getsym): Fix check for source pointer walking off the
1546 end of the input buffer.
1548 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
1551 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
1552 relocations in debug sections, change abort to _bfd_error_handler.
1554 2017-08-14 Nick Clifton <nickc@redhat.com>
1557 * elf.c (setup_group): Check for an empty or very small group
1559 * po/bfd.pot: Regenerate.
1561 2017-08-14 Alan Modra <amodra@gmail.com>
1564 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
1565 alignment padding here.
1566 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
1567 in a reverse pass over sections.
1569 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
1572 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
1573 for @plt suffixes first.
1574 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1576 2017-08-08 Nick Clifton <nickc@redhat.com>
1579 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
1580 small section lengths.
1581 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
1583 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
1584 there is enough data present in the note.
1586 2017-08-08 Alan Modra <amodra@gmail.com>
1589 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
1590 got.refcount for GOTOFF relocs, just create .got section.
1592 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
1594 * elflink.c (elf_link_add_object_symbols): Move common symbol
1595 check after bed->common_definition.
1597 2017-08-07 Alan Modra <amodra@gmail.com>
1600 * elflink.c (bfd_elf_final_link): Don't segfault when sections
1601 needed to define various dynamic tags have been discarded.
1603 2017-08-07 Nick Clifton <nickc@redhat.com>
1606 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
1607 has not been set then use the bfd returned by
1608 _bfd_elf_link_setup_gnu_properties. If that is null then search
1609 through all the input bfds selecting the first normal, ELF format
1611 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1613 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1615 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
1617 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
1618 (elf_i386_check_tls_transition): Check tls_get_addr directly.
1619 (elf_i386_convert_load_reloc): Update tls_get_addr check.
1620 (elf_i386_link_check_relocs): New function.
1621 (bfd_elf32_bfd_link_check_relocs): New.
1622 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
1624 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
1625 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
1626 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
1627 (elf_x86_64_link_check_relocs): New function.
1628 (bfd_elf64_bfd_link_check_relocs): New.
1629 (bfd_elf32_bfd_link_check_relocs): Likewise.
1631 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1634 * elflink.c (elf_link_add_object_symbols): Treat common symbol
1635 as undefined for --no-define-common.
1637 2017-08-05 Alan Modra <amodra@gmail.com>
1639 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
1640 hppa_link_hash_table.
1642 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
1644 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
1645 entries for sysregs with negative indices.
1647 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1649 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
1650 isn't the S/390 specific elf data.
1651 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1653 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
1655 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
1656 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
1657 [R_RISCV_ADD16]: Likewise.
1658 [R_RISCV_ADD32]: Likewise.
1659 [R_RISCV_ADD64]: Likewise.
1660 [R_RISCV_SUB6]: Likewise.
1661 [R_RISCV_SUB8]: Likewise.
1662 [R_RISCV_SUB16]: Likewise.
1663 [R_RISCV_SUB32]: Likewise.
1664 [R_RISCV_SUB64]: Likewise.
1666 2017-07-31 Alan Modra <amodra@gmail.com>
1668 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
1669 without ld.so checks.
1671 2017-07-29 Alan Modra <amodra@gmail.com>
1674 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
1675 (ppc64_elf_merge_symbol): Set non_zero_localentry.
1676 (is_elfv2_localentry0): Test non_zero_localentry.
1677 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
1679 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1681 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
1682 pointer check for htab->elf.irelplt.
1683 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1685 2017-07-27 Nick Clifton <nickc@redhat.com>
1688 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
1690 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
1692 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
1694 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
1696 (evax_bfd_print_emh): Check for invalid string lengths.
1698 2017-07-25 Nick Clifton <nickc@redhat.com>
1700 * po/fr.po: Updated French translation.
1702 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
1705 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
1706 16-bit absolute branches into 10-bit pc-relative branches on the
1707 MSP430 as well as the MSP430X.
1709 2017-07-25 Alan Modra <amodra@gmail.com>
1711 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
1712 (stub_eh_frame_size): New function.
1713 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
1714 (group_sections): Init group tls_get_addr_opt_bctrl.
1715 (ppc64_elf_size_stubs): Update sizing and initialization of
1716 .eh_frame. Iteration over stubs via group list.
1717 (ppc64_elf_build_stubs): Iterate over stubs via group list.
1718 (ppc64_elf_finish_dynamic_sections): Update finalization of
1721 2017-07-24 Nick Clifton <nickc@redhat.com>
1724 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
1725 of the relocs to the canonicalize_one_reloc routine.
1726 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
1727 for the _bfd_mach_o_canonicalize_one_reloc field.
1728 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
1729 res_base parameter. Use to check for corrupt pair relocs.
1730 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
1732 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
1734 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
1737 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
1738 enough data in the record before attempting to parse it.
1739 (_bfd_vms_slurp_eeom): Likewise.
1741 (_bfd_vms_slurp_egsd): Check for an invalid section index.
1742 (image_set_ptr): Likewise.
1743 (alpha_vms_slurp_relocs): Likewise.
1745 (alpha_vms_object_p): Check for a truncated record.
1747 2017-07-24 Nick Clifton <nickc@redhat.com>
1750 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
1751 an unrecognized reloc and sets the bfd_error value.
1752 * libbfd.h: Regenerate.
1753 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
1755 * elf32-i386.c (elf_i386_relocate_section): Likewise.
1756 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1757 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1758 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
1759 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1761 2017-07-23 Alan Modra <amodra@gmail.com>
1763 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
1766 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
1769 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
1770 reloc_class_ifunc for ifunc symbols.
1772 2017-07-19 Nick Clifton <nickc@redhat.com>
1775 * archive.c (bfd_generic_archive_p): If the bfd does not have the
1776 correct magic bytes at the start, set the error to wrong format
1777 and clear the format selector before returning NULL.
1779 2017-07-19 Nick Clifton <nickc@redhat.com>
1782 * coff-rs6000.c (_bfd_strntol): New function.
1783 (_bfd_strntoll): New function.
1784 (GET_VALUE_IN_FIELD): New macro.
1785 (EQ_VALUE_IN_FIELD): new macro.
1786 (_bfd_xcoff_slurp_armap): Use new macros.
1787 (_bfd_xcoff_archive_p): Likewise.
1788 (_bfd_xcoff_read_ar_hdr): Likewise.
1789 (_bfd_xcoff_openr_next_archived_file): Likewise.
1790 (_bfd_xcoff_stat_arch_elt): Likewise.
1791 * coff64-rs6000.c (_bfd_strntol): New function.
1792 (_bfd_strntoll): New function.
1793 (GET_VALUE_IN_FIELD): New macro.
1794 (xcoff64_slurp_armap): Use new macros.
1796 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
1797 John Eric Martin <John.Martin@emmicro-us.com>
1799 * bfd-in2.h: Regenerate.
1800 * libbfd.h: Regenerate.
1801 * elf32-arc.c (JLI): Define.
1802 * reloc.c: Add JLI relocations.
1804 2017-07-18 Nick Clifton <nickc@redhat.com>
1807 * coff-sh.c: Fix spelling typos.
1808 * compress.c: Likewise.
1809 * cpu-pdp11.c: Likewise.
1810 * ecofflink.c: Likewise.
1811 * elf-m10300.c: Likewise.
1813 * elf32-arm.c: Likewise.
1814 * elf32-m68k.c: Likewise.
1815 * elf32-nds32.c: Likewise.
1816 * elf32-ppc.c: Likewise.
1817 * elf32-sh.c: Likewise.
1818 * elf32-v850.c: Likewise.
1819 * elf64-ppc.c: Likewise.
1820 * elf64-x86-64.c: Likewise.
1821 * elflink.c: Likewise.
1822 * elfnn-aarch64.c: Likewise.
1823 * elfxx-mips.c: Likewise.
1825 * sunos.c: Likewise.
1826 * vms-alpha.c: Likewise.
1827 * xcofflink.c: Likewise.
1829 2017-07-18 Nick Clifton <nickc@redhat.com>
1832 * coffcode.h (handle_COMDAT): Replace abort with an error message
1835 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1838 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
1841 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1843 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
1845 2017-07-16 Alan Modra <amodra@gmail.com>
1847 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
1848 __tls_index GOT entries when using __tls_get_addr_opt stub.
1849 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1851 2017-07-12 Alan Modra <amodra@gmail.com>
1853 * po/es.po: Update from translationproject.org/latest/bfd/.
1854 * po/fi.po: Likewise.
1855 * po/fr.po: Likewise.
1856 * po/id.po: Likewise.
1857 * po/ja.po: Likewise.
1858 * po/ro.po: Likewise.
1859 * po/ru.po: Likewise.
1860 * po/sr.po: Likewise.
1861 * po/sv.po: Likewise.
1862 * po/tr.po: Likewise.
1863 * po/uk.po: Likewise.
1864 * po/vi.po: Likewise.
1865 * po/zh_CN.po: Likewise.
1866 * po/hr.po: New file from translationproject.org.
1867 * configure.ac (ALL_LINGUAS): Add hr. Sort.
1868 * configure: Regenerate.
1870 2017-07-12 Nick Clifton <nickc@redhat.com>
1872 Fix compile time warnings using gcc 7.1.1.
1873 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
1875 (elf_xtensa_get_gotplt_section): Increase length of got_name
1877 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
1878 default return of FALSE.
1879 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
1880 default return of FALSE.
1882 2017-07-12 Alan Modra <amodra@gmail.com>
1884 * binary.c (binary_set_section_contents): Don't print filepos in
1886 (coff_write_object_contents): Cast size_t for error message.
1887 (coff_slurp_line_table): Don't use bfd_vma symndx.
1888 (coff_slurp_reloc_table): Remove unneeded cast.
1889 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
1891 (find_abstract_instance_name): Likewise.
1892 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
1893 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
1894 (elf32_arm_check_relocs): Make r_symndx an int.
1895 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
1897 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
1899 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
1901 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
1902 * elf32-s390.c (elf_s390_check_relocs): Likewise.
1903 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
1904 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
1905 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1906 * elf64-s390.c (elf_s390_check_relocs): Likewise.
1907 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1908 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
1909 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
1910 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1911 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
1912 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
1913 and use %lu for error message.
1914 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
1915 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
1918 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
1920 (elf32_arm_final_link_relocate): Likewise.
1921 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
1922 * coffcode.h (styp_to_sec_flags): Likewise.
1923 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
1924 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
1925 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
1926 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
1927 (elf32_bfin_merge_private_bfd_data): Likewise.
1928 * elf32-cris.c (cris_elf_relocate_section): Likewise.
1929 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1930 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
1931 (i370_elf_relocate_section): Likewise.
1932 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
1933 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
1934 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
1935 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
1936 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
1937 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
1938 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
1939 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
1940 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1941 * ieee.c (ieee_write_id, read_id): Likewise.
1942 * mach-o.c (bfd_mach_o_write_contents): Likewise.
1943 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
1944 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
1945 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
1946 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
1947 * stabs.c (_bfd_link_section_stabs): Likewise.
1949 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
1951 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
1952 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
1953 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
1954 * coff-sh.c (sh_relax_section): Likewise.
1955 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
1956 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
1957 * coffcode.h (coff_slurp_reloc_table): Likewise.
1958 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1959 (_bfd_coff_read_string_table): Likewise.
1960 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
1961 * compress.c (bfd_get_full_section_contents): Likewise.
1962 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
1963 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
1964 * elf.c (bfd_elf_string_from_elf_section): Likewise.
1965 * elf32-arc.c (arc_special_overflow_checks): Likewise.
1966 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
1967 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
1968 (elf32_arm_write_section): Likewise.
1969 * elf32-bfin.c (bfin_relocate_section): Likewise.
1970 (bfinfdpic_relocate_section): Likewise.
1971 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1972 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
1973 * elf32-i386.c (elf_i386_tls_transition): Likewise.
1974 (elf_i386_relocate_section): Likewise.
1975 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
1976 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
1977 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1978 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1979 * elf32-metag.c (elf_metag_relocate_section): Likewise.
1980 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
1981 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
1982 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
1983 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
1984 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
1985 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
1986 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
1987 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
1988 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
1989 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
1990 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
1991 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
1992 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
1993 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
1994 * elf32-sh.c (sh_elf_relax_section): Likewise.
1995 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
1996 (sh_elf_relocate_section): Likewise.
1997 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
1998 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1999 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2000 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2001 * elf32-v850.c (v850_elf_relax_section): Likewise.
2002 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2003 (elf_vax_relocate_section): Likewise.
2004 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2005 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2006 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2007 (do_fix_for_relocatable_link): Likewise.
2008 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2009 (elf64_alpha_relax_with_lituse): Likewise.
2010 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2011 (elf_hppa_final_link_relocate): Likewise.
2012 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2013 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2014 (elf64_vms_link_add_object_symbols): Likewise.
2015 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2016 (mmix_final_link_relocate): Likewise.
2017 * elf64-s390.c (invalid_tls_insn): Likewise.
2018 (elf_s390_relocate_section): Likewise.
2019 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2020 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2021 (elf_x86_64_relocate_section): Likewise.
2022 * elfcode.h (elf_slurp_symbol_table): Likewise.
2023 * elfcore.h (elf_core_file_p): Likewise.
2024 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2025 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2026 (elfNN_aarch64_relocate_section): Likewise.
2027 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2028 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2029 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2030 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2031 (_bfd_mips_elf_relocate_section): Likewise.
2032 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2033 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2034 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2035 * ieee.c (ieee_slurp_external_symbols): Likewise.
2036 * ihex.c (ihex_write_object_content): Likewise.
2037 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2038 * merge.c (_bfd_merged_section_offset): Likewise.
2039 * mmo.c (mmo_write_loc_chunk): Likewise.
2040 (mmo_write_object_contents): Likewise.
2041 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2042 * stabs.c (_bfd_link_section_stabs): Likewise.
2043 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2045 2017-07-11 Alan Modra <amodra@gmail.com>
2047 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2049 2017-07-11 Alan Modra <amodra@gmail.com>
2051 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2052 instruction" error using _bfd_error_handler, not einfo.
2054 2017-07-10 Nick Clifton <nickc@redhat.com>
2056 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2057 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2059 2017-07-07 John Baldwin <jhb@FreeBSD.org>
2061 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2063 2017-07-07 Alan Modra <amodra@gmail.com>
2065 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2067 2017-07-07 Alan Modra <amodra@gmail.com>
2069 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2070 as long long. Move code replacing "ll" with "I64", and simplify.
2072 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2074 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2077 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2079 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2081 (line_info_add_file_name): Likewise.
2082 (decode_line_info): Likewise.
2084 2017-07-04 Tristan Gingold <gingold@adacore.com>
2086 * version.m4: Bump version to 2.29.51
2087 * configure: Regenerate.
2089 2017-07-04 Jiong Wang <jiong.wang@arm.com>
2091 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2092 sanity check at the head of this function.
2094 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2096 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2097 dwarf_line_str_size.
2098 (struct attr_abbrev): Add field implicit_const.
2099 (dwarf_debug_sections): Add .debug_line_str.
2100 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2101 (dwarf_debug_section_assert): Add static assertion.
2102 (read_indirect_line_string): New.
2103 (read_abbrevs): Support DW_FORM_implicit_const.
2104 (is_str_attr): Support DW_FORM_line_strp.
2105 (read_attribute_value): Support DW_FORM_line_strp and
2106 DW_FORM_implicit_const.
2107 (read_attribute): Support DW_FORM_implicit_const.
2108 (line_info_add_include_dir, line_info_add_include_dir_stub):
2109 (line_info_add_file_name, read_formatted_entries): New.
2110 (decode_line_info, parse_comp_unit): Support DWARF 5.
2111 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2113 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2115 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2116 abort statement that was put for symbols that are not dynamic.
2118 2017-07-03 Tristan Gingold <gingold@adacore.com>
2120 * po/bfd.pot: Regenerate
2122 2017-07-03 Alan Modra <amodra@gmail.com>
2124 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2125 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
2126 * elf.c (setup_group): Use "Lx" to print sh_size.
2127 (_bfd_elf_setup_sections): Remove unnecessary cast and print
2128 unknown section type in hex.
2129 (copy_special_section_fields): Style fix.
2130 (bfd_section_from_shdr): Correct format for sh_link. Use a
2131 common error message for all the variants of unrecognized
2133 (assign_file_positions_for_load_sections): Use "Lx" for lma
2134 adjust error message.
2135 (assign_file_positions_for_non_load_sections): Formatting.
2136 (rewrite_elf_program_header): Formatting. Use "Lx" for
2137 bfd_vma values in error messages.
2138 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2139 ELF_R_SYM value to type expected by format.
2140 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2142 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2143 (elf_link_input_bfd): Use "Lx" for r_info.
2144 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2146 2017-07-03 Alan Modra <amodra@gmail.com>
2148 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2149 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2150 Microsoft C library variant of long long format specifier.
2151 (PRINT20): Cast value to bfd_uint64_t not long long.
2152 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2153 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2154 long long. Don't cast to bfd_vma.
2155 * elf32-score.c (score3_bfd_getl48): Likewise.
2156 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2158 2017-07-03 Alan Modra <amodra@gmail.com>
2160 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2162 (bfd_elf_print_symbol): Don't cast symbol->flags.
2163 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2164 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2165 _bfd_error_handler argument order.
2166 (ppc_elf_merge_private_bfd_data): Don't cast flags.
2168 2017-07-03 Alan Modra <amodra@gmail.com>
2170 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
2171 AC_TYPE_LONG_DOUBLE.
2172 * configure: Regenerate.
2173 * config.in: Regenerate.
2175 2017-06-29 Andrew Waterman <andrew@sifive.com>
2177 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2180 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2182 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2183 unless it is undefined weak.
2184 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2185 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2187 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2188 is not dynamic in PIC, abort.
2190 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2193 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2194 undefined weak symbols into dynamic.
2195 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2196 relocation for non-dynamic symbols.
2197 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2199 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2201 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2202 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2203 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2204 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2205 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2208 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
2210 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2211 (elfcore_write_s390_gs_bc): Likewise.
2212 * elf.c (elfcore_grok_s390_gs_cb): New function.
2213 (elfcore_grok_s390_gs_bc): New function.
2214 (elfcore_grok_note): Call them.
2215 (elfcore_write_s390_gs_cb): New function.
2216 (elfcore_write_s390_gs_bc): New function.
2217 (elfcore_write_register_note): Call them.
2219 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2221 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2222 bfd_get_file_size. Check archive element size.
2223 (_bfd_generic_get_section_contents_in_window): Likewise.
2225 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2227 * bfd-in2.h: Regenerated.
2228 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2229 (bfd_get_file_size): Likewise.
2231 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2232 Matthew Fortune <matthew.fortune@imgtec.com>
2234 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2235 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2236 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2237 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2239 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2240 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2241 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2242 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2243 `bfd_mach_mips_interaptiv_mr2' entries.
2244 * bfd-in2.h: Regenerate.
2246 2017-06-27 Nick Clifton <nickc@redhat.com>
2248 * tekhex.c (pass_over): Revert accidental conversion of a local
2249 array to a static array.
2251 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2254 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2255 reloc addend if necessary. Adjust diff only if
2256 shrinked_insn_address < end_address.
2258 2017-06-27 Alan Modra <amodra@gmail.com>
2261 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2262 (_bfd_generic_get_section_contents_in_window): Likewise.
2264 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2266 * elfnn-riscv.c (perform_relocation): Support the new
2267 R_RISCV_32_PCREL relocation.
2268 (riscv_elf_relocate_section): Likewise.
2269 * elfxx-riscv.c (howto_table): Likewise.
2270 (riscv_reloc_map): Likewise.
2271 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2272 * libbfd.h: Regenerate.
2274 2017-06-27 Alan Modra <amodra@gmail.com>
2277 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2278 Use unsigned file pointer type, and remove cast.
2279 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2280 Add "count", not "sz".
2282 2017-06-26 Pedro Alves <palves@redhat.com>
2285 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2288 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2291 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2294 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2296 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2297 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2298 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2299 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2300 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2302 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2305 * compress.c (bfd_get_full_section_contents): Don't check the
2307 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2308 reject a section whose size + offset is greater than the size
2310 (_bfd_generic_get_section_contents_in_window): Likewise.
2312 2017-06-26 Nick Clifton <nickc@redhat.com>
2315 * tekhex.c (getvalue): Check for the source pointer exceeding the
2316 end pointer before the first byte is read.
2318 2017-06-26 Nick Clifton <nickc@redhat.com>
2321 * opncls.c (get_build_id): Check that the section is big enough
2322 to contain the whole note.
2323 * compress.c (bfd_get_full_section_contents): Check for and reject
2324 a section whose size is greater than the size of the entire file.
2325 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2326 contain a notes section.
2328 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2330 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2332 (elf_s390_modify_segment_map): Likewise.
2333 (bfd_elf_s390_set_options): Lisewise.
2335 2017-06-26 Alan Modra <amodra@gmail.com>
2337 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2339 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2340 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2341 .preinit_array on --just-syms bfds.
2342 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2343 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2344 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2346 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2348 * elf.c (find_link): Bounds check "hint".
2350 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2352 * elf32-arm.c (using_thumb_only): Update list of architectures in
2353 BFD_ASSERT for which the logic is valid.
2354 (using_thumb2_bl): Likewise.
2355 (using_thumb2): Likewise and return true for ARMv8-R.
2356 (arch_has_arm_nop): Likewise.
2357 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2358 merging logic. Update commentis for value 15 of v8m_baseline,
2359 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2360 merging of value 15 of Tag_CPU_arch.
2362 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2364 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2365 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2366 * bfd-in2.h: Regenerate.
2368 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2370 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2371 the error_alignment label forward. Properly align program
2372 property note section.
2374 2017-06-22 Eric Christopher <echristo@gmail.com>
2376 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2377 abs to fix a truncation warning.
2379 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2381 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2382 local undefined weak symbol to 0.
2383 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2385 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2387 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2388 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2389 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2390 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2391 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2392 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2393 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2394 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2396 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2398 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2399 (elf_i386_lazy_ibt_plt_entry): Likewise.
2400 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2401 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2402 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2403 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2404 (elf_i386_lazy_plt_layout): Likewise.
2405 (elf_i386_non_lazy_plt_layout): Likewise.
2406 (elf_i386_link_hash_entry): Add plt_second.
2407 (elf_i386_link_hash_table): Add plt_second and
2408 plt_second_eh_frame.
2409 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2410 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2411 the second PLT. Check the second PLT.
2412 (elf_i386_relocate_section): Use the second PLT to resolve
2413 PLT reference if needed.
2414 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2416 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2417 second PLT. Generate unwind info for the second PLT.
2418 (elf_i386_plt_type): Add plt_second.
2419 (elf_i386_get_synthetic_symtab): Support the second PLT.
2420 (elf_i386_parse_gnu_properties): Support
2421 GNU_PROPERTY_X86_FEATURE_1_AND.
2422 (elf_i386_merge_gnu_properties): Support
2423 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2424 on GNU_PROPERTY_X86_FEATURE_1_IBT
2425 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2426 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2427 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2428 is set on all relocatable inputs.
2429 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2430 (elf_x32_lazy_ibt_plt_entry): Likewise.
2431 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2432 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2433 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2434 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2435 (elf_x86_64_lazy_ibt_plt): Likewise.
2436 (elf_x32_lazy_ibt_plt): Likewise.
2437 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2438 (elf_x32_non_lazy_ibt_plt): Likewise.
2439 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2440 (elf_x86_64_parse_gnu_properties): Support
2441 GNU_PROPERTY_X86_FEATURE_1_AND.
2442 (elf_x86_64_merge_gnu_properties): Support
2443 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2444 on GNU_PROPERTY_X86_FEATURE_1_IBT
2445 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2446 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2447 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2448 is set on all relocatable inputs.
2450 2017-06-22 Nick Clifton <nickc@redhat.com>
2453 * som.c (setup_sections): NUL terminate the space_strings buffer.
2454 Check that the space.name field does not index beyond the end of
2455 the space_strings buffer.
2457 2017-06-21 Nick Clifton <nickc@redhat.com>
2460 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2462 2017-06-21 Nick Clifton <nickc@redhat.com>
2465 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2466 type of the size parameter.
2467 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2468 length of the counted string.
2469 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2470 (_bfd_vms_save_counted_string): Likewise.
2471 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2472 _bfd_vms_save_counted_string.
2473 (_bfd_vms_slurp_ehdr): Likewise.
2474 (_bfd_vms_slurp_egsd): Likewise.
2475 (Parse_module): Likewise.
2477 2017-06-21 Alan Modra <amodra@gmail.com>
2479 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2480 calls before tocsave calls.
2481 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2484 2017-06-21 Nick Clifton <nickc@redhat.com>
2487 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2488 bfd_get_full_section_contents returns no contents.
2490 2017-06-21 Nick Clifton <nickc@redhat.com>
2493 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2496 2017-06-21 Nick Clifton <nickc@redhat.com>
2499 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2501 (image_set_ptr): Likewise.
2502 (alpha_vms_fix_sec_rel): Likewise.
2503 (alpha_vms_slurp_relocs): Likewise.
2505 2017-06-21 Nick Clifton <nickc@redhat.com>
2508 * ieee.c (ieee_slurp_sections): Check for a NULL return from
2510 (ieee_archive_p): Likewise.
2511 (ieee_object_p): Likewise.
2513 2017-06-21 Nick Clifton <nickc@redhat.com>
2516 * elf.c (setup_group): Zero the group section pointer list after
2517 allocation so that loops can be caught. Check for NULL pointers
2518 when processing a group list.
2520 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2522 * elf-s390.h: New file.
2523 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2525 (elf_s390_additional_program_headers): New function.
2526 (elf_s390_modify_segment_map): New function.
2527 (bfd_elf_s390_set_options): New function.
2528 (elf_backend_additional_program_headers)
2529 (elf_backend_modify_segment_map): Add macro definitions.
2531 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
2534 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
2535 the DYNAMIC bit instead of bfd_count_sections.
2537 2017-06-19 Nick Clifton <nickc@redhat.com>
2540 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
2542 (evax_bfd_print_eeom): Likewise.
2543 (evax_bfd_print_egsd): Check for an overlarge record length.
2544 (evax_bfd_print_etir): Likewise.
2546 2017-06-19 Nick Clifton <nickc@redhat.com>
2549 * libieee.h (struct common_header_type): Add end_p field.
2550 * ieee.c (this_byte_and_next): Do not advance input_p beyond
2552 (read_id): Check for a length that exceeds the remaining bytes in
2554 (ieee_seek): Initialise end_p.
2555 (ieee_archive_p): Likewise.
2556 (ieee_object_p): Likewise.
2558 2017-06-19 Nick Clifton <nickc@redhat.com>
2561 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
2562 before reading the EIHS structure entries.
2564 2017-06-19 Nick Clifton <nickc@redhat.com>
2567 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
2568 gsd_size. Check that there are enough bytes remaining to read the
2569 type and size of the next egsd. Check that the size of the egsd
2570 does not exceed the size of the record.
2572 2017-06-19 Alan Modra <amodra@gmail.com>
2574 * config.bfd: Correct targ_underscore for cris.
2576 2017-06-18 Alan Modra <amodra@gmail.com>
2578 * config.bfd: Correct targ_underscore for epiphany, ip2k,
2579 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
2581 2017-06-16 Nick Clifton <nickc@redhat.com>
2583 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
2584 bucketlist is empty because there are no symbols to add to the
2587 2017-06-16 Alan Modra <amodra@gmail.com>
2593 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
2594 (BFD_JUMP_TABLE_LINK): Likewise.
2595 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
2596 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
2597 (bfd_elf_define_start_stop): New function.
2598 * linker.c (bfd_generic_define_start_stop): New function.
2599 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
2601 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
2602 * aout-target.h (MY_bfd_define_start_stop): Define.
2603 * aout-tic30.c (MY_bfd_define_start_stop): Define.
2604 * binary.c (binary_bfd_define_start_stop): Define.
2605 * bout.c (b_out_bfd_define_start_stop): Define.
2606 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
2607 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
2608 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
2609 * coffcode.h (coff_bfd_define_start_stop): Define.
2610 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
2611 * i386msdos.c (msdos_bfd_define_start_stop): Define.
2612 * i386os9k.c (os9k_bfd_define_start_stop): Define.
2613 * ieee.c (ieee_bfd_define_start_stop): Define.
2614 * ihex.c (ihex_bfd_define_start_stop): Define.
2615 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
2616 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
2617 * mmo.c (mmo_bfd_define_start_stop): Define.
2618 * nlm-target.h (nlm_bfd_define_start_stop): Define.
2619 * oasys.c (oasys_bfd_define_start_stop): Define.
2620 * pef.c (bfd_pef_bfd_define_start_stop): Define.
2621 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
2622 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
2623 * som.c (som_bfd_define_start_stop): Define.
2624 * srec.c (srec_bfd_define_start_stop): Define.
2625 * tekhex.c (tekhex_bfd_define_start_stop): Define.
2626 * versados.c (versados_bfd_define_start_stop): Define.
2627 * vms-alpha.c (vms_bfd_define_start_stop): Define.
2628 (alpha_vms_bfd_define_start_stop): Define.
2629 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
2630 * bfd-in2.h: Regenerate.
2631 * libbfd.h: Regenerate.
2633 2017-06-16 Jiong Wang <jiong.wang@arm.com>
2635 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
2636 SYMBOL_REFERENCES_LOCAL.
2638 2017-06-15 Jiong Wang <jiong.wang@arm.com>
2641 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
2642 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
2643 runtime for if there needs copy relocation elimination.
2644 (need_copy_relocation_p): New function. Return true for symbol with
2645 pc-relative references and if it's against read-only sections.
2646 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
2647 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
2648 that are related with accessing external objects.
2649 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
2650 in elfNN_aarch64_check_relocs.
2652 2017-06-15 Nick Clifton <nickc@redhat.com>
2655 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
2658 (ieee_archive_p): Likewise.
2660 2017-06-15 Nick Clifton <nickc@redhat.com>
2663 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
2665 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
2667 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
2668 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
2669 keep both windowed and call0 ABI PLT definitions.
2670 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
2671 elf_xtensa_*_plt_entry endex.
2672 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
2674 2017-06-14 Nick Clifton <nickc@redhat.com>
2677 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
2680 2017-06-14 Nick Clifton <nickc@redhat.com>
2683 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
2684 maximum value for the ascic pointer. Check that name processing
2685 does not read beyond this value.
2686 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
2689 2017-06-14 Nick Clifton <nickc@redhat.com>
2692 * versados.c (versados_mkobject): Zero the allocated tdata structure.
2693 (process_otr): Check for an invalid offset in the otr structure.
2695 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
2697 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
2699 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
2705 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
2706 vtable field to a union.
2707 (_bfd_elf_is_start_stop): Removed.
2708 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
2709 __start_SECNAME and __stop_SECNAME symbols.
2710 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
2711 * elflink.c (_bfd_elf_is_start_stop): Removed.
2712 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
2713 _bfd_elf_is_start_stop.
2714 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
2715 __stop_SECNAME symbols. Updated.
2716 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2717 (bfd_elf_gc_record_vtinherit): Likewise.
2718 (bfd_elf_gc_record_vtentry): Likewise.
2720 2017-06-13 Nick Clifton <nickc@redhat.com>
2723 * elflink.c (elf_link_adjust_relocs): Generate an error when
2724 encountering a reloc against a symbol removed by garbage
2727 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
2729 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
2730 to merge_gnu_properties.
2731 * elf-properties.c (elf_merge_gnu_properties): Add struct
2732 bfd_link_info * and pass it to merge_gnu_properties.
2733 (elf_merge_gnu_property_list): Add struct bfd_link_info *
2734 and pass it to elf_merge_gnu_properties.
2735 (_bfd_elf_link_setup_gnu_properties): Pass info to
2736 elf_merge_gnu_property_list.
2737 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
2739 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
2741 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
2744 * binary.c (binary_set_section_contents): Scale lma by octets
2745 per byte to set filepos.
2747 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2749 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
2752 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2754 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
2757 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2759 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
2760 patched section contents for TLS IE reloc.
2761 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
2763 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2765 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
2766 RELOC_FOR_GLOBAL_SYMBOL macro.
2768 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2770 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
2773 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2775 * config/tc-arc.c (md_undefined_symbol): Changed.
2776 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
2778 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2780 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
2783 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2785 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
2786 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
2788 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2790 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
2793 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
2795 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
2796 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
2797 is non-zero. Add clarifying comments.
2799 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
2801 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
2802 name. Use local IFUNC symbol name string to report unsupported
2803 non-PIC call to IFUNC function.
2804 (elf_i386_relocate_section): Dump local IFUNC name with minfo
2805 when generating R_386_IRELATIVE relocation.
2806 (elf_i386_finish_dynamic_symbol): Likewise.
2807 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
2809 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
2810 when generating R_X86_64_IRELATIVE relocation.
2811 (elf_x86_64_finish_dynamic_symbol): Likewise.
2813 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2815 * elf.c (setup_group): Make sure BFD sections are created for all
2816 group sections in the input file when processing SHF_GROUP
2818 (bfd_section_from_shdr): Avoid duplicating logic already
2819 implemented in `setup_group'.
2821 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
2824 * peXXigen.c (pe_print_idata): Use the address of the first thunk
2825 if the hint address is zero.
2827 2017-06-06 James Clarke <jrtc27@jrtc27.com>
2830 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
2831 ELF_COMMON_DEF_P for common symbols.
2833 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
2835 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
2836 SEC_GROUP sections as SEC_EXCLUDE.
2837 (bfd_elf_set_group_contents): Replace use of abort with an assert.
2838 (assign_section_numbers): Use resolve_section_groups flag instead
2839 of relocatable link type.
2840 (_bfd_elf_init_private_section_data): Use resolve_section_groups
2841 flag instead of checking the final_link flag for part of the
2842 checks in here. Fix white space as a result.
2843 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
2844 instead of relocatable link type.
2845 (bfd_elf_final_link): Likewise.
2847 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2849 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
2851 * elf32-score.c (score_elf_final_link_relocate): Likewise.
2852 (s3_bfd_score_elf_check_relocs): Likewise.
2853 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2854 (score_elf_final_link_relocate): Likewise.
2855 (s7_bfd_score_elf_check_relocs): Likewise.
2857 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2859 * elflink.c (init_reloc_cookie_rels): Remove unused variable
2862 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
2864 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
2865 from `reloc_count' rather than decrementing it.
2866 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
2867 `reloc_count' by `int_rels_per_ext_rel'.
2868 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
2869 `reloc_count' by `int_rels_per_ext_rel' for last relocation
2870 entry determination.
2871 (s3_bfd_score_elf_check_relocs): Likewise.
2872 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
2873 (s7_bfd_score_elf_relocate_section): Likewise.
2874 (s7_bfd_score_elf_check_relocs): Likewise.
2875 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
2876 prototype and function.
2877 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
2878 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
2879 triple rather than once the sum of REL and RELA relocation entry
2881 (bfd_elf64_get_reloc_upper_bound): Remove macro.
2882 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
2883 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
2884 storage allocation size determination.
2885 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
2886 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
2887 by `int_rels_per_ext_rel' for last relocation entry
2889 (bfd_elf_final_link): Do not multiply `reloc_count' by
2890 `int_rels_per_ext_rel' for internal relocation storage
2891 allocation size determination.
2892 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
2893 `int_rels_per_ext_rel' for last relocation entry determination.
2894 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2895 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2896 (_bfd_mips_elf_relocate_section): Likewise.
2898 2017-06-05 Alan Modra <amodra@gmail.com>
2901 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
2903 2017-06-01 John Baldwin <jhb@FreeBSD.org>
2905 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
2906 determine structure sizes.
2907 (elfcore_grok_freebsd_prstatus): Likewise.
2909 2017-06-01 Alan Modra <amodra@gmail.com>
2911 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
2912 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
2914 (is_elfv2_localentry0): New function.
2915 (ppc64_elf_tls_setup): Default params->plt_localentry0.
2916 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
2917 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
2918 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
2919 optimized localentry:0 stubs.
2920 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
2921 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
2923 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
2925 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
2927 2017-05-30 Casey Smith <clegg89@gmail.com>
2930 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
2931 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
2933 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
2935 * cpu-arc.c (arc_compatible): New function.
2937 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
2939 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
2941 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
2944 * bfdio.c (bfd_get_file_size): New function.
2945 * bfd-in2.h: Regenerated.
2947 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
2949 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
2952 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
2954 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
2955 dynobj instead of htab->elf.dynobj.
2957 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
2959 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
2961 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
2962 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
2963 actual number of internal relocations retrieved. Adjust
2964 function description.
2965 (bfd_elf64_canonicalize_reloc): Remove macro.
2966 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
2968 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
2970 * archures.c (bfd_mach_sparc_v9m8): Define.
2971 (bfd_mach_sparc_v8plusm8): Likewise.
2972 (bfd_mach_sparc_v9_p): Adjust to M8.
2973 (bfd_mach_sparc_64bit_p): Likewise.
2974 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
2975 bfd_mach_sparc_v8plusm8.
2976 * bfd-in2.h: Regenerated.
2977 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
2979 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
2980 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
2981 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
2983 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
2984 bfd_mach_sparc_v8plusm8.
2986 2017-05-19 Alan Modra <amodra@gmail.com>
2988 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
2989 debug and special sections when no non-note alloc sections in an
2992 2017-05-18 Alan Modra <amodra@gmail.com>
2994 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
2995 * elf-m10300.c: Likewise.
2997 * elf32-arc.c: Likewise.
2998 * elf32-bfin.c: Likewise.
2999 * elf32-m68k.c: Likewise.
3000 * elf32-nds32.c: Likewise.
3001 * elf32-tilepro.c: Likewise.
3002 * elflink.c: Likewise.
3003 * elfnn-aarch64.c: Likewise.
3004 * elfnn-riscv.c: Likewise.
3005 * elfxx-tilegx.c: Likewise.
3006 * mach-o.c: Likewise.
3007 * peXXigen.c: Likewise.
3008 * vms-alpha.c: Likewise.
3009 * vms-lib.c: Likewise.
3011 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3014 * elflink.c (elf_gc_mark_debug_section): New function.
3015 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3016 referenced by kept debug sections.
3018 2017-05-16 Alan Modra <amodra@gmail.com>
3020 * elf-m10300.c: Rename occurrences of non_ir_ref.
3021 * elf32-arm.c: Likewise.
3022 * elf32-bfin.c: Likewise.
3023 * elf32-cr16.c: Likewise.
3024 * elf32-cris.c: Likewise.
3025 * elf32-d10v.c: Likewise.
3026 * elf32-dlx.c: Likewise.
3027 * elf32-fr30.c: Likewise.
3028 * elf32-frv.c: Likewise.
3029 * elf32-hppa.c: Likewise.
3030 * elf32-i370.c: Likewise.
3031 * elf32-i386.c: Likewise.
3032 * elf32-iq2000.c: Likewise.
3033 * elf32-lm32.c: Likewise.
3034 * elf32-m32c.c: Likewise.
3035 * elf32-m32r.c: Likewise.
3036 * elf32-m68hc1x.c: Likewise.
3037 * elf32-m68k.c: Likewise.
3038 * elf32-mcore.c: Likewise.
3039 * elf32-metag.c: Likewise.
3040 * elf32-microblaze.c: Likewise.
3041 * elf32-moxie.c: Likewise.
3042 * elf32-msp430.c: Likewise.
3043 * elf32-mt.c: Likewise.
3044 * elf32-nios2.c: Likewise.
3045 * elf32-or1k.c: Likewise.
3046 * elf32-ppc.c: Likewise.
3047 * elf32-rl78.c: Likewise.
3048 * elf32-s390.c: Likewise.
3049 * elf32-score.c: Likewise.
3050 * elf32-score7.c: Likewise.
3051 * elf32-sh.c: Likewise.
3052 * elf32-tic6x.c: Likewise.
3053 * elf32-tilepro.c: Likewise.
3054 * elf32-v850.c: Likewise.
3055 * elf32-vax.c: Likewise.
3056 * elf32-xstormy16.c: Likewise.
3057 * elf32-xtensa.c: Likewise.
3058 * elf64-alpha.c: Likewise.
3059 * elf64-hppa.c: Likewise.
3060 * elf64-ia64-vms.c: Likewise.
3061 * elf64-mmix.c: Likewise.
3062 * elf64-ppc.c: Likewise.
3063 * elf64-s390.c: Likewise.
3064 * elf64-sh64.c: Likewise.
3065 * elf64-x86-64.c: Likewise.
3066 * elflink.c: Likewise.
3067 * elfnn-aarch64.c: Likewise.
3068 * elfnn-ia64.c: Likewise.
3069 * elfnn-riscv.c: Likewise.
3070 * elfxx-mips.c: Likewise.
3071 * elfxx-sparc.c: Likewise.
3072 * elfxx-tilegx.c: Likewise.
3073 * linker.c: Likewise.
3075 2017-05-16 Alan Modra <amodra@gmail.com>
3077 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3078 * elflink.c (elf_link_add_object_symbols): Update to use
3080 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3082 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3084 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3086 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3088 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3090 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3091 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3093 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3095 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3097 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3099 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3100 to plt_second/plt_second_eh_frame.
3101 (elf_x86_64_link_hash_newfunc): Updated.
3102 (elf_x86_64_allocate_dynrelocs): Likewise.
3103 (elf_x86_64_size_dynamic_sections): Likewise.
3104 (elf_x86_64_relocate_section): Likewise.
3105 (elf_x86_64_finish_dynamic_symbol): Likewise.
3106 (elf_x86_64_finish_dynamic_sections): Likewise.
3107 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3108 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3110 (elf_backend_setup_gnu_properties): Updated. Create the
3111 .plt.sec section instead of the .plt.sec section.
3113 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3115 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3116 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3117 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3119 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3121 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3122 (bfd_elf64_set_reloc): Define.
3123 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3125 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3127 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3128 (struct bfd_target): New field _bfd_set_reloc.
3129 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3130 * reloc.c (_bfd_generic_set_reloc): New function.
3131 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3132 * nlm-target.h (nlm_set_reloc): Likewise.
3133 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3134 * aout-tic30.c (MY_set_reloc): Likewise.
3135 * aout-target.h (MY_set_reloc): Likewise.
3136 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3137 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3138 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3139 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3140 * aout-adobe.c (aout_32_set_reloc): Likewise.
3141 * bout.c (b_out_set_reloc): Likewise.
3142 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3143 * i386os9k.c (aout_32_set_reloc): Likewise.
3144 * ieee.c (ieee_set_reloc): Likewise.
3145 * oasys.c (oasys_set_reloc): Likewise.
3146 * som.c (som_set_reloc): Likewise.
3147 * versados.c (versados_set_reloc): Likewise.
3148 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3149 _bfd_generic_set_reloc.
3150 (rs6000_xcoff64_aix_vec): LIkewise.
3151 * libbfd.c (_bfd_norelocs_set_reloc): New function.
3152 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3153 * i386msdos.c (msdos_set_reloc): Define to
3154 _bfd_norelocs_set_reloc.
3155 * elfcode.h (elf_set_reloc): Define.
3156 * bfd-in2.h: Regenerated.
3158 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
3161 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3162 for IFUNC function address.
3164 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
3166 * elf32-arc.c (FEATURE_LIST_NAME): Define.
3167 (CONFLICT_LIST): Likewise.
3168 (opcode/arc-attrs.h): Include.
3169 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3170 (arc_extract_features): New file.
3171 (arc_stralloc): Likewise.
3172 (arc_elf_merge_attributes): Likewise.
3173 (arc_elf_merge_private_bfd_data): Use object attributes.
3174 (bfd_arc_get_mach_from_attributes): New function.
3175 (arc_elf_object_p): Use object attributes.
3176 (arc_elf_final_write_processing): Likewise.
3177 (elf32_arc_obj_attrs_arg_type): New function.
3178 (elf32_arc_obj_attrs_handle_unknown): Likewise.
3179 (elf32_arc_section_from_shdr): Likewise.
3180 (elf_backend_obj_attrs_vendor): Define.
3181 (elf_backend_obj_attrs_section): Likewise.
3182 (elf_backend_obj_attrs_arg_type): Likewise.
3183 (elf_backend_obj_attrs_section_type): Likewise.
3184 (elf_backend_obj_attrs_handle_unknown): Likewise.
3185 (elf_backend_section_from_shdr): Likewise.
3187 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
3190 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3191 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3192 and the destination is a Thumb symbol.
3194 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3196 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3197 initializer to silence GCC 4.2.
3198 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3200 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3202 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3203 (LAZY_PLT_ENTRY_SIZE): This.
3204 (NON_LAZY_PLT_ENTRY_SIZE): New.
3205 (elf_x86_64_plt0_entry): Renamed to ...
3206 (elf_x86_64_lazy_plt0_entry): This.
3207 (elf_x86_64_plt_entry): Renamed to ...
3208 (elf_x86_64_lazy_plt_entry): This.
3209 (elf_x86_64_bnd_plt0_entry): Renamed to ...
3210 (elf_x86_64_lazy_bnd_plt0_entry): This.
3211 (elf_x86_64_legacy_plt_entry): Removed.
3212 (elf_x86_64_bnd_plt_entry): Renamed to ...
3213 (elf_x86_64_lazy_bnd_plt_entry): This.
3214 (elf_x86_64_legacy_plt2_entry): Renamed to ...
3215 (elf_x86_64_non_lazy_plt_entry): This.
3216 (elf_x86_64_bnd_plt2_entry): Renamed to ...
3217 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3218 (elf_x86_64_eh_frame_plt): Renamed to ...
3219 (elf_x86_64_eh_frame_lazy_plt): This.
3220 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3221 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3222 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3223 (elf_x86_64_eh_frame_non_lazy_plt): This.
3224 (elf_x86_64_lazy_plt_layout): New.
3225 (elf_x86_64_non_lazy_plt_layout): Likewise.
3226 (elf_x86_64_plt_layout): Likewise.
3227 (elf_x86_64_backend_data): Remove PLT layout information. Add
3228 os for target system.
3229 (GET_PLT_ENTRY_SIZE): Removed.
3230 (elf_x86_64_lazy_plt): New.
3231 (elf_x86_64_non_lazy_plt): Likewise.
3232 (elf_x86_64_lazy_bnd_plt): Likewise.
3233 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3234 (elf_x86-64_arch_bed): Updated.
3235 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3236 (elf_x86_64_create_dynamic_sections): Removed.
3237 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3238 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3239 (elf_x86-64_adjust_dynamic_symbol): Updated.
3240 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3241 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3242 size for PLT0 if there is no PLT0. Get plt_entry_size from
3243 non_lazy_plt for non-lazy PLT entries.
3244 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3245 from non_lazy_plt for non-lazy PLT entries.
3246 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3247 if there is no PLT0.
3248 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3249 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3250 entries with non-lazy PLT layout. Don't fill the second and third
3251 slots in the PLT entry if there is no PLT0.
3252 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3253 if there is no PLT0. Set sh_entsize on the .plt.got section.
3254 (compare_relocs): New.
3255 (elf_x86_64_plt_type): Likewise.
3256 (elf_x86_64_plt): Likewise.
3257 (elf_x86_64_nacl_plt): New. Forward declaration.
3258 (elf_x86_64_get_plt_sym_val): Removed.
3259 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3260 against all dynamic relocations.
3261 (elf_x86_64_link_setup_gnu_properties): New function.
3262 (elf_backend_create_dynamic_sections): Updated.
3263 (elf_backend_setup_gnu_properties): New.
3264 (elf_x86_64_nacl_plt): New.
3265 (elf_x86_64_nacl_arch_bed): Updated.
3267 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3269 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3270 (LAZY_PLT_ENTRY_SIZE): This.
3271 (NON_LAZY_PLT_ENTRY_SIZE): New.
3272 (elf_i386_plt0_entry): Renamed to ...
3273 (elf_i386_lazy_plt0_entry): This.
3274 (elf_i386_plt_entry): Renamed to ...
3275 (elf_i386_lazy_plt_entry): This.
3276 (elf_i386_pic_plt0_entry): Renamed to ...
3277 (elf_i386_pic_lazy_plt0_entry): This.
3278 (elf_i386_pic_plt_entry): Renamed to ...
3279 (elf_i386_pic_lazy_plt_entry): This.
3280 (elf_i386_got_plt_entry): Renamed to ...
3281 (elf_i386_non_lazy_plt_entry): This.
3282 (elf_i386_pic_got_plt_entry): Renamed to ...
3283 (elf_i386_pic_non_lazy_plt_entry): This.
3284 (elf_i386_eh_frame_plt): Renamed to ...
3285 (elf_i386_eh_frame_lazy_plt): This.
3286 (elf_i386_eh_frame_plt_got): Renamed to ...
3287 (elf_i386_eh_frame_non_lazy_plt): This.
3288 (elf_i386_plt_layout): Renamed to ...
3289 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3290 eh_frame_plt_got_size.
3291 (elf_i386_non_lazy_plt_layout): New.
3292 (elf_i386_plt_layout): Likewise.
3293 (elf_i386_non_lazy_plt): Likewise.
3294 (GET_PLT_ENTRY_SIZE): Removed.
3295 (elf_i386_plt): Renamed to ...
3296 (elf_i386_lazy_plt): This.
3297 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3298 (elf_i386_arch_bed): Updated.
3299 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3300 (elf_i386_create_dynamic_sections): Removed.
3301 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3302 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3303 (elf_i386_adjust_dynamic_symbol): Updated.
3304 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3305 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3306 size for PLT0 if there is no PLT0.
3307 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3308 output section is discarded only if GOT isn't empty.
3309 (elf_i386_relocate_section): Updated. Properly get PLT index
3310 if there is no PLT0.
3311 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3312 second and third slots in the PLT entry if there is no PLT0.
3313 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3314 if there is no PLT0. Set sh_entsize on the .plt.got section.
3315 (elf_i386_nacl_plt): Forward declaration.
3316 (elf_i386_get_plt_sym_val): Removed.
3317 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3318 against all dynamic relocations.
3319 (elf_i386_link_setup_gnu_properties): New function.
3320 (elf_backend_create_dynamic_sections): Updated.
3321 (elf_backend_setup_gnu_properties): New.
3322 (elf_i386_nacl_plt): Updated.
3323 (elf_i386_nacl_arch_bed): Likewise.
3324 (elf_i386_vxworks_arch_bed): Likewise.
3326 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3328 * elflink.c (elf_output_implib): Remove executable flag from import
3330 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3331 library is a relocatable object file.
3333 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3336 * elf32-avr.c (avr_should_move_sym): New function.
3337 (avr_should_reduce_sym_size): Likewise.
3338 (avr_should_increase_sym_size): Likewise.
3339 (elf32_avr_relax_delete_bytes): Adjust symbol values
3340 and sizes by calling new functions.
3342 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3344 * config.bfd (riscv32-*): Enable rv64.
3346 2017-05-02 Alan Modra <amodra@gmail.com>
3349 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3350 rather than h->root.type == bfd_link_hash_new.
3351 (bfd_elf_record_link_assignment): Similarly, call
3352 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3354 2017-04-29 Alan Modra <amodra@gmail.com>
3357 * reloc.c (reloc_offset_in_range): New function.
3358 (bfd_perform_relocation, bfd_install_relocation): Use it.
3359 (_bfd_final_link_relocate): Likewise.
3361 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3363 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3364 before using .plt.got.
3365 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3367 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3369 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3370 instead of "+=" to update 0.
3372 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3374 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3375 .plt.got section here.
3376 (elf_i386_check_relocs): Don't create the .plt.got section.
3377 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3378 the .plt.got and .plt.bnd sections here.
3379 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3382 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3384 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3386 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3387 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3388 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3389 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3392 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3394 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3396 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3397 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3398 the first relocatable ELF input with GNU properties.
3400 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3402 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3403 VxWorks for non-PIC.
3405 2017-04-27 Alan Modra <amodra@gmail.com>
3407 * elf-bfd.h (struct elf_backend_data): Make asection param of
3408 elf_backend_eh_frame_address_size const.
3409 (_bfd_elf_eh_frame_address_size): Likewise.
3410 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3411 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3412 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3413 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3414 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3415 (next_cie_fde_offset): Constify params.
3416 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3418 2017-04-27 Alan Modra <amodra@gmail.com>
3420 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3421 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3422 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3424 (offset_adjust): New function.
3425 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3426 (adjust_eh_frame_local_symbols): Likewise.
3427 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3428 after changing anything. Return true if anything changed.
3429 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3430 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3432 2017-04-27 Alan Modra <amodra@gmail.com>
3434 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3437 2017-04-27 Alan Modra <amodra@gmail.com>
3439 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3440 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3441 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3442 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3443 for undef and undefweak dyn_relocs.
3444 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3445 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3446 (allocate_got, allocate_dynrelocs): Likewise.
3447 (ppc64_elf_relocate_section): Likewise.
3449 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3451 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3452 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3453 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3454 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3456 2017-04-26 Nick Clifton <nickc@redhat.com>
3459 * reloc.c (bfd_perform_relocation): Check for a negative address
3462 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3465 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3467 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3468 (elf_backend_always_renumber_dynsyms): Define.
3469 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3470 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3471 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3472 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3474 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3476 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3478 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3479 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3480 sections have been created.
3482 2017-04-26 Nick Clifton <nickc@redhat.com>
3485 * compress.c (bfd_init_section_compress_status): Check the return
3486 value from bfd_malloc.
3488 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3490 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3491 no_finish_dynamic_symbol.
3492 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3494 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3495 weak symbol, don't make it dynamic.
3496 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3497 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3498 relocation for GOT reference.
3499 (elf_x86_64_finish_dynamic_symbol): Abort if
3500 no_finish_dynamic_symbol isn't 0.
3502 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3505 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3506 undefined weak symbol, don't make it dynamic.
3507 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3508 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3509 relocation for R_386_GOT32.
3511 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3514 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3516 2017-04-23 Alan Modra <amodra@gmail.com>
3519 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3520 * elf.c (lcomm_sym): New.
3521 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3522 * bfd-in2.h: Regenerate.
3524 2017-04-23 Alan Modra <amodra@gmail.com>
3527 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3528 parameters and comment.
3529 (_bfd_elf_get_reloc_section): Delete.
3530 (_bfd_elf_plt_get_reloc_section): Declare.
3531 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3532 New functions. Don't blindly skip over assumed .rel/.rela prefix.
3534 (_bfd_elf_get_reloc_section): ..here. Delete.
3535 (assign_section_numbers): Call elf_get_reloc_section.
3536 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
3537 * elfxx-target.h (elf_backend_get_reloc_section): Update.
3539 2017-04-23 Alan Modra <amodra@gmail.com>
3542 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
3545 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3548 * elf32-i386.c (elf_i386_link_hash_entry): Add
3549 no_finish_dynamic_symbol.
3550 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
3551 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
3552 symbol, don't make it dynamic in PIE.
3553 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
3554 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3555 relocation for R_386_GOT32
3556 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
3559 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3563 * elflink.c (elf_link_add_object_symbols): Require
3564 --no-dynamic-linker with -E/--dynamic-list when creating
3567 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3569 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
3572 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3574 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
3575 dynamic symbol sorting.
3577 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
3580 * elflink.c (elf_link_add_object_symbols): Preserve
3581 dynamic_ref_after_ir_def when restoring the symbol table for
3582 unneeded dynamic object.
3584 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
3587 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
3588 on on undefined IFUNC symbol in the second PLT.
3590 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
3592 * peXXigen.c (pe_print_reloc): Correct chunk_end.
3594 2017-04-19 Alan Modra <amodra@gmail.com>
3596 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
3597 or make dynamic for info->dynamic_undefined_weak 0 and 1.
3598 * elf32-ppc.c:Formatting.
3599 (ensure_undefweak_dynamic): Don't make dynamic when
3600 info->dynamic_undefined_weak is zero.
3601 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3602 info->dynamic_undefined_weak. Discard undef dyn_relocs when
3603 not default visibility. Discard undef and undefweak
3605 (ppc_elf_relocate_section): Adjust to suit.
3606 * elf64-ppc.c: Formatting.
3607 (ensure_undefweak_dynamic): Don't make dynamic when
3608 info->dynamic_undefined_weak is zero.
3609 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3610 info->dynamic_undefined_weak. Discard them earlier.
3612 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
3615 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
3616 before generating the version definition section.
3618 2017-04-17 Alan Modra <amodra@gmail.com>
3620 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
3621 state when a regular object file defines a symbol with
3622 incompatible type to that defined by an earlier shared lib.
3624 2017-04-13 Alan Modra <amodra@gmail.com>
3626 * coffcode.h: Wrap some overly long _bfd_error_handler args.
3628 * elf32-arm.c: Likewise.
3629 * elf32-i386.c: Likewise.
3630 * elf32-mep.c: Likewise.
3631 * elf64-ia64-vms.c: Likewise.
3632 * elf64-x86-64.c: Likewise.
3633 * elflink.c: Likewise.
3634 * elfnn-ia64.c: Likewise.
3635 * elfxx-mips.c: Likewise.
3637 2017-04-13 Alan Modra <amodra@gmail.com>
3639 * aoutx.h: Use %B and %A in error messages throughout file.
3640 * aout-cris.c: Likewise.
3641 * archive.c: Likewise.
3642 * binary.c: Likewise.
3643 * coff-rs6000.c: Likewise.
3644 * coff-tic4x.c: Likewise.
3645 * coffcode.h: Likewise.
3646 * coffgen.c: Likewise.
3647 * cofflink.c: Likewise.
3648 * coffswap.h: Likewise.
3649 * cpu-arm.c: Likewise.
3650 * elf-eh-frame.c: Likewise.
3651 * elf-m10300.c: Likewise.
3653 * elf32-arc.c: Likewise.
3654 * elf32-arm.c: Likewise.
3655 * elf32-bfin.c: Likewise.
3656 * elf32-frv.c: Likewise.
3657 * elf32-iq2000.c: Likewise.
3658 * elf32-m32c.c: Likewise.
3659 * elf32-microblaze.c: Likewise.
3660 * elf32-nds32.c: Likewise.
3661 * elf32-rl78.c: Likewise.
3662 * elf32-rx.c: Likewise.
3663 * elf32-score.c: Likewise.
3664 * elf32-score7.c: Likewise.
3665 * elf32-sh64.c: Likewise.
3666 * elf32-v850.c: Likewise.
3667 * elf32-vax.c: Likewise.
3668 * elf32-visium.c: Likewise.
3669 * elf64-ia64-vms.c: Likewise.
3670 * elf64-mmix.c: Likewise.
3671 * elf64-sh64.c: Likewise.
3672 * elfcode.h: Likewise.
3673 * elfnn-aarch64.c: Likewise.
3674 * elfnn-ia64.c: Likewise.
3675 * elfxx-mips.c: Likewise.
3676 * hpux-core.c: Likewise.
3679 * linker.c: Likewise.
3680 * merge.c: Likewise.
3682 * oasys.c: Likewise.
3683 * pdp11.c: Likewise.
3684 * peXXigen.c: Likewise.
3685 * rs6000-core.c: Likewise.
3686 * vms-alpha.c: Likewise.
3687 * xcofflink.c: Likewise.
3689 2017-04-13 Alan Modra <amodra@gmail.com>
3691 * bfd.c (PRINT_TYPE): Define.
3692 (_doprnt): New function.
3693 (error_handler_internal): Use _doprnt.
3694 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
3695 calls in their natural order, throughout file.
3696 * coff-mcore.c: Likewise.
3697 * coff-ppc.c: Likewise.
3698 * coff-tic80.c: Likewise.
3699 * cofflink.c: Likewise.
3700 * elf-s390-common.c: Likewise.
3702 * elf32-arm.c: Likewise.
3703 * elf32-i386.c: Likewise.
3704 * elf32-m32r.c: Likewise.
3705 * elf32-msp430.c: Likewise.
3706 * elf32-spu.c: Likewise.
3707 * elf64-ia64-vms.c: Likewise.
3708 * elf64-sparc.c: Likewise.
3709 * elf64-x86-64.c: Likewise.
3710 * elflink.c: Likewise.
3711 * elfnn-aarch64.c: Likewise.
3712 * elfnn-ia64.c: Likewise.
3713 * elfxx-mips.c: Likewise.
3715 2017-04-13 Alan Modra <amodra@gmail.com>
3717 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
3718 branch veneers" error. Fix double space and format message.
3719 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
3720 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
3722 2017-04-13 Alan Modra <amodra@gmail.com>
3724 * bfd-in2.h: Regenerate.
3726 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3728 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
3729 extra `\n' in warning/error messages.
3730 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
3731 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3733 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3735 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
3736 processor-specific properties with generic ELF target vector.
3738 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
3740 * elf32-sparc.c (elf_backend_fixup_symbol): New.
3741 * elf64-sparc.c (elf_backend_fixup_symbol): New.
3742 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
3743 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
3745 (link_hash_newfunc): Initialize has_got_reloc and
3747 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
3749 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
3751 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
3753 (_bfd_sparc_elf_fixup_symbol): New function.
3754 (allocate_dynrelocs): Don't allocate space for dynamic
3755 relocations and discard relocations against resolved undefined
3756 weak symbols in executable. Don't make resolved undefined weak
3757 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
3758 relocation against undefined weak symbols in PIE.
3759 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
3760 relocations against resolved undefined weak symbols in PIE
3761 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
3762 without ynamic PLT/GOT relocations for resolved undefined weak
3764 Don't generate dynamic relocation against resolved undefined
3765 weak symbol in executable.
3766 (pie_finish_undefweak_symbol): New function.
3767 (_bfd_sparc_elf_finish_dynamic_sections): Call
3768 pie_finish_undefweak_symbol on all symbols in PIE.
3769 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
3770 (_bfd_sparc_elf_fixup_symbol): New function.
3772 2017-04-10 Nick Clifton <nickc@redhat.com>
3774 * config.bfd: Remove ns32k from obsolete list.
3776 2017-04-10 Alan Modra <amodra@gmail.com>
3779 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
3780 (special_sections_i): Likewise for .init_array.
3781 (special_sections_p): Likewise for .preinit_array.
3783 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
3787 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
3788 ELF_COMMON_DEF_P for common symbols.
3789 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3790 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
3791 * elflink.c (_bfd_elf_merge_symbol): Revert commits
3792 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
3793 07492f668d2173da7a2bda3707ff0985e0f460b6.
3795 2017-04-07 Pedro Alves <palves@redhat.com>
3797 * opncls.c (bfd_get_debug_link_info): Rename to...
3798 (bfd_get_debug_link_info_1): ... this. Change type of second
3799 parameter to void pointer. Adjust.
3800 (bfd_get_debug_link_info): Reimplement on top of
3801 bfd_get_debug_link_info_1.
3802 (separate_debug_file_exists, separate_alt_debug_file_exists):
3803 Change type of second parameter to void pointer. Adjust.
3804 (get_func_type, check_func_type): Change type of second parameter
3806 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
3807 the callback functions instead of passing the address of a local.
3808 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
3809 find_separate_debug_file.
3810 (get_alt_debug_link_info_shim): Change type of second parameter to
3811 void pointer. Adjust.
3812 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
3813 find_separate_debug_file.
3814 (get_build_id_name, bfd_boolean check_build_id_file): Change type
3815 of second parameter to void pointer. Adjust.
3816 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
3817 pointer local to find_separate_debug_file.
3819 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
3821 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
3822 external symbols with a definition.
3823 (_bfd_coff_gc_mark_extra_sections): Fix typo.
3825 2017-04-07 Alan Modra <amodra@gmail.com>
3827 * po/SRC-POTFILES.in: Regenerate.
3829 2017-04-05 Alan Modra <amodra@gmail.com>
3831 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
3834 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
3836 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
3837 numbers for DataDirectory entry indicies passed to
3840 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
3842 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
3843 each GNU_MBIND section and align GNU_MBIND section to page size.
3844 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
3845 segment for each GNU_MBIND section.
3846 (_bfd_elf_init_private_section_data): Copy sh_info from input
3847 for GNU_MBIND section.
3849 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
3851 * elfnn-riscv.c (GP_NAME): Delete.
3852 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
3853 (_bfd_riscv_relax_lui): Likewise.
3855 2017-04-04 Nick Clifton <nickc@redhat.com>
3858 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
3860 (bfd_elf_final_link): Only initialize the extended symbol index
3861 section if there are extended symbol tables to list.
3863 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
3865 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
3866 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
3867 * configure.ac (elf): Add elf-properties.lo.
3868 * Makefile.in: Regenerated.
3869 * configure: Likewise.
3870 * elf-bfd.h (elf_property_kind): New.
3871 (elf_property): Likewise.
3872 (elf_property_list): Likewise.
3873 (elf_properties): Likewise.
3874 (_bfd_elf_parse_gnu_properties): Likewise.
3875 (_bfd_elf_get_property): Likewise.
3876 (_bfd_elf_link_setup_gnu_properties): Likewise.
3877 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
3878 and setup_gnu_properties.
3879 (elf_obj_tdata): Add properties.
3880 * elf-properties.c: New file.
3881 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
3882 (elf_i386_merge_gnu_properties): Likewise.
3883 (elf_backend_parse_gnu_properties): Likewise.
3884 (elf_backend_merge_gnu_properties): Likewise.
3885 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3886 (elf_x86_64_merge_gnu_properties): Likewise.
3887 (elf_backend_parse_gnu_properties): Likewise.
3888 (elf_backend_merge_gnu_properties): Likewise.
3889 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
3890 (elf_backend_parse_gnu_properties): Likewise.
3891 (elf_backend_setup_gnu_properties): Likewise.
3892 (elfNN_bed): Add elf_backend_parse_gnu_properties,
3893 elf_backend_merge_gnu_properties and
3894 elf_backend_setup_gnu_properties.
3896 2017-03-30 Pip Cet <pipcet@gmail.com>
3898 * elf32-wasm32.c: Add relocation code, two relocs.
3899 * reloc.c: Add wasm32 relocations.
3900 * libbfd.h: Regenerate.
3901 * bfd-in2.h: Regenerate.
3902 * bfd/po/bfd.pot: Regenerate.
3904 2017-03-29 Nick Clifton <nickc@redhat.com>
3907 * coff-bfd.h (struct coff_section_data): Add new fields:
3908 saved_bias and bias.
3909 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
3910 computed for PE binaries.
3911 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
3914 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
3917 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
3918 to handle a local symbol with a hash-symbol-entry; without PLT.
3919 Add BFD_ASSERT for an incidental case with GOT entry present.
3920 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
3921 isn't forced-or-set local.
3923 2017-03-27 Pip Cet <pipcet@gmail.com>
3925 * wasm-module.c: New file to support WebAssembly modules.
3926 * wasm-module.h: New file to support WebAssembly modules.
3927 * doc/webassembly.texi: Start documenting wasm-module.c.
3928 * config.bfd: Add wasm_vec.
3929 * targets.c: Likewise.
3930 * configure.ac: Likewise.
3931 * Makefile.am: Add entries for wasm-module.c.
3932 * Makefile.in: Regenerate.
3933 * configure: Regenerate.
3934 * po/SRC-POTFILES.in: Regenerate.
3936 2017-03-27 Pip Cet <pipcet@gmail.com>
3938 * cpu-wasm32.c: New file to support wasm32 architecture.
3939 * elf32-wasm32.c: New file to support wasm32 architecture.
3940 * Makefile.am: Add wasm32 architecture.
3941 * archures.c: Likewise.
3942 * config.bfd: Likewise.
3943 * configure.ac: Likewise.
3944 * targets.c: Likewise.
3945 * Makefile.in: Regenerate.
3946 * bfd-in2.h: Regenerate.
3947 * configure: Regenerate.
3948 * po/SRC-POTFILES.in: Regenerate.
3950 2017-03-20 Alan Modra <amodra@gmail.com>
3953 * elf64-ppc.c (compare_symbols): Stabilize sort.
3955 2017-03-18 Alan Modra <amodra@gmail.com>
3957 * elf64-ppc.c (struct ppc_link_hash_table): Add
3958 local_ifunc_resolver and maybe_local_ifunc_resolver.
3959 (ppc_build_one_stub): Set flags on emitting dynamic
3960 relocation to ifunc.
3961 (ppc64_elf_relocate_section): Likewise.
3962 (ppc64_elf_finish_dynamic_symbol): Likewise.
3963 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
3964 local dynamic relocs to ifuncs.
3965 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
3966 local_ifunc_resolver and maybe_local_ifunc_resolver.
3967 (ppc_elf_relocate_section): Set flag on emitting dynamic
3968 relocation to ifuncs.
3969 (ppc_elf_finish_dynamic_symbol): Likewise.
3970 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
3971 dynamic relocs to ifuncs.
3973 2017-03-13 Nick Clifton <nickc@redhat.com>
3976 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
3977 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
3978 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
3979 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
3980 * bfd-in2.h: Regenerate.
3981 * libbfd.h: Regenerate.
3982 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
3984 (IS_AARCH64_TLSDESC_RELOC): Likewise.
3985 (elfNN_aarch64_howto_table): Likewise.
3986 (aarch64_tls_transition_without_check): Likewise.
3987 (aarch64_reloc_got_type): Likewise.
3988 (elfNN_aarch64_final_link_relocate): Likewise.
3989 (elfNN_aarch64_tls_relax): Likewise.
3990 (elfNN_aarch64_relocate_section): Likewise.
3991 (elfNN_aarch64_gc_sweep_hook): Likewise.
3992 (elfNN_aarch64_check_relocs): Likewise.
3993 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3994 (_bfd_aarch64_elf_resolve_relocation): Likewise.
3996 2017-03-11 Alan Modra <amodra@gmail.com>
3998 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
3999 parameter is in fact used. Whitespace fixes.
4000 * elf64-ppc.c: Likewise.
4002 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4004 * rs6000-core.c (CORE_NEW): Simplify macro when
4005 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4007 2017-03-07 Alan Modra <amodra@gmail.com>
4011 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4014 2017-03-05 Alan Modra <amodra@gmail.com>
4016 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4017 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4018 (next_cie_fde_offset): New function.
4019 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4020 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4021 four bytes. Align CIEs to four or eight bytes depending on
4022 per_encoding_aligned8. Align FDEs according to their encoding.
4023 Pad last FDE to output section alignment.
4024 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4026 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4027 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4028 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4030 2017-03-02 Martin Bickel <binutils@ineranves.de>
4033 * elf.c (rewrite_elf_program_header): Do not issue a warning for
4034 empty segments which have a zero filesz, but a non-zero memsz.
4036 2017-03-02 Alan Modra <amodra@gmail.com>
4038 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4040 2017-02-28 Alan Modra <amodra@gmail.com>
4042 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4043 (ppc64_elf_relocate_section): Likewise.
4045 2017-02-28 Alan Modra <amodra@gmail.com>
4048 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4049 rather than elf32_nios2_hash_table or elf_hash_table.
4050 (create_got_section): Likewise.
4051 (nios2_elf32_finish_dynamic_symbol): Likewise.
4052 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4053 (nios2_elf32_size_dynamic_sections): Likewise.
4054 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4055 vars. Use htab equivalents directly instead. Don't create
4056 all dynamic sections on needing just the GOT. Use a goto
4057 rather than a fall-through with reloc test. Ensure
4058 htab->dynobj is set when making dynamic sreloc section.
4059 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4060 equivalent directly instead. Don't segfault on looking for
4061 .dynamic when dynamic sections have not been created. Don't
4062 segfault on .got.plt being discarded.
4063 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4064 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4065 fixme and another not so relevant comment.
4066 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4067 already set, set hash table dynobj on creating .sbss.
4069 2017-02-28 Alan Modra <amodra@gmail.com>
4071 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4072 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4073 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4074 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4075 (ppc64_elf_relocate_section): Likewise.
4076 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4077 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4078 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4079 * libbfd.h: Regenerate.
4080 * bfd-in2.h: Regenerate.
4082 2017-02-28 Alan Modra <amodra@gmail.com>
4084 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4085 dynamic .data.rel.ro read-only.
4086 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4087 rather than section flags when deciding where copy reloc goes.
4088 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4089 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4090 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4091 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4092 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4093 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4094 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4095 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4096 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4097 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4098 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4099 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4100 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4101 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4102 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4103 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4104 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4105 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4106 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4108 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4110 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4111 `jalr $0, $25' instruction encoding.
4113 2017-02-27 Nick Clifton <nickc@redhat.com>
4116 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4117 generating a seg-fault when encountering a symbol that has been
4118 deleted by garbage collection.
4120 2017-02-25 Alan Modra <amodra@gmail.com>
4122 * elf32-arc.c (struct dynamic_sections): Delete.
4123 (enum dyn_section_types): Delete.
4124 (dyn_section_names): Delete.
4125 (arc_create_dynamic_sections): Delete.
4126 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
4127 segfault on discarded .rela.plt section.
4128 (elf_arc_size_dynamic_sections): Formatting. Don't call
4129 arc_create_dynamic_sections. Don't allocate memory for sections
4130 handled by the generic linker. Correct code finding relocs in
4131 read-only sections. Set SEC_EXCLUDE on zero size .got,
4132 .got.plt, and .dynbss sections. Do set .interp for pies.
4134 2017-02-24 Andrew Waterman <andrew@sifive.com>
4136 * elfnn-riscv.c (GP_NAME): New macro.
4137 (riscv_global_pointer_value): Use it.
4138 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4139 output section, consider only that section's alignment.
4141 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4143 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4144 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4145 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4146 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4148 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4150 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4151 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4154 2017-02-23 Alan Modra <amodra@gmail.com>
4157 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4159 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4160 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4163 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
4166 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4167 processing ahead of the call to `elf_gc_sweep_symbol'.
4169 2017-02-22 Nick Clifton <nickc@redhat.com>
4172 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4173 created section 4-byte alignment.
4175 2017-02-22 Alan Modra <amodra@gmail.com>
4177 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4178 on .got or .plt output section being discarded by script.
4179 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
4182 2017-02-21 Alan Modra <amodra@gmail.com>
4184 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4185 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4187 2017-02-20 Alan Modra <amodra@gmail.com>
4190 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4191 if DT_RELSZ/DT_RELASZ is zero.
4193 2017-02-17 Nick Clifton <nickc@redhat.com>
4195 * compress.c (bfd_get_full_section_contents): Remember to reduce
4196 compressed size by the sizeof the compression header when
4197 decompressing the contents.
4199 2017-02-17 Pedro Alves <palves@redhat.com>
4201 * srec.c (Chunk): Rename to ...
4202 (_bfd_srec_len): ... this.
4203 (S3Forced): Rename to ...
4204 (_bfd_srec_forceS3): ... this.
4205 * objcopy.c: Adjust all references.
4207 2017-02-17 Pedro Alves <palves@redhat.com>
4209 * archive.c (bsd_write_armap): Rename to ...
4210 (_bfd_bsd_write_armap): ... this.
4211 (coff_write_armap): Rename to ...
4212 (_bfd_coff_write_armap): ... this.
4213 * libbfd-in.h (bsd_write_armap): Rename to ...
4214 (_bfd_bsd_write_armap): ... this.
4215 (coff_write_armap): Rename to ...
4216 (_bfd_coff_write_armap): ... this.
4217 * aout-target.h, aout-tic30.c: Adjust all users.
4218 * libbfd.h: Regenerate.
4220 2017-02-17 Pedro Alves <palves@redhat.com>
4222 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4223 (warn_deprecated): Rename to ...
4224 (_bfd_warn_deprecated): ... this.
4225 * libbfd.c (warn_deprecated): Rename to ...
4226 (_bfd_warn_deprecated): ... this.
4227 * bfd-in2.h: Regenerate.
4229 2017-02-17 Pedro Alves <palves@redhat.com>
4231 * bfdio.c (real_ftell): Rename to ...
4232 (_bfd_real_ftell): ... this.
4233 (real_fseek): Rename to ...
4234 (_bfd_real_fseek): ... this.
4235 (real_fopen): Rename to ...
4236 (_bfd_real_fopen): ... this.
4237 * libbfd-in.h (real_ftell): Rename to ...
4238 (_bfd_real_ftell): ... this.
4239 (real_fseek): Rename to ...
4240 (_bfd_real_fseek): ... this.
4241 (real_fopen): Rename to ...
4242 (_bfd_real_fopen): ... this.
4243 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4244 * libbfd.h: Regenerate.
4246 2017-02-17 Pedro Alves <palves@redhat.com>
4248 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4249 * libbfd.c (read_unsigned_leb128): Rename to ...
4250 (_bfd_read_unsigned_leb128): ... this.
4251 (read_signed_leb128): Rename to ...
4252 (_bfd_read_signed_leb128): ... this.
4253 (safe_read_leb128): Rename to ...
4254 (_bfd_safe_read_leb128): ... this.
4255 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4256 (_bfd_read_unsigned_leb128): ... this.
4257 (read_signed_leb128): Rename to ...
4258 (_bfd_read_signed_leb128): ... this.
4259 (safe_read_leb128): Rename to ...
4260 (_bfd_safe_read_leb128): ... this.
4261 * libbfd.h: Renegerate.
4263 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4265 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4266 before trying to fine matching file and line information.
4268 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4270 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4271 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4272 not match current bfd, then reload debug information. Record bfd
4273 we're loading debug info for in the stash. If we have debug
4274 informatin in the cache then perform section placement before
4277 2017-02-16 Alan Modra <amodra@gmail.com>
4280 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4281 * elfxx-target.h (elf_backend_no_page_alias): Define.
4282 (elfNN_bed): Init new field.
4283 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4284 ensure PT_LOAD segment starts on a new page.
4285 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4287 2017-02-16 Alan Modra <amodra@gmail.com>
4290 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4293 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4295 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4296 * bfd-in2.h: Regenerated.
4298 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4301 * elf32-i386.c (elf_i386_relocate_section): Allow
4302 "lea foo@GOT, %reg" in PIC.
4304 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4307 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4308 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4309 error against local IFUNC symbol without a base register for
4312 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4314 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4315 `%P: %H:' with `info->callbacks->einfo'.
4316 (ppc_elf_relocate_section): Likewise.
4317 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4318 (ppc64_elf_edit_toc): Likewise.
4319 (ppc64_elf_relocate_section): Likewise.
4321 2017-02-14 Alan Modra <amodra@gmail.com>
4323 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4324 --gc-keep-exported, and test versioned field of sym rather than
4325 looking for @ in name.
4327 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4329 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4332 2017-02-13 Nick Clifton <nickc@redhat.com>
4335 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4338 2017-02-07 Andrew Waterman <andrew@sifive.com>
4340 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4341 entry size if PLT header is written.
4343 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4345 Fix sparc64 dynamic relocation processing to use the dynamic
4347 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4348 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4351 2017-02-03 Nick Clifton <nickc@redhat.com>
4354 * coffcode.h (coff_write_object_contents): Enlarge size of
4355 s_name_buf in order to avoid compile time warning about possible
4357 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4358 32-bits of insn value before printing into buffer.
4360 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4362 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4363 `max_local_dynindx'.
4364 (mips_elf_sort_hash_table): Handle it.
4365 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4366 symbols bump up `max_local_dynindx' rather than
4367 `max_non_got_dynindx'.
4369 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4371 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4372 `min_got_dynindx', `max_unref_got_dynindx' and
4373 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4374 (mips_elf_sort_hash_table): Adjust accordingly.
4376 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4378 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4379 to access the hash table.
4381 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4383 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4384 non-NULL `htab' to the beginning.
4386 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4388 * elflink.c (elf_gc_sweep): Wrap overlong line.
4390 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4392 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4393 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4394 * elfxx-mips.c (mips_elf_link_hash_table): Add
4395 `ignore_branch_isa' member.
4396 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4397 in branch relocation calculation as an error if
4398 `ignore_branch_isa' has been set.
4399 (_bfd_mips_elf_insn32): Rename to...
4400 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4401 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4402 Handle the new parameter.
4404 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4406 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4407 local variable dynobj.
4410 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4411 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4412 executable from read-only sections into sdynrelro.
4413 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4414 dynamic relocs in sdynrelro.
4415 (elf_backend_want_dynrelro): Define.
4417 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4419 * config.bfd (*-*-rtemsaout*): Mark as removed.
4421 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4423 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4424 (arm-*-rtems*): Move to (arm*-*-eabi*).
4425 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4426 (m68-*-rtems*): Move to (m68*-*-elf*).
4428 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4430 * config.bfd (*-*-rtemscoff*): Mark as removed.
4432 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4435 * elflink.c (bfd_elf_record_link_assignment): Revert last
4436 change and don't ever clear `forced_local'. Set `mark'
4438 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4440 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4441 (bfd_elf_size_dynamic_sections): ... here.
4442 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4443 and set `mark' instead in `__tls_get_addr_opt' processing.
4444 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4446 2017-01-24 Alan Modra <amodra@gmail.com>
4448 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4449 where dynamic relocs are preferable. Allow ifunc too.
4450 (ensure_undefweak_dynamic): New function.
4451 (allocate_dynrelocs): Use it here. Move plt handling last and
4452 don't make symbols dynamic, simplifying loop. Only make undef
4453 weak symbols with GOT entries dynamic. Correct condition
4454 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4455 comments. Remove goto.
4456 (ppc_elf_relocate_section): Correct test for using dynamic
4457 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4458 to suit. Set up explicit tls_index entries and implicit GOT
4459 tls_index entries resolvable at link time for
4460 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4461 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4462 (ensure_undefweak_dynamic): New function.
4463 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4464 with GOT entries dynamic. Remove unnecessary test of
4465 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4466 (ppc64_elf_relocate_section): Correct test for using dynamic
4467 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4468 to suit. Set up explicit tls_index entries and implicit GOT
4469 tls_index entries resolvable at link time for __tls_get_addr_opt.
4470 Simplify expression to clear mem for prelink.
4472 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4474 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4476 2017-01-20 Jiong Wang <jiong.wang@arm.com>
4478 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4479 (elf_backend_hash_symbol): Define.
4481 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4484 * elflink.c (bfd_elf_record_link_assignment): Clear any
4485 `forced_local' marking for DSO symbols that are not being
4488 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4490 * elfnn-riscv.c (riscv_elf_object_p): New function.
4492 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4495 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4497 (elf_x86_64_check_relocs): Create .eh_frame section for the
4499 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4500 .eh_frame section for the .plt.bnd section.
4501 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4502 for the .plt.bnd section.
4504 2017-01-12 Nick Clifton <nickc@redhat.com>
4507 * opncls.c (find_separate_debug_file): Add include_dirs
4508 parameter. Only include the directory part of the bfd's filename
4509 in search paths if include_dirs is true. Add a couple of extra
4510 locations for looking for debug files.
4511 ( bfd_follow_gnu_debuglink): Update invocation of
4512 find_separate_debug_file.
4513 (bfd_follow_gnu_debugaltlink): Likewise.
4514 (get_build_id): New function: Finds the build-id of the given bfd.
4515 (get_build_id_name): New function: Computes the name of the
4516 separate debug info file for a bfd, based upon its build-id.
4517 (check_build_id_file): New function: Checks to see if a separate
4518 debug info file exists at the given location, and that its
4519 build-id matches that of the original bfd.
4520 (bfd_follow_build_id_debuglink): New function: Finds a separate
4521 debug info file for a given bfd by using the build-id method.
4522 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4523 method of locating a separate debug info file before using the
4525 * bfd-in2.h: Regenerate.
4527 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
4530 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4531 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4532 elf_x86_64_eh_frame_plt_got.
4533 (elf_x86_64_size_dynamic_sections): Get unwind info from
4534 elf_x86_64_bnd_arch_bed for the BND PLT.
4536 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
4538 * config.bfd: Add entries for i686-redox and x86_64-redox.
4540 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4542 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
4544 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
4545 .eh_frame section to 4 bytes for x32.
4546 (elf_x86_64_check_relocs): Likewise.
4548 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4551 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
4552 (PLT_GOT_FDE_LENGTH): Likewise.
4553 (elf_i386_plt_layout): Add eh_frame_plt_got and
4554 eh_frame_plt_got_size.
4555 (elf_i386_plt): Updated.
4556 (elf_i386_link_hash_table): Add plt_got_eh_frame.
4557 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
4558 (elf_i386_size_dynamic_sections): Allocate and initialize
4559 .eh_frame section for .plt.got.
4560 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
4562 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
4563 eh_frame_plt_got_size.
4564 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
4565 (PLT_GOT_FDE_LENGTH): Likewise.
4566 (elf_x86_64_backend_data): Add eh_frame_plt_got and
4567 eh_frame_plt_got_size.
4568 (elf_x86_64_arch_bed): Updated.
4569 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
4570 eh_frame_plt_got_size.
4571 (elf_x86_64_nacl_arch_bed): Likewise.
4572 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
4573 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
4574 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4575 .eh_frame section for .plt.got.
4576 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4579 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4581 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
4582 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
4584 2017-01-09 Nick Clifton <nickc@redhat.com>
4586 * dwarf2.c (lookup_address_in_function_table): Return early if
4587 there are no functions in the given comp unit, or if the high
4588 address of the last function in the comp unit is less than the
4591 2017-01-09 Nick Clifton <nickc@redhat.com>
4594 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
4595 message if there are too many symbols to load.
4597 2017-01-04 James Clarke <jrtc27@jrtc27.com>
4599 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
4600 if relocs are cached.
4602 2017-01-03 Rich Felker <bugdal@aerifal.cx>
4605 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
4606 for R_MICROBLAZE_GOTOFF_64.
4608 2017-01-03 Nick Clifton <nickc@redhat.com>
4610 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
4611 warning about using a possibly uninitialised variable.
4613 2017-01-02 Alan Modra <amodra@gmail.com>
4615 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
4616 (allocate_plt_static, allocate_dynrelocs): Use it.
4618 2017-01-02 Alan Modra <amodra@gmail.com>
4620 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
4621 .PARISC.unwind section.
4623 2017-01-02 Alan Modra <amodra@gmail.com>
4626 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
4627 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
4628 indirect to GOT pointer relative code edit.
4630 2017-01-02 Alan Modra <amodra@gmail.com>
4632 Update year range in copyright notice of all files.
4634 For older changes see ChangeLog-2016
4636 Copyright (C) 2017 Free Software Foundation, Inc.
4638 Copying and distribution of this file, with or without modification,
4639 are permitted in any medium without royalty provided the copyright
4640 notice and this notice are preserved.
4646 version-control: never