1 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
3 * elf32-i386.c (elf_i386_backend_data): Removed.
4 (get_elf_i386_backend_data): Likewise.
5 (elf_i386_arch_bed): Replace elf_i386_backend_data with
7 (elf_i386_get_synthetic_symtab): Likewise.
8 (elf_i386_nacl_arch_bed): Likewise.
9 (elf_i386_vxworks_arch_bed): Likewise.
10 (elf_i386_relocate_section): Check target_os instead of
12 (elf_i386_finish_dynamic_symbol): Likewise.
13 (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
14 Check target_os instead of is_vxworks.
15 (elf_i386_link_setup_gnu_properties): Remove normal_target and
16 is_vxworks. Initialize plt0_pad_byte.
17 * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
18 (get_elf_x86_64_arch_data): Likewise.
19 (get_elf_x86_64_backend_data): Likewise.
20 (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
22 (elf_x86_64_get_synthetic_symtab): Likewise.
23 (elf_x86_64_nacl_arch_bed): Likewise.
24 (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
25 normal_target. Initialize plt0_pad_byte.
26 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
27 instead of is_vxworks.
28 (_bfd_x86_elf_size_dynamic_sections): Likewise.
29 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
30 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
31 (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
32 (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
33 Update normal_target. Set up plt0_pad_byte. Check target_os
34 instead of is_vxworks.
35 * elfxx-x86.h (elf_x86_target_os): New.
36 (elf_x86_backend_data): Likewise.
37 (get_elf_x86_backend_data): Likewise.
38 (elf_x86_link_hash_table): Remove is_vxworks. Add plt0_pad_byte
40 (elf_x86_init_table): Remove normal_target and is_vxworks. Add
43 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
45 * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
46 _bfd_x86_elf_finish_dynamic_sections.
47 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
48 * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
50 * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
53 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
56 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
57 hide symbol which was forced to be dynamic.
59 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
62 * elf32-cris.c (cris_elf_relocate_section): Don't generate
63 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
64 (cris_elf_check_relocs): Don't allocate dynamic relocation
65 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
67 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
70 * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
71 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
72 (sh_elf_relocate_section): Don't generate dynamic relocation if
73 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
75 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
78 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
79 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
80 (elf_s390_relocate_section): Don't generate dynamic relocation
81 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
82 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
83 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
84 (elf_s390_relocate_section): Don't generate dynamic relocation
85 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
87 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
90 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
91 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
92 (allocate_dynrelocs): Discard dynamic relocations if
93 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
95 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
98 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
99 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
101 (allocate_dynrelocs): Discard dynamic relocations if
102 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
104 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
107 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
108 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
109 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
110 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
111 (elf_m68k_relocate_section): Don't generate dynamic relocation
112 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
114 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
117 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
118 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
119 (allocate_dynrelocs): Discard dynamic relocations if
120 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
121 (elf32_hppa_relocate_section): Don't generate dynamic
122 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
124 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
127 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
128 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
129 (allocate_fptr): Don't allocate function pointer if
130 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
131 (allocate_dynrel_entries): Don't allocate dynamic relocation
132 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
133 (set_got_entry): Don't set GOT entry if
134 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
135 (set_pltoff_entry): Don't set PLTOFF entry if
136 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
137 (elfNN_ia64_relocate_section): Don't install dynamic relocation
138 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
140 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
143 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
144 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
145 (allocate_dynrelocs): Don't allocate dynamic relocations if
146 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
148 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
151 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
152 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
153 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
154 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
156 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
159 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
160 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
161 (tilepro_elf_relocate_section): Don't generate dynamic
162 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
163 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
164 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
165 (tilegx_elf_relocate_section): Don't generate dynamic
166 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
168 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
171 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
172 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
174 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
175 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
177 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
179 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
180 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
181 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
183 2017-10-12 James Bowman <james.bowman@ftdichip.com>
185 * bfd-in2.h: Regenerate.
186 * libbfd.h: Regenerate.
187 * elf32-ft32.c: Add HOWTO R_FT32_15.
188 * reloc.c: Add BFD_RELOC_FT32_15.
190 2017-10-12 Nick Clifton <nickc@redhat.com>
192 * reloc.c (enum bfd_reloc_status): Start values at 2.
193 * bfd-in2.h: Regenerate.
194 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
195 that a TRUE return indicates success. Compare the result of
196 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
197 (build_one_stub): Change sense of tests against aarch64_relocate
199 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
200 than FALSE, when an error is detected.
201 (elfNN_aarch64_final_link_relocate): Likewise.
203 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
205 * elf32-i386.c (elf_backend_hide_symbol): New.
206 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
207 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
208 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
210 2017-10-12 Alan Modra <amodra@gmail.com>
212 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
213 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
214 (bfd_elf_define_start_stop): Likewise.
216 2017-10-12 Alan Modra <amodra@gmail.com>
218 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
219 when executable rather than non-PIC.
220 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
221 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
223 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
225 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
227 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
228 (elf_external_linux_prpsinfo64_ugid32): ... this.
229 (swap_linux_prpsinfo32_out): Rename to...
230 (swap_linux_prpsinfo32_ugid32_out): ... this.
231 (elf_external_linux_prpsinfo64_ugid16): New structure.
232 (swap_linux_prpsinfo64_ugid16_out): New function.
233 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
234 (elf_backend_linux_prpsinfo64_ugid16): Define.
235 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
236 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
237 of the 64-bit Linux core PRPSINFO note.
238 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
240 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
242 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
244 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
245 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
246 (elf_external_ppc_linux_prpsinfo32)
247 (swap_ppc_linux_prpsinfo32_out): Move to...
248 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
249 (swap_linux_prpsinfo32_ugid32_out): ... these.
250 (elf_external_linux_prpsinfo32): Rename to...
251 (elf_external_linux_prpsinfo32_ugid16): ... this.
252 (swap_linux_prpsinfo32_out): Rename to...
253 (swap_linux_prpsinfo32_ugid16_out): ... this.
254 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
255 (elf_backend_linux_prpsinfo32_ugid16): Define.
256 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
257 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
258 of the 32-bit Linux core PRPSINFO note.
259 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
260 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
261 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
262 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
263 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
264 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
265 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
266 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
267 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
268 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
270 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
272 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
273 `gap' member ahead of `pr_flag'.
275 2017-10-11 Pedro Alves <palves@redhat.com>
277 * bfd.c (_doprnt): Rename to ...
278 (_bfd_doprnt): ... this.
279 (error_handler_internal): Adjust.
281 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
283 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
284 instead of incrementing it.
285 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
287 2017-10-10 Renlin Li <renlin.li@arm.com>
290 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
291 symbols into dynamic.
293 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
296 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
297 (riscv_elf_link_hash_table_create): Initialize max_alignment to
299 (_bfd_riscv_relax_section): Cache the max alignment of output
300 sections if possible.
302 2017-10-10 Alan Modra <amodra@gmail.com>
304 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
305 .opd whenever .opd is present and non-zero size. Move code
306 setting abiversion to/from output file earlier. Only set
307 u.opd.func_sec when --gc-sections. Read relocs and set up
308 u.opd.func_sec values here..
309 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
311 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
313 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
315 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
318 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
320 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
321 .interp section with "ld --no-dynamic-linker".
323 2017-10-09 Alan Modra <amodra@gmail.com>
326 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
327 funcinfo_hash_table and varinfo_hash_table.
329 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
331 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
332 in read-only section with minfo.
333 (sh_elf_size_dynamic_sections): Likewise.
335 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
337 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
340 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
342 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
343 this_hdr.sh_entsize only if section size > 0.
345 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
347 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
349 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
351 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
352 in read-only section with minfo.
353 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
355 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
357 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
360 2017-10-06 John Baldwin <jhb@FreeBSD.org>
362 * elf-bfd.h (struct elf_backend_data): Add
363 `elf_backend_grok_freebsd_prstatus'.
364 * elf.c (elfcore_grok_freebsd_note): Call
365 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
367 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
369 (elf_backend_grok_freebsd_prstatus): Define.
370 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
371 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
373 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
375 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
376 and has_non_got_reloc with zero_undefweak.
377 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
378 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
380 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
381 has_non_got_reloc with zero_undefweak.
382 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
383 has_got_reloc and has_non_got_reloc with zero_undefweak.
384 (elf_x86_link_hash_entry): Likewise.
386 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
388 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
389 (VERIFY_COPY_RELOC): Likewise.
391 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
393 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
394 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
395 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
397 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
399 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
400 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
401 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
403 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
405 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
406 * elf32-i386.c (elf_i386_relocate_section): Use it.
407 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
409 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
411 * elf32-i386.c (X86_SIZE_TYPE_P): New.
412 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
413 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
414 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
415 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
417 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
419 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
420 (PLT_LOCAL_IFUNC_P): Likewise.
421 * elf32-i386.c (elf_i386_relocate_section): Use them.
422 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
424 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
426 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
427 * elf32-i386.c (elf_i386_relocate_section): Use it.
428 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
430 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
432 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
433 * elf32-i386.c (elf_i386_relocate_section): Use it.
434 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
436 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
438 * elf32-i386.c (X86_PCREL_TYPE_P): New.
439 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
440 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
441 (X86_PCREL_TYPE_P): This.
442 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
443 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
444 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
446 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
448 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
450 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
451 * elf32-i386.c (elf_i386_tls_transition): Use it.
452 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
454 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
456 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
457 Dump dynamic relocation in read-only section with minfo if
459 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
460 (maybe_set_textrel): Likewise.
461 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
462 read-only section with minfo.
464 2017-10-05 John Baldwin <jhb@FreeBSD.org>
466 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
468 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
470 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
471 in read-only section with minfo.
472 (tilepro_elf_size_dynamic_sections): Likewise.
473 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
474 (tilegx_elf_size_dynamic_sections): Likewise.
476 2017-10-05 Pedro Alves <palves@redhat.com>
479 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
480 ellipsis parameter. Split out bfd_error_on_input code to..
481 (bfd_set_input_error): .. New function.
482 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
483 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
484 * bfd-in2.h: Regenerate.
486 2017-10-05 Alan Modra <amodra@gmail.com>
488 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
489 fini_array error value.
491 2017-10-05 Alan Modra <amodra@gmail.com>
494 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
496 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
498 (elf_fake_sections): Adjust calls. Exit immediately on failure.
499 (bfd_elf_set_group_contents): Add associated reloc section indices
502 2017-10-04 Alan Modra <amodra@gmail.com>
504 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
505 classify symbols for ELFv2.
507 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
510 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
511 undergoes default promotion.
512 * bfd-in2.h: Regenerate.
514 2017-10-02 Alan Modra <amodra@gmail.com>
516 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
517 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
519 2017-10-01 Alan Modra <amodra@gmail.com>
522 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
523 (add_line_info): Always put end_sequence last.
525 2017-10-01 Alan Modra <amodra@gmail.com>
528 * dwarf2.c (read_section): Allocate buffer with extra byte for
529 bfd_simple_get_relocated_section_contents rather than copying
532 2017-09-29 Alan Modra <amodra@gmail.com>
534 * merge.c (merge_strings): Return FALSE on malloc failure.
535 (_bfd_merge_sections): Return failures from record_section and
538 2017-09-28 Alan Modra <amodra@gmail.com>
541 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
542 a case where plugin_notice isn't called.
544 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
546 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
549 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
552 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
553 output_bfd to info->callbacks->minfo.
555 2017-09-26 Nick Clifton <nickc@redhat.com>
558 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
559 assertion failure if elf_x86_64_rtype_to_howto has already issued
562 2017-09-26 Alan Modra <amodra@gmail.com>
565 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
568 2017-09-26 Nick Clifton <nickc@redhat.com>
571 * dwarf2.c (read_formatted_entries): Fail early if we know that
572 the loop parsing data entries will overflow the end of the
575 2017-09-26 Alan Modra <amodra@gmail.com>
578 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
579 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
580 to stash->info_ptr_memory, and check die_ref is within that memory.
581 Set info_ptr_end correctly when another CU is refd. Check die_ref
582 for DW_FORM_ref4 etc. is within CU.
584 2017-09-26 Alan Modra <amodra@gmail.com>
587 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
588 (read_formatted_entries): Init "fe".
589 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
591 2017-09-26 Alan Modra <amodra@gmail.com>
594 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
595 bounds in inner loop.
597 2017-09-25 Alan Modra <amodra@gmail.com>
600 * dwarf1.c (parse_die): Sanity check pointer against section limit
601 before dereferencing.
602 (parse_line_table): Likewise.
604 2017-09-25 Alan Modra <amodra@gmail.com>
607 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
609 (parse_comp_unit): Likewise.
611 2017-09-25 Alan Modra <amodra@gmail.com>
614 * dwarf2.c (read_formatted_entries): Error on format_count zero.
616 2017-09-24 Alan Modra <amodra@gmail.com>
619 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
620 within section bounds.
622 2017-09-24 Alan Modra <amodra@gmail.com>
625 * dwarf2.c (decode_line_info): Properly free line sequences on error.
627 2017-09-24 Alan Modra <amodra@gmail.com>
630 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
631 pname param. Return status. Make name const. Don't abort,
632 return an error. Formatting. Exit if current info_ptr matches
633 orig_info_ptr. Update callers.
634 (scan_unit_for_symbols): Start at nesting_level of zero. Make
635 nested_funcs an array of structs for extensibility. Formatting.
637 2017-09-24 Alan Modra <amodra@gmail.com>
640 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
641 rather than dividing by zero.
643 2017-09-24 Alan Modra <amodra@gmail.com>
646 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
648 2017-09-24 Alan Modra <amodra@gmail.com>
651 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
653 2017-09-24 Alan Modra <amodra@gmail.com>
656 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
657 SHT_GNU_verneed section for sanity. Don't zalloc memory for
660 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
663 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
666 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
669 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
670 -1 if bfd_canonicalize_dynamic_reloc returns 0.
672 2017-09-22 Pedro Alves <palves@redhat.com>
673 Alan Modra <amodra@gmail.com>
675 * version.h: Add comment.
677 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
679 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
680 NT_S390_GS_BC, correct the previously swapped invocations of
681 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
683 2017-09-19 Alan Modra <amodra@gmail.com>
686 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
689 2017-09-19 Alan Modra <amodra@gmail.com>
692 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
693 symbols before calculating verrefs. Don't renumber dynsyms
694 after gc. Exclude .gnu.version when zero or one dynsym.
695 Localize some vars and reindent.
697 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
700 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
701 return from bfd_canonicalize_dynamic_reloc.
703 2017-09-15 Alan Modra <amodra@gmail.com>
706 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
707 overflows bfd_size_type.
709 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
712 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
713 to indicate if conversion is performed.
714 (elf_i386_check_relocs): Cache section contents and relocations
715 if conversion is performed.
716 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
717 contents and relocations if conversion is performed.
719 2017-09-14 Nick Clifton <nickc@redhat.com>
722 * peXXigen.c (pe_print_idata): Extend check for HintName vector
725 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
727 * elfxx-x86.h: Fix a typo in comments.
729 2017-09-09 Kamil Rytarowski <n54@gmx.com>
731 * elf32-nds32.c: Rename __BIT() to N32_BIT().
733 2017-09-09 Alan Modra <amodra@gmail.com>
735 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
738 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
740 * elf32-i386.c (elf_i386_relocate_section): Update usage of
741 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
742 (elf_i386_finish_dynamic_symbol): Likewise.
743 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
744 (elf_x86_64_finish_dynamic_symbol): Likewise.
745 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
746 (_bfd_x86_elf_fixup_symbol): Likewise.
748 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
750 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
751 check has_non_got_reloc.
753 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
756 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
757 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
758 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
759 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
760 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
761 and linker_def on __ehdr_start if it is referenced and not
763 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
764 and return TRUE when building executable, if a symbol has
765 non-GOT/non-PLT relocations in text section or there is no
767 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
769 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
771 * elfxx-x86.h: Update comments.
773 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
775 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
776 elf_x86_plt_layout_table with elf_x86_init_table.
777 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
779 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
781 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
782 (elf_x86_init_table): This.
783 (_bfd_x86_elf_link_setup_gnu_properties): Replace
784 elf_x86_plt_layout_table with elf_x86_init_table.
786 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
788 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
789 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
790 * configure: Regenerated.
791 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
792 and r_sym fields of plt_layout.
793 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
795 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
796 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
797 r_info nor r_sym fields.
798 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
800 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
802 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
804 * (_bfd_riscv_relax_align): Call bfd_set_error and
805 print an error message when unable to relax a .align directive.
807 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
809 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
810 (riscv_record_pcrel_hi_reloc): Add absolute argument.
811 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
812 R_RISCV_PCREL_HI20 relocs, and pass the result to
813 riscv_record_pcrel_hi_reloc.
815 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
817 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
818 r_type_p. Remove the converted argument. Replace
819 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
820 the new relocation type via r_type_p.
821 (elf_i386_relocate_section): Likewise.
822 (elf_i386_finish_dynamic_symbol): Likewise.
823 (need_convert_load): Removed.
824 (check_relocs_failed): Updated.
825 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
826 instead of setting need_convert_load.
827 (_bfd_i386_elf_convert_load): Removed.
828 * elf64-x86-64.c (need_convert_load): Removed.
829 (check_relocs_failed): Updated.
830 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
831 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
832 Return the new relocation type via r_type_p.
833 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
834 instead of setting need_convert_load.
835 (elf_x86_64_check_relocs): Don't check PIC if relocation has
837 (_bfd_x86_64_elf_convert_load): Removed.
838 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
839 with SYMBOL_REFERENCES_LOCAL_P.
840 (elf_x86_64_finish_dynamic_symbol): Likewise.
841 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
843 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
844 (_bfd_x86_elf_link_symbol_references_local): New function.
845 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
846 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
847 SYMBOL_REFERENCES_LOCAL_P.
848 (elf_x86_link_hash_entry): Add local_ref.
849 (elf_x86_link_hash_table): Remove convert_load.
850 (_bfd_i386_elf_convert_load): Removed.
851 (_bfd_x86_64_elf_convert_load): Likewise.
852 (_bfd_x86_elf_link_symbol_references_local): New.
854 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
856 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
857 (elf_x86_64_info_to_howto): Get the real relocation type by
858 masking out R_X86_64_converted_reloc_bit.
859 (elf_x86_64_check_tls_transition): Get the real relocation type
860 by masking out R_X86_64_converted_reloc_bit.
861 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
862 instead of setting converted_reloc.
863 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
864 instead of converted_reloc. Get the real relocation type by
865 masking out R_X86_64_converted_reloc_bit.
866 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
867 R_X86_64_converted_reloc_bit is valid.
868 * elfxx-x86.h (converted_reloc): Removed.
870 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
872 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
873 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
874 to get the relocation type again.
875 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
876 r_type when calling elf_x86_64_tls_transition. Don't use
877 ELF32_R_TYPE to get the relocation type again.
879 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
881 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
884 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
886 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
887 argument. Don't check relocation overflow. Avoid relocation
888 overflow if --no-relax is used. Set converted_reloc on symbol
889 if a GOTPCREL relocation is converted.
890 (elf_x86_64_relocate_section): Issue a fatal error and suggest
891 --no-relax if GOTPCREL relocation conversion leads to relocation
893 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
895 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
896 Edmar Wienskoski <edmar.wienskoski@nxp.com
898 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
899 (ppc_elf_check_relocs): Handle it.
900 (ppc_elf_vle_split20): New function.
901 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
903 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
906 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
907 for x86-64 if GOT_TLS_GDESC_P is true.
909 2017-09-03 Alan Modra <amodra@gmail.com>
912 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
914 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
916 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
917 tls_get_addr for x86-64 in one place.
919 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
921 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
922 with elfxx-x86.lo for 64-bit BFD.
923 * configure: Regenerated.
925 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
927 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
928 (_bfd_i386_elf_convert_load): This. Remove static.
929 (elf_i386_size_dynamic_sections): Removed.
930 (elf_backend_size_dynamic_sections): Likewise.
931 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
932 (_bfd_x86_64_elf_convert_load): This. Remove static.
933 (elf_x86_64_size_dynamic_sections): Removed.
934 (elf_backend_size_dynamic_sections): Likewise.
935 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
936 (elf_x86_allocate_dynrelocs): This. Make it static.
937 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
938 (elf_x86_allocate_local_dynreloc): This. Make it static.
939 (elf_i386_is_reloc_section): New function.
940 (elf_x86_64_is_reloc_section): Likewise.
941 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
942 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
943 Rearrange got_entry_size initialization.
944 (_bfd_x86_elf_size_dynamic_sections): New function.
945 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
946 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
947 (_bfd_i386_elf_convert_load): New.
948 (_bfd_x86_64_elf_convert_load): Likewise.
949 (_bfd_x86_elf_size_dynamic_sections): Likewise.
950 (elf_backend_size_dynamic_sections): Likewise.
951 (_bfd_x86_elf_allocate_dynrelocs): Removed.
952 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
954 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
956 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
959 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
961 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
962 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
964 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
966 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
967 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
968 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
969 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
970 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
971 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
973 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
975 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
976 (elf_i386_allocate_local_dynrelocs): Likewise.
977 (elf_i386_size_dynamic_sections): Replace
978 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
979 with _bfd_x86_elf_allocate_dynrelocs and
980 _bfd_x86_elf_allocate_local_dynrelocs.
981 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
982 (elf_x86_64_allocate_local_dynrelocs): Likewise.
983 (elf_x86_64_size_dynamic_sections): Replace
984 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
985 with _bfd_x86_elf_allocate_dynrelocs and
986 _bfd_x86_elf_allocate_local_dynrelocs.
987 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
988 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
989 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
990 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
992 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
994 * elf32-i386.c (is_i386_elf): Removed.
995 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
996 (elf_i386_size_dynamic_sections): Likewise.
997 (elf_i386_relocate_section): Likewise.
998 * elf64-x86-64.c (is_x86_64_elf): Removed.
999 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
1001 (elf_x86_64_size_dynamic_sections): Likewise.
1002 (elf_x86_64_relocate_section): Likewise.
1003 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1005 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
1008 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1010 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
1011 (elf_i386_allocate_dynrelocs): Replace
1012 elf_i386_compute_jump_table_size with
1013 elf_x86_compute_jump_table_size.
1014 (elf_i386_size_dynamic_sections): Likewise.
1015 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
1016 (elf_x86_64_allocate_dynrelocs): Replace
1017 elf_x86_64_compute_jump_table_size with
1018 elf_x86_compute_jump_table_size.
1019 (elf_x86_64_size_dynamic_sections): Likewise.
1020 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1022 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
1023 (elf_x86_compute_jump_table_size): New.
1025 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1027 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1029 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
1030 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
1032 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1034 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
1035 with htab->is_vxworks.
1036 (elf_i386_size_dynamic_sections): Likewise.
1037 (elf_i386_relocate_section): Likewise.
1038 (elf_i386_finish_dynamic_symbol): Likewise.
1039 (elf_i386_finish_dynamic_sections): Likewise.
1041 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1043 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1044 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1045 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
1046 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1047 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1048 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
1049 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1050 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
1052 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1055 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
1056 ELF_COMMON_DEF_P for common symbols.
1058 2017-09-02 Alan Modra <amodra@gmail.com>
1060 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
1061 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1062 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1064 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1066 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
1067 (elf_backend_gc_mark_hook): Likewise.
1068 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
1069 (elf_backend_gc_mark_hook): Likewise.
1070 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
1071 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
1072 (elf_backend_gc_mark_hook): Likewise.
1074 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1076 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1077 (elf_backend_adjust_dynamic_symbol): Likewise.
1078 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1079 (elf_backend_adjust_dynamic_symbol): Likewise.
1080 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1081 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1082 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1083 (_bfd_x86_elf_adjust_dynamic_symbol): New.
1084 (elf_backend_adjust_dynamic_symbol): Likewise.
1086 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1088 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1091 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1093 * elf32-i386.c (elf_i386_mkobject): Removed.
1094 (bfd_elf32_mkobject): Likewise.
1095 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1096 (bfd_elf64_mkobject): Likewise.
1097 (bfd_elf32_mkobject): Likewise.
1098 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
1099 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1100 (bfd_elf64_mkobject): Likewise.
1101 (bfd_elf32_mkobject): Likewise.
1103 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1105 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1106 Call _bfd_x86_elf_link_setup_gnu_properties.
1107 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1108 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1110 (elf_x86_64_non_lazy_plt): Likewise.
1111 (elf_x86_64_lazy_bnd_plt): Likewise.
1112 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1113 (elf_x86_64_lazy_ibt_plt): Likewise.
1114 (elf_x32_lazy_ibt_plt): Likewise.
1115 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1116 (elf_x32_non_lazy_ibt_plt): Likewise.
1117 (elf_x86_64_nacl_plt): Likewise.
1118 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1119 _bfd_x86_elf_link_setup_gnu_properties.
1120 * elfxx-x86.c: Include elf-vxworks.h".
1121 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1122 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1123 comments for pic_plt0_entry and pic_plt_entry.
1124 (elf_x86_non_lazy_plt_layout): Likewise.
1125 (elf_x86_plt_layout_table): New.
1126 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1128 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1131 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1132 .eh_frame section for the second PLT.
1133 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1134 alignment of .eh_frame section for the second PLT.
1136 2017-09-01 Nick Clifton <nickc@redhat.com>
1139 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1142 2017-09-01 Nick Clifton <nickc@redhat.com>
1145 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1146 attribute buffer is NUL terminated.
1148 2017-08-31 Nick Clifton <nickc@redhat.com>
1151 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1152 to dwarf string sections.
1154 2017-08-31 Alan Modra <amodra@gmail.com>
1156 * po/SRC-POTFILES.in: Regenerate.
1158 2017-08-31 Alan Modra <amodra@gmail.com>
1160 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1161 for a section containing just a terminator. Allow multiple
1162 terminators at end of section.
1163 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1164 sections when not adding alignment. Assert on terminator in
1167 2017-08-31 Alan Modra <amodra@gmail.com>
1171 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1174 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1176 * configure.ac (bfd_backends): Add elf64.lo together with
1177 elfxx-x86.lo for 64-bit BFD.
1178 * configure: Regenerated.
1180 2017-08-31 James Bowman <james.bowman@ftdichip.com>
1182 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1185 2017-08-31 Alan Modra <amodra@gmail.com>
1188 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1189 before _close_and_cleanup. Call iovec->bclose after.
1190 (bfd_close): Remove code common to, and call, bfd_close_all_done.
1192 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1194 * elf32-i386.c (elf_i386_plt_type): Removed.
1195 (elf_i386_plt): Likewise.
1196 (elf_i386_get_synthetic_symtab): Updated. Call
1197 _bfd_x86_elf_get_synthetic_symtab.
1198 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1199 (elf_x86_64_plt): Likewise.
1200 (elf_x86_64_get_synthetic_symtab): Updated. Call
1201 _bfd_x86_elf_get_synthetic_symtab.
1202 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1203 (elf_x86_64_get_plt_got_vma): Likewise.
1204 (elf_i386_valid_plt_reloc_p): Likewise.
1205 (elf_x86_64_valid_plt_reloc_p): Likewise.
1206 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1207 * elfxx-x86.h (elf_x86_plt_type): New.
1208 (elf_x86_plt): Likewise.
1209 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1211 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1213 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1214 target_id instead of elf_machine_code.
1216 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1218 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1219 (elf_i386_lazy_plt_layout): Likewise.
1220 (elf_i386_non_lazy_plt_layout): Likewise.
1221 (elf_i386_plt_layout): Likewise.
1222 (elf_i386_link_hash_table): Likewise.
1223 (elf_i386_next_tls_desc_index): Likewise.
1224 (elf_i386_srelplt2): Likewise.
1225 (elf_i386_plt): Likewise.
1226 (elf_i386_lazy_plt): Likewise.
1227 (elf_i386_non_lazy_plt): Likewise.
1228 (elf_i386_link_hash_table_create): Likewise.
1229 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1230 (elf_i386_lazy_plt): Updated.
1231 (elf_i386_non_lazy_plt): Likewise.
1232 (elf_i386_lazy_ibt_plt): Likewise.
1233 (elf_i386_non_lazy_ibt_plt): Likewise.
1234 (elf_i386_allocate_dynrelocs): Likewise.
1235 (elf_i386_size_dynamic_sections): Likewise.
1236 (elf_i386_relocate_section): Likewise.
1237 (elf_i386_finish_dynamic_symbol): Likewise.
1238 (elf_i386_finish_dynamic_sections): Likewise.
1239 (elf_i386_get_synthetic_symtab): Likewise.
1240 (elf_i386_link_setup_gnu_properties): Likewise.
1241 (elf_i386_nacl_plt): Likewise.
1242 * elf64-x86-64.c (ABI_64_P): Removed.
1243 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1244 (ELF32_DYNAMIC_INTERPRETER): Likewise.
1245 (elf_x86_64_lazy_plt_layout): Likewise.
1246 (elf_x86_64_non_lazy_plt_layout): Likewise.
1247 (elf_x86_64_plt_layout): Likewise.
1248 (elf_x86_64_link_hash_table): Likewise.
1249 (elf_x86_64_plt): Likewise.
1250 (elf_x86_64_lazy_plt): Likewise.
1251 (elf_x86_64_non_lazy_plt): Likewise.
1252 (elf_x86_64_link_hash_table_create): Likewise.
1253 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1254 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1255 (elf_x86_64_lazy_plt): Updated.
1256 (elf_x86_64_non_lazy_plt): Likewise.
1257 (elf_x86_64_lazy_bnd_plt): Likewise.
1258 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1259 (elf_x86_64_lazy_ibt_plt): Likewise.
1260 (elf_x32_lazy_ibt_plt): Likewise.
1261 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1262 (elf_x32_non_lazy_ibt_plt): Likewise.
1263 (elf_x86_64_allocate_dynrelocs): Likewise.
1264 (elf_x86_64_size_dynamic_sections): Likewise.
1265 (elf_x86_64_relocate_section): Likewise.
1266 (elf_x86_64_finish_dynamic_symbol): Likewise.
1267 (elf_x86_64_finish_dynamic_sections): Likewise.
1268 (elf_x86_64_get_synthetic_symtab): Likewise.
1269 (elf_x86_64_link_setup_gnu_properties): Likewise.
1270 (elf_x86_64_nacl_plt): Likewise.
1271 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1273 (ELF32_DYNAMIC_INTERPRETER): New.
1274 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1275 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1276 (_bfd_x86_elf_link_hash_table_create): Likewise.
1277 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1278 (elf_x86_link_hash_table_free): This. Make it static.
1279 * elfxx-x86.h: Don't include "objalloc.h".
1281 (elf_x86_lazy_plt_layout): Likewise.
1282 (elf_x86_non_lazy_plt_layout): Likewise.
1283 (elf_x86_plt_layout): Likewise.
1284 (_bfd_x86_elf_link_hash_table_create): Likewise.
1285 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1286 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1287 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1288 srelplt2 and next_tls_desc_index.
1289 (_bfd_x86_elf_link_hash_table_free): Removed.
1291 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1293 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1294 branch offset interpretation.
1296 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1299 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1301 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1303 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1304 (elf_x86_64_srelplt2): Likewise.
1306 2017-08-30 Alan Modra <amodra@gmail.com>
1308 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1309 (ppc64_elf_tls_optimize): Set it.
1310 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1311 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1312 addis would add zero.
1313 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1314 (ppc_elf_tls_optimize): Set it.
1315 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1316 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1318 2017-08-30 Alan Modra <amodra@gmail.com>
1320 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1321 __tls_get_addr call sequences to LE, don't move the addi down
1322 to the nop. Replace the bl with addi and leave the nop alone.
1324 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1326 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1328 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1330 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1332 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1334 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1335 (BFD64_BACKENDS): Likewise.
1336 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1337 (BFD64_BACKENDS_CFILES): Likewise.
1338 * Makefile.in: Regenerated.
1339 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1340 elf32-i386.lo and elf64-x86-64.lo.
1341 * configure: Regenerated.
1342 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1343 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1344 "objalloc.h" and "hashtab.h".
1345 (ELIMINATE_COPY_RELOCS): Removed.
1346 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1347 (SYMBOL_NO_COPYRELOC): Likewise.
1348 (elf_i386_link_hash_entry): Likewise.
1349 (GOT_UNKNOWN): Likewise.
1350 (GOT_NORMAL): Likewise.
1351 (GOT_TLS_GD): Likewise.
1352 (elf_i386_hash_entry): Likewise.
1353 (elf_i386_obj_tdata): Likewise.
1354 (elf_i386_tdata): Likewise.
1355 (elf_i386_local_got_tls_type): Likewise.
1356 (elf_i386_local_tlsdesc_gotent): Likewise.
1357 (elf_i386_hash_table): Likewise.
1358 (elf_i386_link_hash_newfunc): Likewise.
1359 (elf_i386_local_htab_hash): Likewise.
1360 (elf_i386_local_htab_eq): Likewise.
1361 (elf_i386_get_local_sym_hash): Likewise.
1362 (elf_i386_link_hash_table_free): Likewise.
1363 (elf_i386_copy_indirect_symbol): Likewise.
1364 (elf_i386_fixup_symbol): Likewise.
1365 (elf_i386_readonly_dynrelocs): Likewise.
1366 (elf_i386_always_size_sections): Likewise.
1367 (elf_i386_set_tls_module_base): Likewise.
1368 (elf_i386_dtpoff_base): Likewise.
1369 (compare_relocs): Likewise.
1370 (elf_i386_hash_symbol): Likewise.
1371 (elf_i386_parse_gnu_properties): Likewise.
1372 (elf_i386_merge_gnu_properties): Likewise.
1373 (elf_i386_link_check_relocs): Likewise.
1374 (elf_i386_merge_symbol_attribute): Likewise.
1375 (bfd_elf32_bfd_link_check_relocs): Likewise.
1376 (elf_backend_copy_indirect_symbol): Likewise.
1377 (elf_backend_always_size_sections): Likewise.
1378 (elf_backend_omit_section_dynsym): Likewise.
1379 (elf_backend_hash_symbol): Likewise.
1380 (elf_backend_fixup_symbol): Likewise.
1381 (elf_backend_parse_gnu_properties): Likewise.
1382 (elf_backend_merge_gnu_properties): Likewise.
1383 (elf_backend_merge_symbol_attribute): Likewise.
1384 (elf_i386_mkobject): Updated.
1385 (elf_i386_link_hash_table_create): Likewise.
1386 (elf_i386_check_tls_transition): Likewise.
1387 (elf_i386_tls_transition): Likewise.
1388 (elf_i386_convert_load_reloc): Likewise.
1389 (elf_i386_check_relocs): Likewise.
1390 (elf_i386_adjust_dynamic_symbol): Likewise.
1391 (elf_i386_allocate_dynrelocs): Likewise.
1392 (elf_i386_convert_load): Likewise.
1393 (elf_i386_size_dynamic_sections): Likewise.
1394 (elf_i386_relocate_section): Likewise.
1395 (elf_i386_finish_dynamic_symbol ): Likewise.
1396 (elf_i386_finish_dynamic_sections): Likewise.
1397 (elf_i386_output_arch_local_syms): Likewise.
1398 (elf_i386_get_synthetic_symtab): Likewise.
1399 (elf_i386_link_setup_gnu_properties): Likewise.
1400 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1401 of elf_link_hash_table, as base.
1402 (elf_i386_next_tls_desc_index): New.
1403 (elf_i386_srelplt2): Likewise.
1404 (elf_i386_plt): Likewise.
1405 (elf_i386_lazy_plt): Likewise.
1406 (elf_i386_non_lazy_plt): Likewise.
1407 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1408 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1409 "objalloc.h" and "hashtab.h".
1410 (ELIMINATE_COPY_RELOCS): Removed.
1411 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1412 (SYMBOL_NO_COPYRELOC): Likewise.
1413 (elf_x86_64_link_hash_entry): Likewise.
1414 (GOT_UNKNOWN): Likewise.
1415 (GOT_NORMAL): Likewise.
1416 (GOT_TLS_GD): Likewise.
1417 (elf_x86_64_hash_entry): Likewise.
1418 (elf_x86_64_obj_tdata): Likewise.
1419 (elf_x86_64_tdata): Likewise.
1420 (elf_x86_64_local_got_tls_type): Likewise.
1421 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1422 (elf_x86_64_hash_table): Likewise.
1423 (elf_x86_64_link_hash_newfunc): Likewise.
1424 (elf_x86_64_local_htab_hash): Likewise.
1425 (elf_x86_64_local_htab_eq): Likewise.
1426 (elf_x86_64_get_local_sym_hash): Likewise.
1427 (elf_x86_64_link_hash_table_free): Likewise.
1428 (elf_x86_64_copy_indirect_symbol): Likewise.
1429 (elf_x86_64_fixup_symbol): Likewise.
1430 (elf_x86_64_readonly_dynrelocs): Likewise.
1431 (elf_x86_64_always_size_sections): Likewise.
1432 (elf_x86_64_set_tls_module_base): Likewise.
1433 (elf_x86_64_dtpoff_base): Likewise.
1434 (compare_relocs): Likewise.
1435 (elf_x86_64_merge_symbol_attribute): Likewise.
1436 (elf_x86_64_hash_symbol): Likewise.
1437 (elf_x86_64_parse_gnu_properties): Likewise.
1438 (elf_x86_64_merge_gnu_properties): Likewise.
1439 (elf_x86_64_link_check_relocs): Likewise.
1440 (elf_backend_copy_indirect_symbol): Likewise.
1441 (elf_backend_always_size_sections): Likewise.
1442 (bfd_elf64_bfd_link_check_relocs): Likewise.
1443 (elf_backend_merge_symbol_attribute): Likewise.
1444 (elf_backend_hash_symbol): Likewise.
1445 (elf_backend_omit_section_dynsym): Likewise.
1446 (elf_backend_fixup_symbol): Likewise.
1447 (elf_backend_parse_gnu_properties): Likewise.
1448 (elf_backend_merge_gnu_properties): Likewise.
1449 (bfd_elf32_bfd_link_check_relocs): Likewise.
1450 (elf_x86_64_mkobject): Updated.
1451 (elf_x86_64_link_hash_table_create): Likewise.
1452 (elf_x86_64_check_tls_transition): Likewise.
1453 (elf_x86_64_tls_transition): Likewise.
1454 (elf_x86_64_convert_load_reloc): Likewise.
1455 (elf_x86_64_check_relocs): Likewise.
1456 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1457 (elf_x86_64_allocate_dynrelocs): Likewise.
1458 (elf_x86_64_convert_load): Likewise.
1459 (elf_x86_64_size_dynamic_sections): Likewise.
1460 (elf_x86_64_relocate_section): Likewise.
1461 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1462 (elf_x86_64_finish_dynamic_sections): Likewise.
1463 (elf_x86_64_output_arch_local_syms): Likewise.
1464 (elf_x86_64_get_synthetic_symtab): Likewise.
1465 (elf_x86_64_link_setup_gnu_properties): Likewise.
1466 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1467 instead of elf_link_hash_table, as base.
1468 (elf_x86_64_next_tls_desc_index): New.
1469 (elf_x86_64_srelplt2): Likewise.
1470 (elf_x86_64_plt): Likewise.
1471 (elf_x86_64_lazy_plt): Likewise.
1472 (elf_x86_64_non_lazy_plt): Likewise.
1473 * elfxx-x86.c: New file.
1474 * elfxx-x86.h: Likewise.
1476 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1478 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1480 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1482 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1484 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1485 sections before checking dynamic relocations and free invalid
1486 PLT section contents.
1487 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1489 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1491 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1492 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1494 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1497 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1499 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1501 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1503 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1505 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1507 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1510 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1511 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1512 Add a has_no_copy_on_protected bitfield.
1513 (elf_has_no_copy_on_protected): New.
1514 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1515 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1516 (elf_merge_gnu_property_list): Likewise.
1517 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1518 to FALSE for elf_has_no_copy_on_protected.
1519 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1520 (elf_i386_link_hash_entry): Add def_protected.
1521 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1522 when checking info->nocopyreloc.
1523 (elf_i386_link_setup_gnu_properties): Don't set
1524 extern_protected_data here.
1525 (elf_i386_merge_symbol_attribute): New function.
1526 (elf_backend_merge_symbol_attribute): New.
1527 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1528 (elf_x86_64_link_hash_entry): Add def_protected.
1529 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1530 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1531 when checking info->nocopyreloc.
1532 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1533 relocation run-time overflow and unresolvable R_X86_64_32S
1534 relocation against protected data symbol defined in shared object
1535 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1536 (elf_x86_64_link_setup_gnu_properties): Don't set
1537 extern_protected_data here.
1538 (elf_x86_64_merge_symbol_attribute): New function.
1539 (elf_backend_merge_symbol_attribute): New.
1541 2017-08-26 Alan Modra <amodra@gmail.com>
1543 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1544 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1545 (ppc_elf_relocate_section): Comment fix.
1546 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1547 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1548 Support dynamic relocs for TPREL16 when non-pic too.
1549 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1550 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1553 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1555 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1556 "symbol" in comments.
1557 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1559 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1562 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1563 R_X86_64_PC32 relocation run-time overflow and unresolvable
1564 R_X86_64_32S relocation with -z nocopyreloc.
1566 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1568 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1569 Undefined symbols may not have a type.
1570 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1572 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1574 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1575 bfd_link_info. Report shared, PIE or PDE object based on
1577 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1578 (elf_x86_64_relocate_section): Likewise.
1580 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1582 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1583 for function symbols.
1584 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1586 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1588 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1589 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1590 is set on any input relocatable file.
1591 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1593 2017-08-23 Alan Modra <amodra@gmail.com>
1596 * elf64-ppc.c (ensure_undef_dynamic): Rename from
1597 ensure_undefweak_dynamic. Handle undefined too.
1598 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1599 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1600 (allocate_dynrelocs): Discard undefined non-default visibility
1601 relocs first. Make undefined syms dynamic. Tidy goto.
1603 2017-08-21 Alan Modra <amodra@gmail.com>
1604 H.J. Lu <hongjiu.lu@intel.com>
1607 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
1608 * elflink.c (bfd_elf_define_start_stop): Rewrite.
1610 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
1613 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
1614 undefined weak symbols.
1616 2017-08-18 Nick Clifton <nickc@redhat.com>
1619 * tekhex.c (getsym): Fix check for source pointer walking off the
1620 end of the input buffer.
1622 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
1625 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
1626 relocations in debug sections, change abort to _bfd_error_handler.
1628 2017-08-14 Nick Clifton <nickc@redhat.com>
1631 * elf.c (setup_group): Check for an empty or very small group
1633 * po/bfd.pot: Regenerate.
1635 2017-08-14 Alan Modra <amodra@gmail.com>
1638 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
1639 alignment padding here.
1640 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
1641 in a reverse pass over sections.
1643 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
1646 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
1647 for @plt suffixes first.
1648 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1650 2017-08-08 Nick Clifton <nickc@redhat.com>
1653 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
1654 small section lengths.
1655 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
1657 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
1658 there is enough data present in the note.
1660 2017-08-08 Alan Modra <amodra@gmail.com>
1663 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
1664 got.refcount for GOTOFF relocs, just create .got section.
1666 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
1668 * elflink.c (elf_link_add_object_symbols): Move common symbol
1669 check after bed->common_definition.
1671 2017-08-07 Alan Modra <amodra@gmail.com>
1674 * elflink.c (bfd_elf_final_link): Don't segfault when sections
1675 needed to define various dynamic tags have been discarded.
1677 2017-08-07 Nick Clifton <nickc@redhat.com>
1680 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
1681 has not been set then use the bfd returned by
1682 _bfd_elf_link_setup_gnu_properties. If that is null then search
1683 through all the input bfds selecting the first normal, ELF format
1685 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1687 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1689 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
1691 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
1692 (elf_i386_check_tls_transition): Check tls_get_addr directly.
1693 (elf_i386_convert_load_reloc): Update tls_get_addr check.
1694 (elf_i386_link_check_relocs): New function.
1695 (bfd_elf32_bfd_link_check_relocs): New.
1696 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
1698 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
1699 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
1700 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
1701 (elf_x86_64_link_check_relocs): New function.
1702 (bfd_elf64_bfd_link_check_relocs): New.
1703 (bfd_elf32_bfd_link_check_relocs): Likewise.
1705 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1708 * elflink.c (elf_link_add_object_symbols): Treat common symbol
1709 as undefined for --no-define-common.
1711 2017-08-05 Alan Modra <amodra@gmail.com>
1713 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
1714 hppa_link_hash_table.
1716 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
1718 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
1719 entries for sysregs with negative indices.
1721 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1723 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
1724 isn't the S/390 specific elf data.
1725 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1727 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
1729 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
1730 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
1731 [R_RISCV_ADD16]: Likewise.
1732 [R_RISCV_ADD32]: Likewise.
1733 [R_RISCV_ADD64]: Likewise.
1734 [R_RISCV_SUB6]: Likewise.
1735 [R_RISCV_SUB8]: Likewise.
1736 [R_RISCV_SUB16]: Likewise.
1737 [R_RISCV_SUB32]: Likewise.
1738 [R_RISCV_SUB64]: Likewise.
1740 2017-07-31 Alan Modra <amodra@gmail.com>
1742 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
1743 without ld.so checks.
1745 2017-07-29 Alan Modra <amodra@gmail.com>
1748 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
1749 (ppc64_elf_merge_symbol): Set non_zero_localentry.
1750 (is_elfv2_localentry0): Test non_zero_localentry.
1751 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
1753 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1755 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
1756 pointer check for htab->elf.irelplt.
1757 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1759 2017-07-27 Nick Clifton <nickc@redhat.com>
1762 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
1764 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
1766 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
1768 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
1770 (evax_bfd_print_emh): Check for invalid string lengths.
1772 2017-07-25 Nick Clifton <nickc@redhat.com>
1774 * po/fr.po: Updated French translation.
1776 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
1779 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
1780 16-bit absolute branches into 10-bit pc-relative branches on the
1781 MSP430 as well as the MSP430X.
1783 2017-07-25 Alan Modra <amodra@gmail.com>
1785 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
1786 (stub_eh_frame_size): New function.
1787 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
1788 (group_sections): Init group tls_get_addr_opt_bctrl.
1789 (ppc64_elf_size_stubs): Update sizing and initialization of
1790 .eh_frame. Iteration over stubs via group list.
1791 (ppc64_elf_build_stubs): Iterate over stubs via group list.
1792 (ppc64_elf_finish_dynamic_sections): Update finalization of
1795 2017-07-24 Nick Clifton <nickc@redhat.com>
1798 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
1799 of the relocs to the canonicalize_one_reloc routine.
1800 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
1801 for the _bfd_mach_o_canonicalize_one_reloc field.
1802 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
1803 res_base parameter. Use to check for corrupt pair relocs.
1804 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
1806 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
1808 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
1811 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
1812 enough data in the record before attempting to parse it.
1813 (_bfd_vms_slurp_eeom): Likewise.
1815 (_bfd_vms_slurp_egsd): Check for an invalid section index.
1816 (image_set_ptr): Likewise.
1817 (alpha_vms_slurp_relocs): Likewise.
1819 (alpha_vms_object_p): Check for a truncated record.
1821 2017-07-24 Nick Clifton <nickc@redhat.com>
1824 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
1825 an unrecognized reloc and sets the bfd_error value.
1826 * libbfd.h: Regenerate.
1827 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
1829 * elf32-i386.c (elf_i386_relocate_section): Likewise.
1830 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1831 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1832 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
1833 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1835 2017-07-23 Alan Modra <amodra@gmail.com>
1837 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
1840 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
1843 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
1844 reloc_class_ifunc for ifunc symbols.
1846 2017-07-19 Nick Clifton <nickc@redhat.com>
1849 * archive.c (bfd_generic_archive_p): If the bfd does not have the
1850 correct magic bytes at the start, set the error to wrong format
1851 and clear the format selector before returning NULL.
1853 2017-07-19 Nick Clifton <nickc@redhat.com>
1856 * coff-rs6000.c (_bfd_strntol): New function.
1857 (_bfd_strntoll): New function.
1858 (GET_VALUE_IN_FIELD): New macro.
1859 (EQ_VALUE_IN_FIELD): new macro.
1860 (_bfd_xcoff_slurp_armap): Use new macros.
1861 (_bfd_xcoff_archive_p): Likewise.
1862 (_bfd_xcoff_read_ar_hdr): Likewise.
1863 (_bfd_xcoff_openr_next_archived_file): Likewise.
1864 (_bfd_xcoff_stat_arch_elt): Likewise.
1865 * coff64-rs6000.c (_bfd_strntol): New function.
1866 (_bfd_strntoll): New function.
1867 (GET_VALUE_IN_FIELD): New macro.
1868 (xcoff64_slurp_armap): Use new macros.
1870 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
1871 John Eric Martin <John.Martin@emmicro-us.com>
1873 * bfd-in2.h: Regenerate.
1874 * libbfd.h: Regenerate.
1875 * elf32-arc.c (JLI): Define.
1876 * reloc.c: Add JLI relocations.
1878 2017-07-18 Nick Clifton <nickc@redhat.com>
1881 * coff-sh.c: Fix spelling typos.
1882 * compress.c: Likewise.
1883 * cpu-pdp11.c: Likewise.
1884 * ecofflink.c: Likewise.
1885 * elf-m10300.c: Likewise.
1887 * elf32-arm.c: Likewise.
1888 * elf32-m68k.c: Likewise.
1889 * elf32-nds32.c: Likewise.
1890 * elf32-ppc.c: Likewise.
1891 * elf32-sh.c: Likewise.
1892 * elf32-v850.c: Likewise.
1893 * elf64-ppc.c: Likewise.
1894 * elf64-x86-64.c: Likewise.
1895 * elflink.c: Likewise.
1896 * elfnn-aarch64.c: Likewise.
1897 * elfxx-mips.c: Likewise.
1899 * sunos.c: Likewise.
1900 * vms-alpha.c: Likewise.
1901 * xcofflink.c: Likewise.
1903 2017-07-18 Nick Clifton <nickc@redhat.com>
1906 * coffcode.h (handle_COMDAT): Replace abort with an error message
1909 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1912 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
1915 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1917 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
1919 2017-07-16 Alan Modra <amodra@gmail.com>
1921 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
1922 __tls_index GOT entries when using __tls_get_addr_opt stub.
1923 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1925 2017-07-12 Alan Modra <amodra@gmail.com>
1927 * po/es.po: Update from translationproject.org/latest/bfd/.
1928 * po/fi.po: Likewise.
1929 * po/fr.po: Likewise.
1930 * po/id.po: Likewise.
1931 * po/ja.po: Likewise.
1932 * po/ro.po: Likewise.
1933 * po/ru.po: Likewise.
1934 * po/sr.po: Likewise.
1935 * po/sv.po: Likewise.
1936 * po/tr.po: Likewise.
1937 * po/uk.po: Likewise.
1938 * po/vi.po: Likewise.
1939 * po/zh_CN.po: Likewise.
1940 * po/hr.po: New file from translationproject.org.
1941 * configure.ac (ALL_LINGUAS): Add hr. Sort.
1942 * configure: Regenerate.
1944 2017-07-12 Nick Clifton <nickc@redhat.com>
1946 Fix compile time warnings using gcc 7.1.1.
1947 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
1949 (elf_xtensa_get_gotplt_section): Increase length of got_name
1951 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
1952 default return of FALSE.
1953 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
1954 default return of FALSE.
1956 2017-07-12 Alan Modra <amodra@gmail.com>
1958 * binary.c (binary_set_section_contents): Don't print filepos in
1960 (coff_write_object_contents): Cast size_t for error message.
1961 (coff_slurp_line_table): Don't use bfd_vma symndx.
1962 (coff_slurp_reloc_table): Remove unneeded cast.
1963 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
1965 (find_abstract_instance_name): Likewise.
1966 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
1967 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
1968 (elf32_arm_check_relocs): Make r_symndx an int.
1969 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
1971 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
1973 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
1975 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
1976 * elf32-s390.c (elf_s390_check_relocs): Likewise.
1977 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
1978 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
1979 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1980 * elf64-s390.c (elf_s390_check_relocs): Likewise.
1981 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1982 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
1983 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
1984 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1985 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
1986 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
1987 and use %lu for error message.
1988 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
1989 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
1992 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
1994 (elf32_arm_final_link_relocate): Likewise.
1995 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
1996 * coffcode.h (styp_to_sec_flags): Likewise.
1997 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
1998 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
1999 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
2000 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
2001 (elf32_bfin_merge_private_bfd_data): Likewise.
2002 * elf32-cris.c (cris_elf_relocate_section): Likewise.
2003 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2004 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
2005 (i370_elf_relocate_section): Likewise.
2006 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
2007 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
2008 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
2009 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2010 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
2011 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
2012 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
2013 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
2014 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2015 * ieee.c (ieee_write_id, read_id): Likewise.
2016 * mach-o.c (bfd_mach_o_write_contents): Likewise.
2017 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
2018 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
2019 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
2020 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
2021 * stabs.c (_bfd_link_section_stabs): Likewise.
2023 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
2025 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2026 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2027 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
2028 * coff-sh.c (sh_relax_section): Likewise.
2029 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
2030 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2031 * coffcode.h (coff_slurp_reloc_table): Likewise.
2032 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2033 (_bfd_coff_read_string_table): Likewise.
2034 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
2035 * compress.c (bfd_get_full_section_contents): Likewise.
2036 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
2037 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2038 * elf.c (bfd_elf_string_from_elf_section): Likewise.
2039 * elf32-arc.c (arc_special_overflow_checks): Likewise.
2040 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
2041 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
2042 (elf32_arm_write_section): Likewise.
2043 * elf32-bfin.c (bfin_relocate_section): Likewise.
2044 (bfinfdpic_relocate_section): Likewise.
2045 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2046 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
2047 * elf32-i386.c (elf_i386_tls_transition): Likewise.
2048 (elf_i386_relocate_section): Likewise.
2049 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
2050 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
2051 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2052 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2053 * elf32-metag.c (elf_metag_relocate_section): Likewise.
2054 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
2055 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
2056 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
2057 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
2058 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
2059 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
2060 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
2061 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
2062 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
2063 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
2064 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
2065 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
2066 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
2067 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
2068 * elf32-sh.c (sh_elf_relax_section): Likewise.
2069 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
2070 (sh_elf_relocate_section): Likewise.
2071 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
2072 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2073 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2074 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2075 * elf32-v850.c (v850_elf_relax_section): Likewise.
2076 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2077 (elf_vax_relocate_section): Likewise.
2078 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2079 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2080 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2081 (do_fix_for_relocatable_link): Likewise.
2082 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2083 (elf64_alpha_relax_with_lituse): Likewise.
2084 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2085 (elf_hppa_final_link_relocate): Likewise.
2086 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2087 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2088 (elf64_vms_link_add_object_symbols): Likewise.
2089 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2090 (mmix_final_link_relocate): Likewise.
2091 * elf64-s390.c (invalid_tls_insn): Likewise.
2092 (elf_s390_relocate_section): Likewise.
2093 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2094 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2095 (elf_x86_64_relocate_section): Likewise.
2096 * elfcode.h (elf_slurp_symbol_table): Likewise.
2097 * elfcore.h (elf_core_file_p): Likewise.
2098 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2099 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2100 (elfNN_aarch64_relocate_section): Likewise.
2101 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2102 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2103 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2104 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2105 (_bfd_mips_elf_relocate_section): Likewise.
2106 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2107 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2108 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2109 * ieee.c (ieee_slurp_external_symbols): Likewise.
2110 * ihex.c (ihex_write_object_content): Likewise.
2111 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2112 * merge.c (_bfd_merged_section_offset): Likewise.
2113 * mmo.c (mmo_write_loc_chunk): Likewise.
2114 (mmo_write_object_contents): Likewise.
2115 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2116 * stabs.c (_bfd_link_section_stabs): Likewise.
2117 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2119 2017-07-11 Alan Modra <amodra@gmail.com>
2121 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2123 2017-07-11 Alan Modra <amodra@gmail.com>
2125 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2126 instruction" error using _bfd_error_handler, not einfo.
2128 2017-07-10 Nick Clifton <nickc@redhat.com>
2130 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2131 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2133 2017-07-07 John Baldwin <jhb@FreeBSD.org>
2135 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2137 2017-07-07 Alan Modra <amodra@gmail.com>
2139 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2141 2017-07-07 Alan Modra <amodra@gmail.com>
2143 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2144 as long long. Move code replacing "ll" with "I64", and simplify.
2146 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2148 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2151 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2153 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2155 (line_info_add_file_name): Likewise.
2156 (decode_line_info): Likewise.
2158 2017-07-04 Tristan Gingold <gingold@adacore.com>
2160 * version.m4: Bump version to 2.29.51
2161 * configure: Regenerate.
2163 2017-07-04 Jiong Wang <jiong.wang@arm.com>
2165 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2166 sanity check at the head of this function.
2168 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2170 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2171 dwarf_line_str_size.
2172 (struct attr_abbrev): Add field implicit_const.
2173 (dwarf_debug_sections): Add .debug_line_str.
2174 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2175 (dwarf_debug_section_assert): Add static assertion.
2176 (read_indirect_line_string): New.
2177 (read_abbrevs): Support DW_FORM_implicit_const.
2178 (is_str_attr): Support DW_FORM_line_strp.
2179 (read_attribute_value): Support DW_FORM_line_strp and
2180 DW_FORM_implicit_const.
2181 (read_attribute): Support DW_FORM_implicit_const.
2182 (line_info_add_include_dir, line_info_add_include_dir_stub):
2183 (line_info_add_file_name, read_formatted_entries): New.
2184 (decode_line_info, parse_comp_unit): Support DWARF 5.
2185 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2187 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2189 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2190 abort statement that was put for symbols that are not dynamic.
2192 2017-07-03 Tristan Gingold <gingold@adacore.com>
2194 * po/bfd.pot: Regenerate
2196 2017-07-03 Alan Modra <amodra@gmail.com>
2198 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2199 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
2200 * elf.c (setup_group): Use "Lx" to print sh_size.
2201 (_bfd_elf_setup_sections): Remove unnecessary cast and print
2202 unknown section type in hex.
2203 (copy_special_section_fields): Style fix.
2204 (bfd_section_from_shdr): Correct format for sh_link. Use a
2205 common error message for all the variants of unrecognized
2207 (assign_file_positions_for_load_sections): Use "Lx" for lma
2208 adjust error message.
2209 (assign_file_positions_for_non_load_sections): Formatting.
2210 (rewrite_elf_program_header): Formatting. Use "Lx" for
2211 bfd_vma values in error messages.
2212 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2213 ELF_R_SYM value to type expected by format.
2214 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2216 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2217 (elf_link_input_bfd): Use "Lx" for r_info.
2218 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2220 2017-07-03 Alan Modra <amodra@gmail.com>
2222 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2223 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2224 Microsoft C library variant of long long format specifier.
2225 (PRINT20): Cast value to bfd_uint64_t not long long.
2226 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2227 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2228 long long. Don't cast to bfd_vma.
2229 * elf32-score.c (score3_bfd_getl48): Likewise.
2230 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2232 2017-07-03 Alan Modra <amodra@gmail.com>
2234 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2236 (bfd_elf_print_symbol): Don't cast symbol->flags.
2237 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2238 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2239 _bfd_error_handler argument order.
2240 (ppc_elf_merge_private_bfd_data): Don't cast flags.
2242 2017-07-03 Alan Modra <amodra@gmail.com>
2244 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
2245 AC_TYPE_LONG_DOUBLE.
2246 * configure: Regenerate.
2247 * config.in: Regenerate.
2249 2017-06-29 Andrew Waterman <andrew@sifive.com>
2251 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2254 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2256 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2257 unless it is undefined weak.
2258 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2259 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2261 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2262 is not dynamic in PIC, abort.
2264 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2267 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2268 undefined weak symbols into dynamic.
2269 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2270 relocation for non-dynamic symbols.
2271 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2273 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2275 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2276 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2277 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2278 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2279 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2282 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
2284 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2285 (elfcore_write_s390_gs_bc): Likewise.
2286 * elf.c (elfcore_grok_s390_gs_cb): New function.
2287 (elfcore_grok_s390_gs_bc): New function.
2288 (elfcore_grok_note): Call them.
2289 (elfcore_write_s390_gs_cb): New function.
2290 (elfcore_write_s390_gs_bc): New function.
2291 (elfcore_write_register_note): Call them.
2293 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2295 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2296 bfd_get_file_size. Check archive element size.
2297 (_bfd_generic_get_section_contents_in_window): Likewise.
2299 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2301 * bfd-in2.h: Regenerated.
2302 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2303 (bfd_get_file_size): Likewise.
2305 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2306 Matthew Fortune <matthew.fortune@imgtec.com>
2308 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2309 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2310 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2311 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2313 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2314 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2315 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2316 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2317 `bfd_mach_mips_interaptiv_mr2' entries.
2318 * bfd-in2.h: Regenerate.
2320 2017-06-27 Nick Clifton <nickc@redhat.com>
2322 * tekhex.c (pass_over): Revert accidental conversion of a local
2323 array to a static array.
2325 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2328 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2329 reloc addend if necessary. Adjust diff only if
2330 shrinked_insn_address < end_address.
2332 2017-06-27 Alan Modra <amodra@gmail.com>
2335 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2336 (_bfd_generic_get_section_contents_in_window): Likewise.
2338 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2340 * elfnn-riscv.c (perform_relocation): Support the new
2341 R_RISCV_32_PCREL relocation.
2342 (riscv_elf_relocate_section): Likewise.
2343 * elfxx-riscv.c (howto_table): Likewise.
2344 (riscv_reloc_map): Likewise.
2345 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2346 * libbfd.h: Regenerate.
2348 2017-06-27 Alan Modra <amodra@gmail.com>
2351 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2352 Use unsigned file pointer type, and remove cast.
2353 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2354 Add "count", not "sz".
2356 2017-06-26 Pedro Alves <palves@redhat.com>
2359 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2362 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2365 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2368 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2370 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2371 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2372 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2373 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2374 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2376 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2379 * compress.c (bfd_get_full_section_contents): Don't check the
2381 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2382 reject a section whose size + offset is greater than the size
2384 (_bfd_generic_get_section_contents_in_window): Likewise.
2386 2017-06-26 Nick Clifton <nickc@redhat.com>
2389 * tekhex.c (getvalue): Check for the source pointer exceeding the
2390 end pointer before the first byte is read.
2392 2017-06-26 Nick Clifton <nickc@redhat.com>
2395 * opncls.c (get_build_id): Check that the section is big enough
2396 to contain the whole note.
2397 * compress.c (bfd_get_full_section_contents): Check for and reject
2398 a section whose size is greater than the size of the entire file.
2399 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2400 contain a notes section.
2402 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2404 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2406 (elf_s390_modify_segment_map): Likewise.
2407 (bfd_elf_s390_set_options): Lisewise.
2409 2017-06-26 Alan Modra <amodra@gmail.com>
2411 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2413 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2414 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2415 .preinit_array on --just-syms bfds.
2416 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2417 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2418 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2420 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2422 * elf.c (find_link): Bounds check "hint".
2424 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2426 * elf32-arm.c (using_thumb_only): Update list of architectures in
2427 BFD_ASSERT for which the logic is valid.
2428 (using_thumb2_bl): Likewise.
2429 (using_thumb2): Likewise and return true for ARMv8-R.
2430 (arch_has_arm_nop): Likewise.
2431 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2432 merging logic. Update commentis for value 15 of v8m_baseline,
2433 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2434 merging of value 15 of Tag_CPU_arch.
2436 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2438 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2439 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2440 * bfd-in2.h: Regenerate.
2442 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2444 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2445 the error_alignment label forward. Properly align program
2446 property note section.
2448 2017-06-22 Eric Christopher <echristo@gmail.com>
2450 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2451 abs to fix a truncation warning.
2453 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2455 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2456 local undefined weak symbol to 0.
2457 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2459 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2461 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2462 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2463 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2464 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2465 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2466 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2467 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2468 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2470 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2472 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2473 (elf_i386_lazy_ibt_plt_entry): Likewise.
2474 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2475 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2476 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2477 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2478 (elf_i386_lazy_plt_layout): Likewise.
2479 (elf_i386_non_lazy_plt_layout): Likewise.
2480 (elf_i386_link_hash_entry): Add plt_second.
2481 (elf_i386_link_hash_table): Add plt_second and
2482 plt_second_eh_frame.
2483 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2484 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2485 the second PLT. Check the second PLT.
2486 (elf_i386_relocate_section): Use the second PLT to resolve
2487 PLT reference if needed.
2488 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2490 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2491 second PLT. Generate unwind info for the second PLT.
2492 (elf_i386_plt_type): Add plt_second.
2493 (elf_i386_get_synthetic_symtab): Support the second PLT.
2494 (elf_i386_parse_gnu_properties): Support
2495 GNU_PROPERTY_X86_FEATURE_1_AND.
2496 (elf_i386_merge_gnu_properties): Support
2497 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2498 on GNU_PROPERTY_X86_FEATURE_1_IBT
2499 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2500 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2501 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2502 is set on all relocatable inputs.
2503 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2504 (elf_x32_lazy_ibt_plt_entry): Likewise.
2505 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2506 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2507 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2508 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2509 (elf_x86_64_lazy_ibt_plt): Likewise.
2510 (elf_x32_lazy_ibt_plt): Likewise.
2511 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2512 (elf_x32_non_lazy_ibt_plt): Likewise.
2513 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2514 (elf_x86_64_parse_gnu_properties): Support
2515 GNU_PROPERTY_X86_FEATURE_1_AND.
2516 (elf_x86_64_merge_gnu_properties): Support
2517 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2518 on GNU_PROPERTY_X86_FEATURE_1_IBT
2519 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2520 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2521 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2522 is set on all relocatable inputs.
2524 2017-06-22 Nick Clifton <nickc@redhat.com>
2527 * som.c (setup_sections): NUL terminate the space_strings buffer.
2528 Check that the space.name field does not index beyond the end of
2529 the space_strings buffer.
2531 2017-06-21 Nick Clifton <nickc@redhat.com>
2534 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2536 2017-06-21 Nick Clifton <nickc@redhat.com>
2539 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2540 type of the size parameter.
2541 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2542 length of the counted string.
2543 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2544 (_bfd_vms_save_counted_string): Likewise.
2545 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2546 _bfd_vms_save_counted_string.
2547 (_bfd_vms_slurp_ehdr): Likewise.
2548 (_bfd_vms_slurp_egsd): Likewise.
2549 (Parse_module): Likewise.
2551 2017-06-21 Alan Modra <amodra@gmail.com>
2553 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2554 calls before tocsave calls.
2555 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2558 2017-06-21 Nick Clifton <nickc@redhat.com>
2561 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2562 bfd_get_full_section_contents returns no contents.
2564 2017-06-21 Nick Clifton <nickc@redhat.com>
2567 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2570 2017-06-21 Nick Clifton <nickc@redhat.com>
2573 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2575 (image_set_ptr): Likewise.
2576 (alpha_vms_fix_sec_rel): Likewise.
2577 (alpha_vms_slurp_relocs): Likewise.
2579 2017-06-21 Nick Clifton <nickc@redhat.com>
2582 * ieee.c (ieee_slurp_sections): Check for a NULL return from
2584 (ieee_archive_p): Likewise.
2585 (ieee_object_p): Likewise.
2587 2017-06-21 Nick Clifton <nickc@redhat.com>
2590 * elf.c (setup_group): Zero the group section pointer list after
2591 allocation so that loops can be caught. Check for NULL pointers
2592 when processing a group list.
2594 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2596 * elf-s390.h: New file.
2597 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2599 (elf_s390_additional_program_headers): New function.
2600 (elf_s390_modify_segment_map): New function.
2601 (bfd_elf_s390_set_options): New function.
2602 (elf_backend_additional_program_headers)
2603 (elf_backend_modify_segment_map): Add macro definitions.
2605 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
2608 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
2609 the DYNAMIC bit instead of bfd_count_sections.
2611 2017-06-19 Nick Clifton <nickc@redhat.com>
2614 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
2616 (evax_bfd_print_eeom): Likewise.
2617 (evax_bfd_print_egsd): Check for an overlarge record length.
2618 (evax_bfd_print_etir): Likewise.
2620 2017-06-19 Nick Clifton <nickc@redhat.com>
2623 * libieee.h (struct common_header_type): Add end_p field.
2624 * ieee.c (this_byte_and_next): Do not advance input_p beyond
2626 (read_id): Check for a length that exceeds the remaining bytes in
2628 (ieee_seek): Initialise end_p.
2629 (ieee_archive_p): Likewise.
2630 (ieee_object_p): Likewise.
2632 2017-06-19 Nick Clifton <nickc@redhat.com>
2635 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
2636 before reading the EIHS structure entries.
2638 2017-06-19 Nick Clifton <nickc@redhat.com>
2641 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
2642 gsd_size. Check that there are enough bytes remaining to read the
2643 type and size of the next egsd. Check that the size of the egsd
2644 does not exceed the size of the record.
2646 2017-06-19 Alan Modra <amodra@gmail.com>
2648 * config.bfd: Correct targ_underscore for cris.
2650 2017-06-18 Alan Modra <amodra@gmail.com>
2652 * config.bfd: Correct targ_underscore for epiphany, ip2k,
2653 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
2655 2017-06-16 Nick Clifton <nickc@redhat.com>
2657 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
2658 bucketlist is empty because there are no symbols to add to the
2661 2017-06-16 Alan Modra <amodra@gmail.com>
2667 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
2668 (BFD_JUMP_TABLE_LINK): Likewise.
2669 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
2670 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
2671 (bfd_elf_define_start_stop): New function.
2672 * linker.c (bfd_generic_define_start_stop): New function.
2673 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
2675 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
2676 * aout-target.h (MY_bfd_define_start_stop): Define.
2677 * aout-tic30.c (MY_bfd_define_start_stop): Define.
2678 * binary.c (binary_bfd_define_start_stop): Define.
2679 * bout.c (b_out_bfd_define_start_stop): Define.
2680 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
2681 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
2682 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
2683 * coffcode.h (coff_bfd_define_start_stop): Define.
2684 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
2685 * i386msdos.c (msdos_bfd_define_start_stop): Define.
2686 * i386os9k.c (os9k_bfd_define_start_stop): Define.
2687 * ieee.c (ieee_bfd_define_start_stop): Define.
2688 * ihex.c (ihex_bfd_define_start_stop): Define.
2689 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
2690 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
2691 * mmo.c (mmo_bfd_define_start_stop): Define.
2692 * nlm-target.h (nlm_bfd_define_start_stop): Define.
2693 * oasys.c (oasys_bfd_define_start_stop): Define.
2694 * pef.c (bfd_pef_bfd_define_start_stop): Define.
2695 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
2696 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
2697 * som.c (som_bfd_define_start_stop): Define.
2698 * srec.c (srec_bfd_define_start_stop): Define.
2699 * tekhex.c (tekhex_bfd_define_start_stop): Define.
2700 * versados.c (versados_bfd_define_start_stop): Define.
2701 * vms-alpha.c (vms_bfd_define_start_stop): Define.
2702 (alpha_vms_bfd_define_start_stop): Define.
2703 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
2704 * bfd-in2.h: Regenerate.
2705 * libbfd.h: Regenerate.
2707 2017-06-16 Jiong Wang <jiong.wang@arm.com>
2709 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
2710 SYMBOL_REFERENCES_LOCAL.
2712 2017-06-15 Jiong Wang <jiong.wang@arm.com>
2715 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
2716 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
2717 runtime for if there needs copy relocation elimination.
2718 (need_copy_relocation_p): New function. Return true for symbol with
2719 pc-relative references and if it's against read-only sections.
2720 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
2721 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
2722 that are related with accessing external objects.
2723 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
2724 in elfNN_aarch64_check_relocs.
2726 2017-06-15 Nick Clifton <nickc@redhat.com>
2729 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
2732 (ieee_archive_p): Likewise.
2734 2017-06-15 Nick Clifton <nickc@redhat.com>
2737 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
2739 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
2741 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
2742 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
2743 keep both windowed and call0 ABI PLT definitions.
2744 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
2745 elf_xtensa_*_plt_entry endex.
2746 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
2748 2017-06-14 Nick Clifton <nickc@redhat.com>
2751 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
2754 2017-06-14 Nick Clifton <nickc@redhat.com>
2757 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
2758 maximum value for the ascic pointer. Check that name processing
2759 does not read beyond this value.
2760 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
2763 2017-06-14 Nick Clifton <nickc@redhat.com>
2766 * versados.c (versados_mkobject): Zero the allocated tdata structure.
2767 (process_otr): Check for an invalid offset in the otr structure.
2769 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
2771 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
2773 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
2779 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
2780 vtable field to a union.
2781 (_bfd_elf_is_start_stop): Removed.
2782 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
2783 __start_SECNAME and __stop_SECNAME symbols.
2784 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
2785 * elflink.c (_bfd_elf_is_start_stop): Removed.
2786 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
2787 _bfd_elf_is_start_stop.
2788 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
2789 __stop_SECNAME symbols. Updated.
2790 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2791 (bfd_elf_gc_record_vtinherit): Likewise.
2792 (bfd_elf_gc_record_vtentry): Likewise.
2794 2017-06-13 Nick Clifton <nickc@redhat.com>
2797 * elflink.c (elf_link_adjust_relocs): Generate an error when
2798 encountering a reloc against a symbol removed by garbage
2801 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
2803 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
2804 to merge_gnu_properties.
2805 * elf-properties.c (elf_merge_gnu_properties): Add struct
2806 bfd_link_info * and pass it to merge_gnu_properties.
2807 (elf_merge_gnu_property_list): Add struct bfd_link_info *
2808 and pass it to elf_merge_gnu_properties.
2809 (_bfd_elf_link_setup_gnu_properties): Pass info to
2810 elf_merge_gnu_property_list.
2811 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
2813 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
2815 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
2818 * binary.c (binary_set_section_contents): Scale lma by octets
2819 per byte to set filepos.
2821 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2823 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
2826 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2828 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
2831 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2833 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
2834 patched section contents for TLS IE reloc.
2835 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
2837 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2839 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
2840 RELOC_FOR_GLOBAL_SYMBOL macro.
2842 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2844 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
2847 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2849 * config/tc-arc.c (md_undefined_symbol): Changed.
2850 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
2852 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2854 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
2857 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2859 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
2860 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
2862 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2864 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
2867 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
2869 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
2870 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
2871 is non-zero. Add clarifying comments.
2873 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
2875 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
2876 name. Use local IFUNC symbol name string to report unsupported
2877 non-PIC call to IFUNC function.
2878 (elf_i386_relocate_section): Dump local IFUNC name with minfo
2879 when generating R_386_IRELATIVE relocation.
2880 (elf_i386_finish_dynamic_symbol): Likewise.
2881 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
2883 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
2884 when generating R_X86_64_IRELATIVE relocation.
2885 (elf_x86_64_finish_dynamic_symbol): Likewise.
2887 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2889 * elf.c (setup_group): Make sure BFD sections are created for all
2890 group sections in the input file when processing SHF_GROUP
2892 (bfd_section_from_shdr): Avoid duplicating logic already
2893 implemented in `setup_group'.
2895 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
2898 * peXXigen.c (pe_print_idata): Use the address of the first thunk
2899 if the hint address is zero.
2901 2017-06-06 James Clarke <jrtc27@jrtc27.com>
2904 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
2905 ELF_COMMON_DEF_P for common symbols.
2907 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
2909 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
2910 SEC_GROUP sections as SEC_EXCLUDE.
2911 (bfd_elf_set_group_contents): Replace use of abort with an assert.
2912 (assign_section_numbers): Use resolve_section_groups flag instead
2913 of relocatable link type.
2914 (_bfd_elf_init_private_section_data): Use resolve_section_groups
2915 flag instead of checking the final_link flag for part of the
2916 checks in here. Fix white space as a result.
2917 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
2918 instead of relocatable link type.
2919 (bfd_elf_final_link): Likewise.
2921 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2923 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
2925 * elf32-score.c (score_elf_final_link_relocate): Likewise.
2926 (s3_bfd_score_elf_check_relocs): Likewise.
2927 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2928 (score_elf_final_link_relocate): Likewise.
2929 (s7_bfd_score_elf_check_relocs): Likewise.
2931 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2933 * elflink.c (init_reloc_cookie_rels): Remove unused variable
2936 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
2938 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
2939 from `reloc_count' rather than decrementing it.
2940 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
2941 `reloc_count' by `int_rels_per_ext_rel'.
2942 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
2943 `reloc_count' by `int_rels_per_ext_rel' for last relocation
2944 entry determination.
2945 (s3_bfd_score_elf_check_relocs): Likewise.
2946 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
2947 (s7_bfd_score_elf_relocate_section): Likewise.
2948 (s7_bfd_score_elf_check_relocs): Likewise.
2949 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
2950 prototype and function.
2951 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
2952 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
2953 triple rather than once the sum of REL and RELA relocation entry
2955 (bfd_elf64_get_reloc_upper_bound): Remove macro.
2956 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
2957 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
2958 storage allocation size determination.
2959 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
2960 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
2961 by `int_rels_per_ext_rel' for last relocation entry
2963 (bfd_elf_final_link): Do not multiply `reloc_count' by
2964 `int_rels_per_ext_rel' for internal relocation storage
2965 allocation size determination.
2966 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
2967 `int_rels_per_ext_rel' for last relocation entry determination.
2968 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2969 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2970 (_bfd_mips_elf_relocate_section): Likewise.
2972 2017-06-05 Alan Modra <amodra@gmail.com>
2975 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
2977 2017-06-01 John Baldwin <jhb@FreeBSD.org>
2979 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
2980 determine structure sizes.
2981 (elfcore_grok_freebsd_prstatus): Likewise.
2983 2017-06-01 Alan Modra <amodra@gmail.com>
2985 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
2986 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
2988 (is_elfv2_localentry0): New function.
2989 (ppc64_elf_tls_setup): Default params->plt_localentry0.
2990 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
2991 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
2992 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
2993 optimized localentry:0 stubs.
2994 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
2995 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
2997 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
2999 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3001 2017-05-30 Casey Smith <clegg89@gmail.com>
3004 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
3005 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
3007 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
3009 * cpu-arc.c (arc_compatible): New function.
3011 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
3013 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
3015 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
3018 * bfdio.c (bfd_get_file_size): New function.
3019 * bfd-in2.h: Regenerated.
3021 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
3023 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
3026 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
3028 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
3029 dynobj instead of htab->elf.dynobj.
3031 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
3033 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
3035 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
3036 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
3037 actual number of internal relocations retrieved. Adjust
3038 function description.
3039 (bfd_elf64_canonicalize_reloc): Remove macro.
3040 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
3042 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
3044 * archures.c (bfd_mach_sparc_v9m8): Define.
3045 (bfd_mach_sparc_v8plusm8): Likewise.
3046 (bfd_mach_sparc_v9_p): Adjust to M8.
3047 (bfd_mach_sparc_64bit_p): Likewise.
3048 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
3049 bfd_mach_sparc_v8plusm8.
3050 * bfd-in2.h: Regenerated.
3051 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
3053 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
3054 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
3055 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
3057 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3058 bfd_mach_sparc_v8plusm8.
3060 2017-05-19 Alan Modra <amodra@gmail.com>
3062 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
3063 debug and special sections when no non-note alloc sections in an
3066 2017-05-18 Alan Modra <amodra@gmail.com>
3068 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
3069 * elf-m10300.c: Likewise.
3071 * elf32-arc.c: Likewise.
3072 * elf32-bfin.c: Likewise.
3073 * elf32-m68k.c: Likewise.
3074 * elf32-nds32.c: Likewise.
3075 * elf32-tilepro.c: Likewise.
3076 * elflink.c: Likewise.
3077 * elfnn-aarch64.c: Likewise.
3078 * elfnn-riscv.c: Likewise.
3079 * elfxx-tilegx.c: Likewise.
3080 * mach-o.c: Likewise.
3081 * peXXigen.c: Likewise.
3082 * vms-alpha.c: Likewise.
3083 * vms-lib.c: Likewise.
3085 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3088 * elflink.c (elf_gc_mark_debug_section): New function.
3089 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3090 referenced by kept debug sections.
3092 2017-05-16 Alan Modra <amodra@gmail.com>
3094 * elf-m10300.c: Rename occurrences of non_ir_ref.
3095 * elf32-arm.c: Likewise.
3096 * elf32-bfin.c: Likewise.
3097 * elf32-cr16.c: Likewise.
3098 * elf32-cris.c: Likewise.
3099 * elf32-d10v.c: Likewise.
3100 * elf32-dlx.c: Likewise.
3101 * elf32-fr30.c: Likewise.
3102 * elf32-frv.c: Likewise.
3103 * elf32-hppa.c: Likewise.
3104 * elf32-i370.c: Likewise.
3105 * elf32-i386.c: Likewise.
3106 * elf32-iq2000.c: Likewise.
3107 * elf32-lm32.c: Likewise.
3108 * elf32-m32c.c: Likewise.
3109 * elf32-m32r.c: Likewise.
3110 * elf32-m68hc1x.c: Likewise.
3111 * elf32-m68k.c: Likewise.
3112 * elf32-mcore.c: Likewise.
3113 * elf32-metag.c: Likewise.
3114 * elf32-microblaze.c: Likewise.
3115 * elf32-moxie.c: Likewise.
3116 * elf32-msp430.c: Likewise.
3117 * elf32-mt.c: Likewise.
3118 * elf32-nios2.c: Likewise.
3119 * elf32-or1k.c: Likewise.
3120 * elf32-ppc.c: Likewise.
3121 * elf32-rl78.c: Likewise.
3122 * elf32-s390.c: Likewise.
3123 * elf32-score.c: Likewise.
3124 * elf32-score7.c: Likewise.
3125 * elf32-sh.c: Likewise.
3126 * elf32-tic6x.c: Likewise.
3127 * elf32-tilepro.c: Likewise.
3128 * elf32-v850.c: Likewise.
3129 * elf32-vax.c: Likewise.
3130 * elf32-xstormy16.c: Likewise.
3131 * elf32-xtensa.c: Likewise.
3132 * elf64-alpha.c: Likewise.
3133 * elf64-hppa.c: Likewise.
3134 * elf64-ia64-vms.c: Likewise.
3135 * elf64-mmix.c: Likewise.
3136 * elf64-ppc.c: Likewise.
3137 * elf64-s390.c: Likewise.
3138 * elf64-sh64.c: Likewise.
3139 * elf64-x86-64.c: Likewise.
3140 * elflink.c: Likewise.
3141 * elfnn-aarch64.c: Likewise.
3142 * elfnn-ia64.c: Likewise.
3143 * elfnn-riscv.c: Likewise.
3144 * elfxx-mips.c: Likewise.
3145 * elfxx-sparc.c: Likewise.
3146 * elfxx-tilegx.c: Likewise.
3147 * linker.c: Likewise.
3149 2017-05-16 Alan Modra <amodra@gmail.com>
3151 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3152 * elflink.c (elf_link_add_object_symbols): Update to use
3154 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3156 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3158 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3160 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3162 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3164 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3165 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3167 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3169 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3171 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3173 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3174 to plt_second/plt_second_eh_frame.
3175 (elf_x86_64_link_hash_newfunc): Updated.
3176 (elf_x86_64_allocate_dynrelocs): Likewise.
3177 (elf_x86_64_size_dynamic_sections): Likewise.
3178 (elf_x86_64_relocate_section): Likewise.
3179 (elf_x86_64_finish_dynamic_symbol): Likewise.
3180 (elf_x86_64_finish_dynamic_sections): Likewise.
3181 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3182 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3184 (elf_backend_setup_gnu_properties): Updated. Create the
3185 .plt.sec section instead of the .plt.sec section.
3187 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3189 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3190 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3191 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3193 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3195 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3196 (bfd_elf64_set_reloc): Define.
3197 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3199 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3201 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3202 (struct bfd_target): New field _bfd_set_reloc.
3203 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3204 * reloc.c (_bfd_generic_set_reloc): New function.
3205 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3206 * nlm-target.h (nlm_set_reloc): Likewise.
3207 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3208 * aout-tic30.c (MY_set_reloc): Likewise.
3209 * aout-target.h (MY_set_reloc): Likewise.
3210 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3211 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3212 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3213 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3214 * aout-adobe.c (aout_32_set_reloc): Likewise.
3215 * bout.c (b_out_set_reloc): Likewise.
3216 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3217 * i386os9k.c (aout_32_set_reloc): Likewise.
3218 * ieee.c (ieee_set_reloc): Likewise.
3219 * oasys.c (oasys_set_reloc): Likewise.
3220 * som.c (som_set_reloc): Likewise.
3221 * versados.c (versados_set_reloc): Likewise.
3222 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3223 _bfd_generic_set_reloc.
3224 (rs6000_xcoff64_aix_vec): LIkewise.
3225 * libbfd.c (_bfd_norelocs_set_reloc): New function.
3226 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3227 * i386msdos.c (msdos_set_reloc): Define to
3228 _bfd_norelocs_set_reloc.
3229 * elfcode.h (elf_set_reloc): Define.
3230 * bfd-in2.h: Regenerated.
3232 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
3235 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3236 for IFUNC function address.
3238 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
3240 * elf32-arc.c (FEATURE_LIST_NAME): Define.
3241 (CONFLICT_LIST): Likewise.
3242 (opcode/arc-attrs.h): Include.
3243 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3244 (arc_extract_features): New file.
3245 (arc_stralloc): Likewise.
3246 (arc_elf_merge_attributes): Likewise.
3247 (arc_elf_merge_private_bfd_data): Use object attributes.
3248 (bfd_arc_get_mach_from_attributes): New function.
3249 (arc_elf_object_p): Use object attributes.
3250 (arc_elf_final_write_processing): Likewise.
3251 (elf32_arc_obj_attrs_arg_type): New function.
3252 (elf32_arc_obj_attrs_handle_unknown): Likewise.
3253 (elf32_arc_section_from_shdr): Likewise.
3254 (elf_backend_obj_attrs_vendor): Define.
3255 (elf_backend_obj_attrs_section): Likewise.
3256 (elf_backend_obj_attrs_arg_type): Likewise.
3257 (elf_backend_obj_attrs_section_type): Likewise.
3258 (elf_backend_obj_attrs_handle_unknown): Likewise.
3259 (elf_backend_section_from_shdr): Likewise.
3261 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
3264 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3265 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3266 and the destination is a Thumb symbol.
3268 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3270 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3271 initializer to silence GCC 4.2.
3272 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3274 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3276 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3277 (LAZY_PLT_ENTRY_SIZE): This.
3278 (NON_LAZY_PLT_ENTRY_SIZE): New.
3279 (elf_x86_64_plt0_entry): Renamed to ...
3280 (elf_x86_64_lazy_plt0_entry): This.
3281 (elf_x86_64_plt_entry): Renamed to ...
3282 (elf_x86_64_lazy_plt_entry): This.
3283 (elf_x86_64_bnd_plt0_entry): Renamed to ...
3284 (elf_x86_64_lazy_bnd_plt0_entry): This.
3285 (elf_x86_64_legacy_plt_entry): Removed.
3286 (elf_x86_64_bnd_plt_entry): Renamed to ...
3287 (elf_x86_64_lazy_bnd_plt_entry): This.
3288 (elf_x86_64_legacy_plt2_entry): Renamed to ...
3289 (elf_x86_64_non_lazy_plt_entry): This.
3290 (elf_x86_64_bnd_plt2_entry): Renamed to ...
3291 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3292 (elf_x86_64_eh_frame_plt): Renamed to ...
3293 (elf_x86_64_eh_frame_lazy_plt): This.
3294 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3295 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3296 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3297 (elf_x86_64_eh_frame_non_lazy_plt): This.
3298 (elf_x86_64_lazy_plt_layout): New.
3299 (elf_x86_64_non_lazy_plt_layout): Likewise.
3300 (elf_x86_64_plt_layout): Likewise.
3301 (elf_x86_64_backend_data): Remove PLT layout information. Add
3302 os for target system.
3303 (GET_PLT_ENTRY_SIZE): Removed.
3304 (elf_x86_64_lazy_plt): New.
3305 (elf_x86_64_non_lazy_plt): Likewise.
3306 (elf_x86_64_lazy_bnd_plt): Likewise.
3307 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3308 (elf_x86-64_arch_bed): Updated.
3309 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3310 (elf_x86_64_create_dynamic_sections): Removed.
3311 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3312 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3313 (elf_x86-64_adjust_dynamic_symbol): Updated.
3314 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3315 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3316 size for PLT0 if there is no PLT0. Get plt_entry_size from
3317 non_lazy_plt for non-lazy PLT entries.
3318 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3319 from non_lazy_plt for non-lazy PLT entries.
3320 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3321 if there is no PLT0.
3322 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3323 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3324 entries with non-lazy PLT layout. Don't fill the second and third
3325 slots in the PLT entry if there is no PLT0.
3326 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3327 if there is no PLT0. Set sh_entsize on the .plt.got section.
3328 (compare_relocs): New.
3329 (elf_x86_64_plt_type): Likewise.
3330 (elf_x86_64_plt): Likewise.
3331 (elf_x86_64_nacl_plt): New. Forward declaration.
3332 (elf_x86_64_get_plt_sym_val): Removed.
3333 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3334 against all dynamic relocations.
3335 (elf_x86_64_link_setup_gnu_properties): New function.
3336 (elf_backend_create_dynamic_sections): Updated.
3337 (elf_backend_setup_gnu_properties): New.
3338 (elf_x86_64_nacl_plt): New.
3339 (elf_x86_64_nacl_arch_bed): Updated.
3341 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3343 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3344 (LAZY_PLT_ENTRY_SIZE): This.
3345 (NON_LAZY_PLT_ENTRY_SIZE): New.
3346 (elf_i386_plt0_entry): Renamed to ...
3347 (elf_i386_lazy_plt0_entry): This.
3348 (elf_i386_plt_entry): Renamed to ...
3349 (elf_i386_lazy_plt_entry): This.
3350 (elf_i386_pic_plt0_entry): Renamed to ...
3351 (elf_i386_pic_lazy_plt0_entry): This.
3352 (elf_i386_pic_plt_entry): Renamed to ...
3353 (elf_i386_pic_lazy_plt_entry): This.
3354 (elf_i386_got_plt_entry): Renamed to ...
3355 (elf_i386_non_lazy_plt_entry): This.
3356 (elf_i386_pic_got_plt_entry): Renamed to ...
3357 (elf_i386_pic_non_lazy_plt_entry): This.
3358 (elf_i386_eh_frame_plt): Renamed to ...
3359 (elf_i386_eh_frame_lazy_plt): This.
3360 (elf_i386_eh_frame_plt_got): Renamed to ...
3361 (elf_i386_eh_frame_non_lazy_plt): This.
3362 (elf_i386_plt_layout): Renamed to ...
3363 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3364 eh_frame_plt_got_size.
3365 (elf_i386_non_lazy_plt_layout): New.
3366 (elf_i386_plt_layout): Likewise.
3367 (elf_i386_non_lazy_plt): Likewise.
3368 (GET_PLT_ENTRY_SIZE): Removed.
3369 (elf_i386_plt): Renamed to ...
3370 (elf_i386_lazy_plt): This.
3371 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3372 (elf_i386_arch_bed): Updated.
3373 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3374 (elf_i386_create_dynamic_sections): Removed.
3375 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3376 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3377 (elf_i386_adjust_dynamic_symbol): Updated.
3378 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3379 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3380 size for PLT0 if there is no PLT0.
3381 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3382 output section is discarded only if GOT isn't empty.
3383 (elf_i386_relocate_section): Updated. Properly get PLT index
3384 if there is no PLT0.
3385 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3386 second and third slots in the PLT entry if there is no PLT0.
3387 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3388 if there is no PLT0. Set sh_entsize on the .plt.got section.
3389 (elf_i386_nacl_plt): Forward declaration.
3390 (elf_i386_get_plt_sym_val): Removed.
3391 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3392 against all dynamic relocations.
3393 (elf_i386_link_setup_gnu_properties): New function.
3394 (elf_backend_create_dynamic_sections): Updated.
3395 (elf_backend_setup_gnu_properties): New.
3396 (elf_i386_nacl_plt): Updated.
3397 (elf_i386_nacl_arch_bed): Likewise.
3398 (elf_i386_vxworks_arch_bed): Likewise.
3400 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3402 * elflink.c (elf_output_implib): Remove executable flag from import
3404 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3405 library is a relocatable object file.
3407 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3410 * elf32-avr.c (avr_should_move_sym): New function.
3411 (avr_should_reduce_sym_size): Likewise.
3412 (avr_should_increase_sym_size): Likewise.
3413 (elf32_avr_relax_delete_bytes): Adjust symbol values
3414 and sizes by calling new functions.
3416 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3418 * config.bfd (riscv32-*): Enable rv64.
3420 2017-05-02 Alan Modra <amodra@gmail.com>
3423 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3424 rather than h->root.type == bfd_link_hash_new.
3425 (bfd_elf_record_link_assignment): Similarly, call
3426 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3428 2017-04-29 Alan Modra <amodra@gmail.com>
3431 * reloc.c (reloc_offset_in_range): New function.
3432 (bfd_perform_relocation, bfd_install_relocation): Use it.
3433 (_bfd_final_link_relocate): Likewise.
3435 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3437 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3438 before using .plt.got.
3439 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3441 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3443 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3444 instead of "+=" to update 0.
3446 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3448 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3449 .plt.got section here.
3450 (elf_i386_check_relocs): Don't create the .plt.got section.
3451 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3452 the .plt.got and .plt.bnd sections here.
3453 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3456 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3458 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3460 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3461 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3462 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3463 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3466 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3468 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3470 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3471 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3472 the first relocatable ELF input with GNU properties.
3474 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3476 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3477 VxWorks for non-PIC.
3479 2017-04-27 Alan Modra <amodra@gmail.com>
3481 * elf-bfd.h (struct elf_backend_data): Make asection param of
3482 elf_backend_eh_frame_address_size const.
3483 (_bfd_elf_eh_frame_address_size): Likewise.
3484 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3485 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3486 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3487 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3488 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3489 (next_cie_fde_offset): Constify params.
3490 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3492 2017-04-27 Alan Modra <amodra@gmail.com>
3494 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3495 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3496 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3498 (offset_adjust): New function.
3499 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3500 (adjust_eh_frame_local_symbols): Likewise.
3501 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3502 after changing anything. Return true if anything changed.
3503 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3504 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3506 2017-04-27 Alan Modra <amodra@gmail.com>
3508 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3511 2017-04-27 Alan Modra <amodra@gmail.com>
3513 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3514 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3515 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3516 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3517 for undef and undefweak dyn_relocs.
3518 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3519 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3520 (allocate_got, allocate_dynrelocs): Likewise.
3521 (ppc64_elf_relocate_section): Likewise.
3523 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3525 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3526 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3527 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3528 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3530 2017-04-26 Nick Clifton <nickc@redhat.com>
3533 * reloc.c (bfd_perform_relocation): Check for a negative address
3536 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3539 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3541 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3542 (elf_backend_always_renumber_dynsyms): Define.
3543 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3544 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3545 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3546 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3548 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3550 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3552 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3553 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3554 sections have been created.
3556 2017-04-26 Nick Clifton <nickc@redhat.com>
3559 * compress.c (bfd_init_section_compress_status): Check the return
3560 value from bfd_malloc.
3562 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3564 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3565 no_finish_dynamic_symbol.
3566 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3568 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3569 weak symbol, don't make it dynamic.
3570 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3571 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3572 relocation for GOT reference.
3573 (elf_x86_64_finish_dynamic_symbol): Abort if
3574 no_finish_dynamic_symbol isn't 0.
3576 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3579 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3580 undefined weak symbol, don't make it dynamic.
3581 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3582 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3583 relocation for R_386_GOT32.
3585 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3588 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3590 2017-04-23 Alan Modra <amodra@gmail.com>
3593 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3594 * elf.c (lcomm_sym): New.
3595 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3596 * bfd-in2.h: Regenerate.
3598 2017-04-23 Alan Modra <amodra@gmail.com>
3601 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3602 parameters and comment.
3603 (_bfd_elf_get_reloc_section): Delete.
3604 (_bfd_elf_plt_get_reloc_section): Declare.
3605 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3606 New functions. Don't blindly skip over assumed .rel/.rela prefix.
3608 (_bfd_elf_get_reloc_section): ..here. Delete.
3609 (assign_section_numbers): Call elf_get_reloc_section.
3610 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
3611 * elfxx-target.h (elf_backend_get_reloc_section): Update.
3613 2017-04-23 Alan Modra <amodra@gmail.com>
3616 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
3619 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3622 * elf32-i386.c (elf_i386_link_hash_entry): Add
3623 no_finish_dynamic_symbol.
3624 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
3625 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
3626 symbol, don't make it dynamic in PIE.
3627 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
3628 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3629 relocation for R_386_GOT32
3630 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
3633 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3637 * elflink.c (elf_link_add_object_symbols): Require
3638 --no-dynamic-linker with -E/--dynamic-list when creating
3641 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3643 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
3646 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3648 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
3649 dynamic symbol sorting.
3651 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
3654 * elflink.c (elf_link_add_object_symbols): Preserve
3655 dynamic_ref_after_ir_def when restoring the symbol table for
3656 unneeded dynamic object.
3658 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
3661 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
3662 on on undefined IFUNC symbol in the second PLT.
3664 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
3666 * peXXigen.c (pe_print_reloc): Correct chunk_end.
3668 2017-04-19 Alan Modra <amodra@gmail.com>
3670 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
3671 or make dynamic for info->dynamic_undefined_weak 0 and 1.
3672 * elf32-ppc.c:Formatting.
3673 (ensure_undefweak_dynamic): Don't make dynamic when
3674 info->dynamic_undefined_weak is zero.
3675 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3676 info->dynamic_undefined_weak. Discard undef dyn_relocs when
3677 not default visibility. Discard undef and undefweak
3679 (ppc_elf_relocate_section): Adjust to suit.
3680 * elf64-ppc.c: Formatting.
3681 (ensure_undefweak_dynamic): Don't make dynamic when
3682 info->dynamic_undefined_weak is zero.
3683 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3684 info->dynamic_undefined_weak. Discard them earlier.
3686 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
3689 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
3690 before generating the version definition section.
3692 2017-04-17 Alan Modra <amodra@gmail.com>
3694 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
3695 state when a regular object file defines a symbol with
3696 incompatible type to that defined by an earlier shared lib.
3698 2017-04-13 Alan Modra <amodra@gmail.com>
3700 * coffcode.h: Wrap some overly long _bfd_error_handler args.
3702 * elf32-arm.c: Likewise.
3703 * elf32-i386.c: Likewise.
3704 * elf32-mep.c: Likewise.
3705 * elf64-ia64-vms.c: Likewise.
3706 * elf64-x86-64.c: Likewise.
3707 * elflink.c: Likewise.
3708 * elfnn-ia64.c: Likewise.
3709 * elfxx-mips.c: Likewise.
3711 2017-04-13 Alan Modra <amodra@gmail.com>
3713 * aoutx.h: Use %B and %A in error messages throughout file.
3714 * aout-cris.c: Likewise.
3715 * archive.c: Likewise.
3716 * binary.c: Likewise.
3717 * coff-rs6000.c: Likewise.
3718 * coff-tic4x.c: Likewise.
3719 * coffcode.h: Likewise.
3720 * coffgen.c: Likewise.
3721 * cofflink.c: Likewise.
3722 * coffswap.h: Likewise.
3723 * cpu-arm.c: Likewise.
3724 * elf-eh-frame.c: Likewise.
3725 * elf-m10300.c: Likewise.
3727 * elf32-arc.c: Likewise.
3728 * elf32-arm.c: Likewise.
3729 * elf32-bfin.c: Likewise.
3730 * elf32-frv.c: Likewise.
3731 * elf32-iq2000.c: Likewise.
3732 * elf32-m32c.c: Likewise.
3733 * elf32-microblaze.c: Likewise.
3734 * elf32-nds32.c: Likewise.
3735 * elf32-rl78.c: Likewise.
3736 * elf32-rx.c: Likewise.
3737 * elf32-score.c: Likewise.
3738 * elf32-score7.c: Likewise.
3739 * elf32-sh64.c: Likewise.
3740 * elf32-v850.c: Likewise.
3741 * elf32-vax.c: Likewise.
3742 * elf32-visium.c: Likewise.
3743 * elf64-ia64-vms.c: Likewise.
3744 * elf64-mmix.c: Likewise.
3745 * elf64-sh64.c: Likewise.
3746 * elfcode.h: Likewise.
3747 * elfnn-aarch64.c: Likewise.
3748 * elfnn-ia64.c: Likewise.
3749 * elfxx-mips.c: Likewise.
3750 * hpux-core.c: Likewise.
3753 * linker.c: Likewise.
3754 * merge.c: Likewise.
3756 * oasys.c: Likewise.
3757 * pdp11.c: Likewise.
3758 * peXXigen.c: Likewise.
3759 * rs6000-core.c: Likewise.
3760 * vms-alpha.c: Likewise.
3761 * xcofflink.c: Likewise.
3763 2017-04-13 Alan Modra <amodra@gmail.com>
3765 * bfd.c (PRINT_TYPE): Define.
3766 (_doprnt): New function.
3767 (error_handler_internal): Use _doprnt.
3768 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
3769 calls in their natural order, throughout file.
3770 * coff-mcore.c: Likewise.
3771 * coff-ppc.c: Likewise.
3772 * coff-tic80.c: Likewise.
3773 * cofflink.c: Likewise.
3774 * elf-s390-common.c: Likewise.
3776 * elf32-arm.c: Likewise.
3777 * elf32-i386.c: Likewise.
3778 * elf32-m32r.c: Likewise.
3779 * elf32-msp430.c: Likewise.
3780 * elf32-spu.c: Likewise.
3781 * elf64-ia64-vms.c: Likewise.
3782 * elf64-sparc.c: Likewise.
3783 * elf64-x86-64.c: Likewise.
3784 * elflink.c: Likewise.
3785 * elfnn-aarch64.c: Likewise.
3786 * elfnn-ia64.c: Likewise.
3787 * elfxx-mips.c: Likewise.
3789 2017-04-13 Alan Modra <amodra@gmail.com>
3791 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
3792 branch veneers" error. Fix double space and format message.
3793 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
3794 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
3796 2017-04-13 Alan Modra <amodra@gmail.com>
3798 * bfd-in2.h: Regenerate.
3800 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3802 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
3803 extra `\n' in warning/error messages.
3804 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
3805 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3807 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3809 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
3810 processor-specific properties with generic ELF target vector.
3812 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
3814 * elf32-sparc.c (elf_backend_fixup_symbol): New.
3815 * elf64-sparc.c (elf_backend_fixup_symbol): New.
3816 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
3817 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
3819 (link_hash_newfunc): Initialize has_got_reloc and
3821 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
3823 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
3825 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
3827 (_bfd_sparc_elf_fixup_symbol): New function.
3828 (allocate_dynrelocs): Don't allocate space for dynamic
3829 relocations and discard relocations against resolved undefined
3830 weak symbols in executable. Don't make resolved undefined weak
3831 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
3832 relocation against undefined weak symbols in PIE.
3833 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
3834 relocations against resolved undefined weak symbols in PIE
3835 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
3836 without ynamic PLT/GOT relocations for resolved undefined weak
3838 Don't generate dynamic relocation against resolved undefined
3839 weak symbol in executable.
3840 (pie_finish_undefweak_symbol): New function.
3841 (_bfd_sparc_elf_finish_dynamic_sections): Call
3842 pie_finish_undefweak_symbol on all symbols in PIE.
3843 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
3844 (_bfd_sparc_elf_fixup_symbol): New function.
3846 2017-04-10 Nick Clifton <nickc@redhat.com>
3848 * config.bfd: Remove ns32k from obsolete list.
3850 2017-04-10 Alan Modra <amodra@gmail.com>
3853 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
3854 (special_sections_i): Likewise for .init_array.
3855 (special_sections_p): Likewise for .preinit_array.
3857 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
3861 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
3862 ELF_COMMON_DEF_P for common symbols.
3863 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3864 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
3865 * elflink.c (_bfd_elf_merge_symbol): Revert commits
3866 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
3867 07492f668d2173da7a2bda3707ff0985e0f460b6.
3869 2017-04-07 Pedro Alves <palves@redhat.com>
3871 * opncls.c (bfd_get_debug_link_info): Rename to...
3872 (bfd_get_debug_link_info_1): ... this. Change type of second
3873 parameter to void pointer. Adjust.
3874 (bfd_get_debug_link_info): Reimplement on top of
3875 bfd_get_debug_link_info_1.
3876 (separate_debug_file_exists, separate_alt_debug_file_exists):
3877 Change type of second parameter to void pointer. Adjust.
3878 (get_func_type, check_func_type): Change type of second parameter
3880 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
3881 the callback functions instead of passing the address of a local.
3882 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
3883 find_separate_debug_file.
3884 (get_alt_debug_link_info_shim): Change type of second parameter to
3885 void pointer. Adjust.
3886 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
3887 find_separate_debug_file.
3888 (get_build_id_name, bfd_boolean check_build_id_file): Change type
3889 of second parameter to void pointer. Adjust.
3890 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
3891 pointer local to find_separate_debug_file.
3893 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
3895 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
3896 external symbols with a definition.
3897 (_bfd_coff_gc_mark_extra_sections): Fix typo.
3899 2017-04-07 Alan Modra <amodra@gmail.com>
3901 * po/SRC-POTFILES.in: Regenerate.
3903 2017-04-05 Alan Modra <amodra@gmail.com>
3905 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
3908 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
3910 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
3911 numbers for DataDirectory entry indicies passed to
3914 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
3916 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
3917 each GNU_MBIND section and align GNU_MBIND section to page size.
3918 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
3919 segment for each GNU_MBIND section.
3920 (_bfd_elf_init_private_section_data): Copy sh_info from input
3921 for GNU_MBIND section.
3923 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
3925 * elfnn-riscv.c (GP_NAME): Delete.
3926 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
3927 (_bfd_riscv_relax_lui): Likewise.
3929 2017-04-04 Nick Clifton <nickc@redhat.com>
3932 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
3934 (bfd_elf_final_link): Only initialize the extended symbol index
3935 section if there are extended symbol tables to list.
3937 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
3939 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
3940 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
3941 * configure.ac (elf): Add elf-properties.lo.
3942 * Makefile.in: Regenerated.
3943 * configure: Likewise.
3944 * elf-bfd.h (elf_property_kind): New.
3945 (elf_property): Likewise.
3946 (elf_property_list): Likewise.
3947 (elf_properties): Likewise.
3948 (_bfd_elf_parse_gnu_properties): Likewise.
3949 (_bfd_elf_get_property): Likewise.
3950 (_bfd_elf_link_setup_gnu_properties): Likewise.
3951 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
3952 and setup_gnu_properties.
3953 (elf_obj_tdata): Add properties.
3954 * elf-properties.c: New file.
3955 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
3956 (elf_i386_merge_gnu_properties): Likewise.
3957 (elf_backend_parse_gnu_properties): Likewise.
3958 (elf_backend_merge_gnu_properties): Likewise.
3959 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3960 (elf_x86_64_merge_gnu_properties): Likewise.
3961 (elf_backend_parse_gnu_properties): Likewise.
3962 (elf_backend_merge_gnu_properties): Likewise.
3963 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
3964 (elf_backend_parse_gnu_properties): Likewise.
3965 (elf_backend_setup_gnu_properties): Likewise.
3966 (elfNN_bed): Add elf_backend_parse_gnu_properties,
3967 elf_backend_merge_gnu_properties and
3968 elf_backend_setup_gnu_properties.
3970 2017-03-30 Pip Cet <pipcet@gmail.com>
3972 * elf32-wasm32.c: Add relocation code, two relocs.
3973 * reloc.c: Add wasm32 relocations.
3974 * libbfd.h: Regenerate.
3975 * bfd-in2.h: Regenerate.
3976 * bfd/po/bfd.pot: Regenerate.
3978 2017-03-29 Nick Clifton <nickc@redhat.com>
3981 * coff-bfd.h (struct coff_section_data): Add new fields:
3982 saved_bias and bias.
3983 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
3984 computed for PE binaries.
3985 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
3988 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
3991 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
3992 to handle a local symbol with a hash-symbol-entry; without PLT.
3993 Add BFD_ASSERT for an incidental case with GOT entry present.
3994 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
3995 isn't forced-or-set local.
3997 2017-03-27 Pip Cet <pipcet@gmail.com>
3999 * wasm-module.c: New file to support WebAssembly modules.
4000 * wasm-module.h: New file to support WebAssembly modules.
4001 * doc/webassembly.texi: Start documenting wasm-module.c.
4002 * config.bfd: Add wasm_vec.
4003 * targets.c: Likewise.
4004 * configure.ac: Likewise.
4005 * Makefile.am: Add entries for wasm-module.c.
4006 * Makefile.in: Regenerate.
4007 * configure: Regenerate.
4008 * po/SRC-POTFILES.in: Regenerate.
4010 2017-03-27 Pip Cet <pipcet@gmail.com>
4012 * cpu-wasm32.c: New file to support wasm32 architecture.
4013 * elf32-wasm32.c: New file to support wasm32 architecture.
4014 * Makefile.am: Add wasm32 architecture.
4015 * archures.c: Likewise.
4016 * config.bfd: Likewise.
4017 * configure.ac: Likewise.
4018 * targets.c: Likewise.
4019 * Makefile.in: Regenerate.
4020 * bfd-in2.h: Regenerate.
4021 * configure: Regenerate.
4022 * po/SRC-POTFILES.in: Regenerate.
4024 2017-03-20 Alan Modra <amodra@gmail.com>
4027 * elf64-ppc.c (compare_symbols): Stabilize sort.
4029 2017-03-18 Alan Modra <amodra@gmail.com>
4031 * elf64-ppc.c (struct ppc_link_hash_table): Add
4032 local_ifunc_resolver and maybe_local_ifunc_resolver.
4033 (ppc_build_one_stub): Set flags on emitting dynamic
4034 relocation to ifunc.
4035 (ppc64_elf_relocate_section): Likewise.
4036 (ppc64_elf_finish_dynamic_symbol): Likewise.
4037 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
4038 local dynamic relocs to ifuncs.
4039 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
4040 local_ifunc_resolver and maybe_local_ifunc_resolver.
4041 (ppc_elf_relocate_section): Set flag on emitting dynamic
4042 relocation to ifuncs.
4043 (ppc_elf_finish_dynamic_symbol): Likewise.
4044 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
4045 dynamic relocs to ifuncs.
4047 2017-03-13 Nick Clifton <nickc@redhat.com>
4050 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
4051 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
4052 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
4053 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
4054 * bfd-in2.h: Regenerate.
4055 * libbfd.h: Regenerate.
4056 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
4058 (IS_AARCH64_TLSDESC_RELOC): Likewise.
4059 (elfNN_aarch64_howto_table): Likewise.
4060 (aarch64_tls_transition_without_check): Likewise.
4061 (aarch64_reloc_got_type): Likewise.
4062 (elfNN_aarch64_final_link_relocate): Likewise.
4063 (elfNN_aarch64_tls_relax): Likewise.
4064 (elfNN_aarch64_relocate_section): Likewise.
4065 (elfNN_aarch64_gc_sweep_hook): Likewise.
4066 (elfNN_aarch64_check_relocs): Likewise.
4067 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4068 (_bfd_aarch64_elf_resolve_relocation): Likewise.
4070 2017-03-11 Alan Modra <amodra@gmail.com>
4072 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
4073 parameter is in fact used. Whitespace fixes.
4074 * elf64-ppc.c: Likewise.
4076 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4078 * rs6000-core.c (CORE_NEW): Simplify macro when
4079 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4081 2017-03-07 Alan Modra <amodra@gmail.com>
4085 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4088 2017-03-05 Alan Modra <amodra@gmail.com>
4090 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4091 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4092 (next_cie_fde_offset): New function.
4093 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4094 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4095 four bytes. Align CIEs to four or eight bytes depending on
4096 per_encoding_aligned8. Align FDEs according to their encoding.
4097 Pad last FDE to output section alignment.
4098 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4100 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4101 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4102 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4104 2017-03-02 Martin Bickel <binutils@ineranves.de>
4107 * elf.c (rewrite_elf_program_header): Do not issue a warning for
4108 empty segments which have a zero filesz, but a non-zero memsz.
4110 2017-03-02 Alan Modra <amodra@gmail.com>
4112 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4114 2017-02-28 Alan Modra <amodra@gmail.com>
4116 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4117 (ppc64_elf_relocate_section): Likewise.
4119 2017-02-28 Alan Modra <amodra@gmail.com>
4122 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4123 rather than elf32_nios2_hash_table or elf_hash_table.
4124 (create_got_section): Likewise.
4125 (nios2_elf32_finish_dynamic_symbol): Likewise.
4126 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4127 (nios2_elf32_size_dynamic_sections): Likewise.
4128 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4129 vars. Use htab equivalents directly instead. Don't create
4130 all dynamic sections on needing just the GOT. Use a goto
4131 rather than a fall-through with reloc test. Ensure
4132 htab->dynobj is set when making dynamic sreloc section.
4133 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4134 equivalent directly instead. Don't segfault on looking for
4135 .dynamic when dynamic sections have not been created. Don't
4136 segfault on .got.plt being discarded.
4137 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4138 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4139 fixme and another not so relevant comment.
4140 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4141 already set, set hash table dynobj on creating .sbss.
4143 2017-02-28 Alan Modra <amodra@gmail.com>
4145 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4146 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4147 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4148 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4149 (ppc64_elf_relocate_section): Likewise.
4150 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4151 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4152 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4153 * libbfd.h: Regenerate.
4154 * bfd-in2.h: Regenerate.
4156 2017-02-28 Alan Modra <amodra@gmail.com>
4158 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4159 dynamic .data.rel.ro read-only.
4160 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4161 rather than section flags when deciding where copy reloc goes.
4162 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4163 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4164 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4165 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4166 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4167 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4168 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4169 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4170 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4171 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4172 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4173 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4174 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4175 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4176 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4177 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4178 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4179 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4180 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4182 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4184 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4185 `jalr $0, $25' instruction encoding.
4187 2017-02-27 Nick Clifton <nickc@redhat.com>
4190 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4191 generating a seg-fault when encountering a symbol that has been
4192 deleted by garbage collection.
4194 2017-02-25 Alan Modra <amodra@gmail.com>
4196 * elf32-arc.c (struct dynamic_sections): Delete.
4197 (enum dyn_section_types): Delete.
4198 (dyn_section_names): Delete.
4199 (arc_create_dynamic_sections): Delete.
4200 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
4201 segfault on discarded .rela.plt section.
4202 (elf_arc_size_dynamic_sections): Formatting. Don't call
4203 arc_create_dynamic_sections. Don't allocate memory for sections
4204 handled by the generic linker. Correct code finding relocs in
4205 read-only sections. Set SEC_EXCLUDE on zero size .got,
4206 .got.plt, and .dynbss sections. Do set .interp for pies.
4208 2017-02-24 Andrew Waterman <andrew@sifive.com>
4210 * elfnn-riscv.c (GP_NAME): New macro.
4211 (riscv_global_pointer_value): Use it.
4212 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4213 output section, consider only that section's alignment.
4215 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4217 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4218 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4219 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4220 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4222 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4224 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4225 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4228 2017-02-23 Alan Modra <amodra@gmail.com>
4231 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4233 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4234 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4237 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
4240 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4241 processing ahead of the call to `elf_gc_sweep_symbol'.
4243 2017-02-22 Nick Clifton <nickc@redhat.com>
4246 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4247 created section 4-byte alignment.
4249 2017-02-22 Alan Modra <amodra@gmail.com>
4251 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4252 on .got or .plt output section being discarded by script.
4253 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
4256 2017-02-21 Alan Modra <amodra@gmail.com>
4258 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4259 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4261 2017-02-20 Alan Modra <amodra@gmail.com>
4264 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4265 if DT_RELSZ/DT_RELASZ is zero.
4267 2017-02-17 Nick Clifton <nickc@redhat.com>
4269 * compress.c (bfd_get_full_section_contents): Remember to reduce
4270 compressed size by the sizeof the compression header when
4271 decompressing the contents.
4273 2017-02-17 Pedro Alves <palves@redhat.com>
4275 * srec.c (Chunk): Rename to ...
4276 (_bfd_srec_len): ... this.
4277 (S3Forced): Rename to ...
4278 (_bfd_srec_forceS3): ... this.
4279 * objcopy.c: Adjust all references.
4281 2017-02-17 Pedro Alves <palves@redhat.com>
4283 * archive.c (bsd_write_armap): Rename to ...
4284 (_bfd_bsd_write_armap): ... this.
4285 (coff_write_armap): Rename to ...
4286 (_bfd_coff_write_armap): ... this.
4287 * libbfd-in.h (bsd_write_armap): Rename to ...
4288 (_bfd_bsd_write_armap): ... this.
4289 (coff_write_armap): Rename to ...
4290 (_bfd_coff_write_armap): ... this.
4291 * aout-target.h, aout-tic30.c: Adjust all users.
4292 * libbfd.h: Regenerate.
4294 2017-02-17 Pedro Alves <palves@redhat.com>
4296 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4297 (warn_deprecated): Rename to ...
4298 (_bfd_warn_deprecated): ... this.
4299 * libbfd.c (warn_deprecated): Rename to ...
4300 (_bfd_warn_deprecated): ... this.
4301 * bfd-in2.h: Regenerate.
4303 2017-02-17 Pedro Alves <palves@redhat.com>
4305 * bfdio.c (real_ftell): Rename to ...
4306 (_bfd_real_ftell): ... this.
4307 (real_fseek): Rename to ...
4308 (_bfd_real_fseek): ... this.
4309 (real_fopen): Rename to ...
4310 (_bfd_real_fopen): ... this.
4311 * libbfd-in.h (real_ftell): Rename to ...
4312 (_bfd_real_ftell): ... this.
4313 (real_fseek): Rename to ...
4314 (_bfd_real_fseek): ... this.
4315 (real_fopen): Rename to ...
4316 (_bfd_real_fopen): ... this.
4317 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4318 * libbfd.h: Regenerate.
4320 2017-02-17 Pedro Alves <palves@redhat.com>
4322 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4323 * libbfd.c (read_unsigned_leb128): Rename to ...
4324 (_bfd_read_unsigned_leb128): ... this.
4325 (read_signed_leb128): Rename to ...
4326 (_bfd_read_signed_leb128): ... this.
4327 (safe_read_leb128): Rename to ...
4328 (_bfd_safe_read_leb128): ... this.
4329 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4330 (_bfd_read_unsigned_leb128): ... this.
4331 (read_signed_leb128): Rename to ...
4332 (_bfd_read_signed_leb128): ... this.
4333 (safe_read_leb128): Rename to ...
4334 (_bfd_safe_read_leb128): ... this.
4335 * libbfd.h: Renegerate.
4337 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4339 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4340 before trying to fine matching file and line information.
4342 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4344 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4345 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4346 not match current bfd, then reload debug information. Record bfd
4347 we're loading debug info for in the stash. If we have debug
4348 informatin in the cache then perform section placement before
4351 2017-02-16 Alan Modra <amodra@gmail.com>
4354 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4355 * elfxx-target.h (elf_backend_no_page_alias): Define.
4356 (elfNN_bed): Init new field.
4357 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4358 ensure PT_LOAD segment starts on a new page.
4359 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4361 2017-02-16 Alan Modra <amodra@gmail.com>
4364 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4367 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4369 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4370 * bfd-in2.h: Regenerated.
4372 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4375 * elf32-i386.c (elf_i386_relocate_section): Allow
4376 "lea foo@GOT, %reg" in PIC.
4378 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4381 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4382 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4383 error against local IFUNC symbol without a base register for
4386 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4388 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4389 `%P: %H:' with `info->callbacks->einfo'.
4390 (ppc_elf_relocate_section): Likewise.
4391 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4392 (ppc64_elf_edit_toc): Likewise.
4393 (ppc64_elf_relocate_section): Likewise.
4395 2017-02-14 Alan Modra <amodra@gmail.com>
4397 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4398 --gc-keep-exported, and test versioned field of sym rather than
4399 looking for @ in name.
4401 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4403 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4406 2017-02-13 Nick Clifton <nickc@redhat.com>
4409 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4412 2017-02-07 Andrew Waterman <andrew@sifive.com>
4414 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4415 entry size if PLT header is written.
4417 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4419 Fix sparc64 dynamic relocation processing to use the dynamic
4421 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4422 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4425 2017-02-03 Nick Clifton <nickc@redhat.com>
4428 * coffcode.h (coff_write_object_contents): Enlarge size of
4429 s_name_buf in order to avoid compile time warning about possible
4431 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4432 32-bits of insn value before printing into buffer.
4434 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4436 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4437 `max_local_dynindx'.
4438 (mips_elf_sort_hash_table): Handle it.
4439 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4440 symbols bump up `max_local_dynindx' rather than
4441 `max_non_got_dynindx'.
4443 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4445 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4446 `min_got_dynindx', `max_unref_got_dynindx' and
4447 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4448 (mips_elf_sort_hash_table): Adjust accordingly.
4450 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4452 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4453 to access the hash table.
4455 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4457 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4458 non-NULL `htab' to the beginning.
4460 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4462 * elflink.c (elf_gc_sweep): Wrap overlong line.
4464 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4466 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4467 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4468 * elfxx-mips.c (mips_elf_link_hash_table): Add
4469 `ignore_branch_isa' member.
4470 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4471 in branch relocation calculation as an error if
4472 `ignore_branch_isa' has been set.
4473 (_bfd_mips_elf_insn32): Rename to...
4474 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4475 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4476 Handle the new parameter.
4478 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4480 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4481 local variable dynobj.
4484 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4485 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4486 executable from read-only sections into sdynrelro.
4487 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4488 dynamic relocs in sdynrelro.
4489 (elf_backend_want_dynrelro): Define.
4491 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4493 * config.bfd (*-*-rtemsaout*): Mark as removed.
4495 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4497 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4498 (arm-*-rtems*): Move to (arm*-*-eabi*).
4499 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4500 (m68-*-rtems*): Move to (m68*-*-elf*).
4502 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4504 * config.bfd (*-*-rtemscoff*): Mark as removed.
4506 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4509 * elflink.c (bfd_elf_record_link_assignment): Revert last
4510 change and don't ever clear `forced_local'. Set `mark'
4512 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4514 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4515 (bfd_elf_size_dynamic_sections): ... here.
4516 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4517 and set `mark' instead in `__tls_get_addr_opt' processing.
4518 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4520 2017-01-24 Alan Modra <amodra@gmail.com>
4522 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4523 where dynamic relocs are preferable. Allow ifunc too.
4524 (ensure_undefweak_dynamic): New function.
4525 (allocate_dynrelocs): Use it here. Move plt handling last and
4526 don't make symbols dynamic, simplifying loop. Only make undef
4527 weak symbols with GOT entries dynamic. Correct condition
4528 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4529 comments. Remove goto.
4530 (ppc_elf_relocate_section): Correct test for using dynamic
4531 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4532 to suit. Set up explicit tls_index entries and implicit GOT
4533 tls_index entries resolvable at link time for
4534 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4535 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4536 (ensure_undefweak_dynamic): New function.
4537 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4538 with GOT entries dynamic. Remove unnecessary test of
4539 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4540 (ppc64_elf_relocate_section): Correct test for using dynamic
4541 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4542 to suit. Set up explicit tls_index entries and implicit GOT
4543 tls_index entries resolvable at link time for __tls_get_addr_opt.
4544 Simplify expression to clear mem for prelink.
4546 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4548 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4550 2017-01-20 Jiong Wang <jiong.wang@arm.com>
4552 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4553 (elf_backend_hash_symbol): Define.
4555 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4558 * elflink.c (bfd_elf_record_link_assignment): Clear any
4559 `forced_local' marking for DSO symbols that are not being
4562 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4564 * elfnn-riscv.c (riscv_elf_object_p): New function.
4566 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4569 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4571 (elf_x86_64_check_relocs): Create .eh_frame section for the
4573 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4574 .eh_frame section for the .plt.bnd section.
4575 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4576 for the .plt.bnd section.
4578 2017-01-12 Nick Clifton <nickc@redhat.com>
4581 * opncls.c (find_separate_debug_file): Add include_dirs
4582 parameter. Only include the directory part of the bfd's filename
4583 in search paths if include_dirs is true. Add a couple of extra
4584 locations for looking for debug files.
4585 ( bfd_follow_gnu_debuglink): Update invocation of
4586 find_separate_debug_file.
4587 (bfd_follow_gnu_debugaltlink): Likewise.
4588 (get_build_id): New function: Finds the build-id of the given bfd.
4589 (get_build_id_name): New function: Computes the name of the
4590 separate debug info file for a bfd, based upon its build-id.
4591 (check_build_id_file): New function: Checks to see if a separate
4592 debug info file exists at the given location, and that its
4593 build-id matches that of the original bfd.
4594 (bfd_follow_build_id_debuglink): New function: Finds a separate
4595 debug info file for a given bfd by using the build-id method.
4596 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4597 method of locating a separate debug info file before using the
4599 * bfd-in2.h: Regenerate.
4601 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
4604 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4605 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4606 elf_x86_64_eh_frame_plt_got.
4607 (elf_x86_64_size_dynamic_sections): Get unwind info from
4608 elf_x86_64_bnd_arch_bed for the BND PLT.
4610 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
4612 * config.bfd: Add entries for i686-redox and x86_64-redox.
4614 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4616 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
4618 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
4619 .eh_frame section to 4 bytes for x32.
4620 (elf_x86_64_check_relocs): Likewise.
4622 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4625 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
4626 (PLT_GOT_FDE_LENGTH): Likewise.
4627 (elf_i386_plt_layout): Add eh_frame_plt_got and
4628 eh_frame_plt_got_size.
4629 (elf_i386_plt): Updated.
4630 (elf_i386_link_hash_table): Add plt_got_eh_frame.
4631 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
4632 (elf_i386_size_dynamic_sections): Allocate and initialize
4633 .eh_frame section for .plt.got.
4634 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
4636 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
4637 eh_frame_plt_got_size.
4638 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
4639 (PLT_GOT_FDE_LENGTH): Likewise.
4640 (elf_x86_64_backend_data): Add eh_frame_plt_got and
4641 eh_frame_plt_got_size.
4642 (elf_x86_64_arch_bed): Updated.
4643 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
4644 eh_frame_plt_got_size.
4645 (elf_x86_64_nacl_arch_bed): Likewise.
4646 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
4647 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
4648 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4649 .eh_frame section for .plt.got.
4650 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4653 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4655 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
4656 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
4658 2017-01-09 Nick Clifton <nickc@redhat.com>
4660 * dwarf2.c (lookup_address_in_function_table): Return early if
4661 there are no functions in the given comp unit, or if the high
4662 address of the last function in the comp unit is less than the
4665 2017-01-09 Nick Clifton <nickc@redhat.com>
4668 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
4669 message if there are too many symbols to load.
4671 2017-01-04 James Clarke <jrtc27@jrtc27.com>
4673 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
4674 if relocs are cached.
4676 2017-01-03 Rich Felker <bugdal@aerifal.cx>
4679 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
4680 for R_MICROBLAZE_GOTOFF_64.
4682 2017-01-03 Nick Clifton <nickc@redhat.com>
4684 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
4685 warning about using a possibly uninitialised variable.
4687 2017-01-02 Alan Modra <amodra@gmail.com>
4689 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
4690 (allocate_plt_static, allocate_dynrelocs): Use it.
4692 2017-01-02 Alan Modra <amodra@gmail.com>
4694 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
4695 .PARISC.unwind section.
4697 2017-01-02 Alan Modra <amodra@gmail.com>
4700 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
4701 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
4702 indirect to GOT pointer relative code edit.
4704 2017-01-02 Alan Modra <amodra@gmail.com>
4706 Update year range in copyright notice of all files.
4708 For older changes see ChangeLog-2016
4710 Copyright (C) 2017 Free Software Foundation, Inc.
4712 Copying and distribution of this file, with or without modification,
4713 are permitted in any medium without royalty provided the copyright
4714 notice and this notice are preserved.
4720 version-control: never