1 2017-10-18 H.J. Lu <hongjiu.lu@intel.com>
4 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
5 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
6 bfd_link_executable for TLS check.
7 (_bfd_sparc_elf_check_relocs): Likewise.
8 (allocate_dynrelocs): Likewise.
9 (_bfd_sparc_elf_relocate_section): Likewise.
11 2017-10-18 H.J. Lu <hongjiu.lu@intel.com>
13 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
14 _bfd_generic_link_add_one_symbol to mark __tls_get_addr.
15 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
17 2017-10-17 H.J. Lu <hongjiu.lu@intel.com>
19 * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
20 indirect and warning symbols.
22 2017-10-17 Alan Modra <amodra@gmail.com>
25 * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
26 against size left rather than comparing pointers. Reorganise loop.
28 2017-10-17 Alan Modra <amodra@gmail.com>
31 * aoutx.h (aout_get_external_symbols): Handle stringsize of zero,
32 and error for any other size that doesn't cover the header word.
34 2017-10-16 H.J. Lu <hongjiu.lu@intel.com>
36 * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook.
37 * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed.
38 (elf_backend_gc_sweep_hook): Likewise.
39 * elf32-bfin.c (bfin_gc_sweep_hook): Likewise.
40 (bfinfdpic_gc_sweep_hook): Likewise.
41 (elf_backend_gc_sweep_hook): Likewise.
42 * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise.
43 (elf_backend_gc_sweep_hook): Likewise.
44 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
45 (elf_backend_gc_sweep_hook): Likewise.
46 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
47 (elf_backend_gc_sweep_hook): Likewise.
48 * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise.
49 (elf_backend_gc_sweep_hook): Likewise.
50 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
51 (elf_backend_gc_sweep_hook): Likewise.
52 * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook
54 (elf_m68k_remove_got_entry_type): Removed.
55 (elf_m68k_find_got_entry_ptr): Likewise.
56 (elf_m68k_remove_got_entry): Likewise.
57 (elf_m68k_gc_sweep_hook): Likewise.
58 (elf_backend_gc_sweep_hook): Likewise.
59 * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise.
60 (elf_backend_gc_sweep_hook): Likewise.
61 * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise.
62 (elf_backend_gc_sweep_hook): Likewise.
63 * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise.
64 (elf_backend_gc_sweep_hook): Likewise.
65 * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise.
66 (elf_backend_gc_sweep_hook): Likewise.
67 * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise.
68 (elf_backend_gc_sweep_hook): Likewise.
69 * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise.
70 (elf_backend_gc_sweep_hook): Likewise.
71 * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise.
72 (elf_backend_gc_sweep_hook): Likewise.
73 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
74 (elf_backend_gc_sweep_hook): Likewise.
75 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
76 (elf_backend_gc_sweep_hook): Likewise.
77 * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise.
78 * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise.
79 (elf_backend_gc_sweep_hook): Likewise.
80 * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
81 * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise.
82 (elf_backend_gc_sweep_hook): Likewise.
83 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
84 (elf_backend_gc_sweep_hook): Likewise.
85 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
86 (elf_backend_gc_sweep_hook): Likewise.
87 * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise.
88 (elf_backend_gc_sweep_hook): Likewise.
89 * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise.
90 * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise.
91 (elf_backend_gc_sweep_hook): Likewise.
92 * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise.
93 (ppc64_elf_gc_sweep_hook): Likewise.
94 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
95 (elf_backend_gc_sweep_hook): Likewise.
96 * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise.
97 * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
98 * elflink.c (elf_link_add_object_symbols): Don't call
99 _bfd_elf_link_check_relocs here.
100 (gc_sweep_hook_fn): Removed.
101 (elf_gc_sweep): Remove gc_sweep_hook.
102 * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed.
103 (elf_backend_gc_sweep_hook): Likewise.
104 * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise.
105 (elf_backend_gc_sweep_hook): Likewise.
106 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
107 * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise.
108 (elf_backend_gc_sweep_hook): Likewise.
109 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
110 * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise.
111 * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise.
112 (elfNN_bed): Remove elf_backend_gc_sweep_hook.
113 * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed.
114 * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise.
116 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
118 * elf32-i386.c (elf_i386_backend_data): Removed.
119 (get_elf_i386_backend_data): Likewise.
120 (elf_i386_arch_bed): Replace elf_i386_backend_data with
121 elf_x86_backend_data.
122 (elf_i386_get_synthetic_symtab): Likewise.
123 (elf_i386_nacl_arch_bed): Likewise.
124 (elf_i386_vxworks_arch_bed): Likewise.
125 (elf_i386_relocate_section): Check target_os instead of
127 (elf_i386_finish_dynamic_symbol): Likewise.
128 (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
129 Check target_os instead of is_vxworks.
130 (elf_i386_link_setup_gnu_properties): Remove normal_target and
131 is_vxworks. Initialize plt0_pad_byte.
132 * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
133 (get_elf_x86_64_arch_data): Likewise.
134 (get_elf_x86_64_backend_data): Likewise.
135 (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
136 elf_x86_backend_data.
137 (elf_x86_64_get_synthetic_symtab): Likewise.
138 (elf_x86_64_nacl_arch_bed): Likewise.
139 (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
140 normal_target. Initialize plt0_pad_byte.
141 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
142 instead of is_vxworks.
143 (_bfd_x86_elf_size_dynamic_sections): Likewise.
144 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
145 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
146 (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
147 (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
148 Update normal_target. Set up plt0_pad_byte. Check target_os
149 instead of is_vxworks.
150 * elfxx-x86.h (elf_x86_target_os): New.
151 (elf_x86_backend_data): Likewise.
152 (get_elf_x86_backend_data): Likewise.
153 (elf_x86_link_hash_table): Remove is_vxworks. Add plt0_pad_byte
155 (elf_x86_init_table): Remove normal_target and is_vxworks. Add
158 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
160 * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
161 _bfd_x86_elf_finish_dynamic_sections.
162 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
163 * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
165 * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
168 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
171 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
172 hide symbol which was forced to be dynamic.
174 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
177 * elf32-cris.c (cris_elf_relocate_section): Don't generate
178 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
179 (cris_elf_check_relocs): Don't allocate dynamic relocation
180 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
182 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
185 * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
186 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
187 (sh_elf_relocate_section): Don't generate dynamic relocation if
188 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
190 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
193 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
194 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
195 (elf_s390_relocate_section): Don't generate dynamic relocation
196 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
197 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
198 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
199 (elf_s390_relocate_section): Don't generate dynamic relocation
200 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
202 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
205 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
206 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
207 (allocate_dynrelocs): Discard dynamic relocations if
208 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
210 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
213 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
214 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
216 (allocate_dynrelocs): Discard dynamic relocations if
217 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
219 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
222 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
223 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
224 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
225 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
226 (elf_m68k_relocate_section): Don't generate dynamic relocation
227 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
229 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
232 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
233 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
234 (allocate_dynrelocs): Discard dynamic relocations if
235 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
236 (elf32_hppa_relocate_section): Don't generate dynamic
237 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
239 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
242 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
243 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
244 (allocate_fptr): Don't allocate function pointer if
245 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
246 (allocate_dynrel_entries): Don't allocate dynamic relocation
247 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
248 (set_got_entry): Don't set GOT entry if
249 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
250 (set_pltoff_entry): Don't set PLTOFF entry if
251 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
252 (elfNN_ia64_relocate_section): Don't install dynamic relocation
253 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
255 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
258 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
259 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
260 (allocate_dynrelocs): Don't allocate dynamic relocations if
261 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
263 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
266 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
267 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
268 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
269 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
271 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
274 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
275 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
276 (tilepro_elf_relocate_section): Don't generate dynamic
277 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
278 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
279 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
280 (tilegx_elf_relocate_section): Don't generate dynamic
281 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
283 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
286 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
287 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
289 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
290 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
292 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
294 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
295 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
296 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
298 2017-10-12 James Bowman <james.bowman@ftdichip.com>
300 * bfd-in2.h: Regenerate.
301 * libbfd.h: Regenerate.
302 * elf32-ft32.c: Add HOWTO R_FT32_15.
303 * reloc.c: Add BFD_RELOC_FT32_15.
305 2017-10-12 Nick Clifton <nickc@redhat.com>
307 * reloc.c (enum bfd_reloc_status): Start values at 2.
308 * bfd-in2.h: Regenerate.
309 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
310 that a TRUE return indicates success. Compare the result of
311 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
312 (build_one_stub): Change sense of tests against aarch64_relocate
314 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
315 than FALSE, when an error is detected.
316 (elfNN_aarch64_final_link_relocate): Likewise.
318 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
320 * elf32-i386.c (elf_backend_hide_symbol): New.
321 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
322 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
323 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
325 2017-10-12 Alan Modra <amodra@gmail.com>
327 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
328 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
329 (bfd_elf_define_start_stop): Likewise.
331 2017-10-12 Alan Modra <amodra@gmail.com>
333 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
334 when executable rather than non-PIC.
335 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
336 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
338 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
340 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
342 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
343 (elf_external_linux_prpsinfo64_ugid32): ... this.
344 (swap_linux_prpsinfo32_out): Rename to...
345 (swap_linux_prpsinfo32_ugid32_out): ... this.
346 (elf_external_linux_prpsinfo64_ugid16): New structure.
347 (swap_linux_prpsinfo64_ugid16_out): New function.
348 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
349 (elf_backend_linux_prpsinfo64_ugid16): Define.
350 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
351 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
352 of the 64-bit Linux core PRPSINFO note.
353 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
355 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
357 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
359 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
360 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
361 (elf_external_ppc_linux_prpsinfo32)
362 (swap_ppc_linux_prpsinfo32_out): Move to...
363 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
364 (swap_linux_prpsinfo32_ugid32_out): ... these.
365 (elf_external_linux_prpsinfo32): Rename to...
366 (elf_external_linux_prpsinfo32_ugid16): ... this.
367 (swap_linux_prpsinfo32_out): Rename to...
368 (swap_linux_prpsinfo32_ugid16_out): ... this.
369 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
370 (elf_backend_linux_prpsinfo32_ugid16): Define.
371 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
372 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
373 of the 32-bit Linux core PRPSINFO note.
374 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
375 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
376 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
377 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
378 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
379 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
380 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
381 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
382 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
383 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
385 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
387 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
388 `gap' member ahead of `pr_flag'.
390 2017-10-11 Pedro Alves <palves@redhat.com>
392 * bfd.c (_doprnt): Rename to ...
393 (_bfd_doprnt): ... this.
394 (error_handler_internal): Adjust.
396 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
398 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
399 instead of incrementing it.
400 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
402 2017-10-10 Renlin Li <renlin.li@arm.com>
405 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
406 symbols into dynamic.
408 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
411 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
412 (riscv_elf_link_hash_table_create): Initialize max_alignment to
414 (_bfd_riscv_relax_section): Cache the max alignment of output
415 sections if possible.
417 2017-10-10 Alan Modra <amodra@gmail.com>
419 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
420 .opd whenever .opd is present and non-zero size. Move code
421 setting abiversion to/from output file earlier. Only set
422 u.opd.func_sec when --gc-sections. Read relocs and set up
423 u.opd.func_sec values here..
424 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
426 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
428 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
430 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
433 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
435 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
436 .interp section with "ld --no-dynamic-linker".
438 2017-10-09 Alan Modra <amodra@gmail.com>
441 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
442 funcinfo_hash_table and varinfo_hash_table.
444 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
446 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
447 in read-only section with minfo.
448 (sh_elf_size_dynamic_sections): Likewise.
450 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
452 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
455 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
457 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
458 this_hdr.sh_entsize only if section size > 0.
460 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
462 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
464 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
466 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
467 in read-only section with minfo.
468 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
470 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
472 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
475 2017-10-06 John Baldwin <jhb@FreeBSD.org>
477 * elf-bfd.h (struct elf_backend_data): Add
478 `elf_backend_grok_freebsd_prstatus'.
479 * elf.c (elfcore_grok_freebsd_note): Call
480 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
482 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
484 (elf_backend_grok_freebsd_prstatus): Define.
485 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
486 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
488 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
490 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
491 and has_non_got_reloc with zero_undefweak.
492 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
493 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
495 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
496 has_non_got_reloc with zero_undefweak.
497 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
498 has_got_reloc and has_non_got_reloc with zero_undefweak.
499 (elf_x86_link_hash_entry): Likewise.
501 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
503 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
504 (VERIFY_COPY_RELOC): Likewise.
506 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
508 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
509 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
510 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
512 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
514 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
515 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
516 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
518 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
520 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
521 * elf32-i386.c (elf_i386_relocate_section): Use it.
522 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
524 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
526 * elf32-i386.c (X86_SIZE_TYPE_P): New.
527 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
528 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
529 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
530 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
532 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
534 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
535 (PLT_LOCAL_IFUNC_P): Likewise.
536 * elf32-i386.c (elf_i386_relocate_section): Use them.
537 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
539 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
541 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
542 * elf32-i386.c (elf_i386_relocate_section): Use it.
543 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
545 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
547 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
548 * elf32-i386.c (elf_i386_relocate_section): Use it.
549 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
551 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
553 * elf32-i386.c (X86_PCREL_TYPE_P): New.
554 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
555 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
556 (X86_PCREL_TYPE_P): This.
557 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
558 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
559 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
561 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
563 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
565 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
566 * elf32-i386.c (elf_i386_tls_transition): Use it.
567 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
569 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
571 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
572 Dump dynamic relocation in read-only section with minfo if
574 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
575 (maybe_set_textrel): Likewise.
576 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
577 read-only section with minfo.
579 2017-10-05 John Baldwin <jhb@FreeBSD.org>
581 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
583 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
585 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
586 in read-only section with minfo.
587 (tilepro_elf_size_dynamic_sections): Likewise.
588 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
589 (tilegx_elf_size_dynamic_sections): Likewise.
591 2017-10-05 Pedro Alves <palves@redhat.com>
594 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
595 ellipsis parameter. Split out bfd_error_on_input code to..
596 (bfd_set_input_error): .. New function.
597 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
598 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
599 * bfd-in2.h: Regenerate.
601 2017-10-05 Alan Modra <amodra@gmail.com>
603 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
604 fini_array error value.
606 2017-10-05 Alan Modra <amodra@gmail.com>
609 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
611 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
613 (elf_fake_sections): Adjust calls. Exit immediately on failure.
614 (bfd_elf_set_group_contents): Add associated reloc section indices
617 2017-10-04 Alan Modra <amodra@gmail.com>
619 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
620 classify symbols for ELFv2.
622 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
625 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
626 undergoes default promotion.
627 * bfd-in2.h: Regenerate.
629 2017-10-02 Alan Modra <amodra@gmail.com>
631 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
632 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
634 2017-10-01 Alan Modra <amodra@gmail.com>
637 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
638 (add_line_info): Always put end_sequence last.
640 2017-10-01 Alan Modra <amodra@gmail.com>
643 * dwarf2.c (read_section): Allocate buffer with extra byte for
644 bfd_simple_get_relocated_section_contents rather than copying
647 2017-09-29 Alan Modra <amodra@gmail.com>
649 * merge.c (merge_strings): Return FALSE on malloc failure.
650 (_bfd_merge_sections): Return failures from record_section and
653 2017-09-28 Alan Modra <amodra@gmail.com>
656 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
657 a case where plugin_notice isn't called.
659 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
661 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
664 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
667 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
668 output_bfd to info->callbacks->minfo.
670 2017-09-26 Nick Clifton <nickc@redhat.com>
673 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
674 assertion failure if elf_x86_64_rtype_to_howto has already issued
677 2017-09-26 Alan Modra <amodra@gmail.com>
680 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
683 2017-09-26 Nick Clifton <nickc@redhat.com>
686 * dwarf2.c (read_formatted_entries): Fail early if we know that
687 the loop parsing data entries will overflow the end of the
690 2017-09-26 Alan Modra <amodra@gmail.com>
693 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
694 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
695 to stash->info_ptr_memory, and check die_ref is within that memory.
696 Set info_ptr_end correctly when another CU is refd. Check die_ref
697 for DW_FORM_ref4 etc. is within CU.
699 2017-09-26 Alan Modra <amodra@gmail.com>
702 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
703 (read_formatted_entries): Init "fe".
704 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
706 2017-09-26 Alan Modra <amodra@gmail.com>
709 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
710 bounds in inner loop.
712 2017-09-25 Alan Modra <amodra@gmail.com>
715 * dwarf1.c (parse_die): Sanity check pointer against section limit
716 before dereferencing.
717 (parse_line_table): Likewise.
719 2017-09-25 Alan Modra <amodra@gmail.com>
722 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
724 (parse_comp_unit): Likewise.
726 2017-09-25 Alan Modra <amodra@gmail.com>
729 * dwarf2.c (read_formatted_entries): Error on format_count zero.
731 2017-09-24 Alan Modra <amodra@gmail.com>
734 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
735 within section bounds.
737 2017-09-24 Alan Modra <amodra@gmail.com>
740 * dwarf2.c (decode_line_info): Properly free line sequences on error.
742 2017-09-24 Alan Modra <amodra@gmail.com>
745 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
746 pname param. Return status. Make name const. Don't abort,
747 return an error. Formatting. Exit if current info_ptr matches
748 orig_info_ptr. Update callers.
749 (scan_unit_for_symbols): Start at nesting_level of zero. Make
750 nested_funcs an array of structs for extensibility. Formatting.
752 2017-09-24 Alan Modra <amodra@gmail.com>
755 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
756 rather than dividing by zero.
758 2017-09-24 Alan Modra <amodra@gmail.com>
761 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
763 2017-09-24 Alan Modra <amodra@gmail.com>
766 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
768 2017-09-24 Alan Modra <amodra@gmail.com>
771 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
772 SHT_GNU_verneed section for sanity. Don't zalloc memory for
775 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
778 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
781 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
784 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
785 -1 if bfd_canonicalize_dynamic_reloc returns 0.
787 2017-09-22 Pedro Alves <palves@redhat.com>
788 Alan Modra <amodra@gmail.com>
790 * version.h: Add comment.
792 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
794 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
795 NT_S390_GS_BC, correct the previously swapped invocations of
796 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
798 2017-09-19 Alan Modra <amodra@gmail.com>
801 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
804 2017-09-19 Alan Modra <amodra@gmail.com>
807 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
808 symbols before calculating verrefs. Don't renumber dynsyms
809 after gc. Exclude .gnu.version when zero or one dynsym.
810 Localize some vars and reindent.
812 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
815 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
816 return from bfd_canonicalize_dynamic_reloc.
818 2017-09-15 Alan Modra <amodra@gmail.com>
821 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
822 overflows bfd_size_type.
824 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
827 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
828 to indicate if conversion is performed.
829 (elf_i386_check_relocs): Cache section contents and relocations
830 if conversion is performed.
831 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
832 contents and relocations if conversion is performed.
834 2017-09-14 Nick Clifton <nickc@redhat.com>
837 * peXXigen.c (pe_print_idata): Extend check for HintName vector
840 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
842 * elfxx-x86.h: Fix a typo in comments.
844 2017-09-09 Kamil Rytarowski <n54@gmx.com>
846 * elf32-nds32.c: Rename __BIT() to N32_BIT().
848 2017-09-09 Alan Modra <amodra@gmail.com>
850 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
853 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
855 * elf32-i386.c (elf_i386_relocate_section): Update usage of
856 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
857 (elf_i386_finish_dynamic_symbol): Likewise.
858 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
859 (elf_x86_64_finish_dynamic_symbol): Likewise.
860 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
861 (_bfd_x86_elf_fixup_symbol): Likewise.
863 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
865 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
866 check has_non_got_reloc.
868 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
871 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
872 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
873 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
874 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
875 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
876 and linker_def on __ehdr_start if it is referenced and not
878 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
879 and return TRUE when building executable, if a symbol has
880 non-GOT/non-PLT relocations in text section or there is no
882 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
884 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
886 * elfxx-x86.h: Update comments.
888 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
890 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
891 elf_x86_plt_layout_table with elf_x86_init_table.
892 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
894 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
896 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
897 (elf_x86_init_table): This.
898 (_bfd_x86_elf_link_setup_gnu_properties): Replace
899 elf_x86_plt_layout_table with elf_x86_init_table.
901 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
903 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
904 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
905 * configure: Regenerated.
906 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
907 and r_sym fields of plt_layout.
908 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
910 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
911 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
912 r_info nor r_sym fields.
913 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
915 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
917 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
919 * (_bfd_riscv_relax_align): Call bfd_set_error and
920 print an error message when unable to relax a .align directive.
922 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
924 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
925 (riscv_record_pcrel_hi_reloc): Add absolute argument.
926 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
927 R_RISCV_PCREL_HI20 relocs, and pass the result to
928 riscv_record_pcrel_hi_reloc.
930 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
932 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
933 r_type_p. Remove the converted argument. Replace
934 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
935 the new relocation type via r_type_p.
936 (elf_i386_relocate_section): Likewise.
937 (elf_i386_finish_dynamic_symbol): Likewise.
938 (need_convert_load): Removed.
939 (check_relocs_failed): Updated.
940 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
941 instead of setting need_convert_load.
942 (_bfd_i386_elf_convert_load): Removed.
943 * elf64-x86-64.c (need_convert_load): Removed.
944 (check_relocs_failed): Updated.
945 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
946 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
947 Return the new relocation type via r_type_p.
948 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
949 instead of setting need_convert_load.
950 (elf_x86_64_check_relocs): Don't check PIC if relocation has
952 (_bfd_x86_64_elf_convert_load): Removed.
953 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
954 with SYMBOL_REFERENCES_LOCAL_P.
955 (elf_x86_64_finish_dynamic_symbol): Likewise.
956 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
958 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
959 (_bfd_x86_elf_link_symbol_references_local): New function.
960 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
961 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
962 SYMBOL_REFERENCES_LOCAL_P.
963 (elf_x86_link_hash_entry): Add local_ref.
964 (elf_x86_link_hash_table): Remove convert_load.
965 (_bfd_i386_elf_convert_load): Removed.
966 (_bfd_x86_64_elf_convert_load): Likewise.
967 (_bfd_x86_elf_link_symbol_references_local): New.
969 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
971 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
972 (elf_x86_64_info_to_howto): Get the real relocation type by
973 masking out R_X86_64_converted_reloc_bit.
974 (elf_x86_64_check_tls_transition): Get the real relocation type
975 by masking out R_X86_64_converted_reloc_bit.
976 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
977 instead of setting converted_reloc.
978 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
979 instead of converted_reloc. Get the real relocation type by
980 masking out R_X86_64_converted_reloc_bit.
981 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
982 R_X86_64_converted_reloc_bit is valid.
983 * elfxx-x86.h (converted_reloc): Removed.
985 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
987 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
988 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
989 to get the relocation type again.
990 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
991 r_type when calling elf_x86_64_tls_transition. Don't use
992 ELF32_R_TYPE to get the relocation type again.
994 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
996 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
999 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1001 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
1002 argument. Don't check relocation overflow. Avoid relocation
1003 overflow if --no-relax is used. Set converted_reloc on symbol
1004 if a GOTPCREL relocation is converted.
1005 (elf_x86_64_relocate_section): Issue a fatal error and suggest
1006 --no-relax if GOTPCREL relocation conversion leads to relocation
1008 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
1010 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
1011 Edmar Wienskoski <edmar.wienskoski@nxp.com
1013 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
1014 (ppc_elf_check_relocs): Handle it.
1015 (ppc_elf_vle_split20): New function.
1016 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
1018 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
1021 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
1022 for x86-64 if GOT_TLS_GDESC_P is true.
1024 2017-09-03 Alan Modra <amodra@gmail.com>
1027 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
1029 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1031 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1032 tls_get_addr for x86-64 in one place.
1034 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1036 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
1037 with elfxx-x86.lo for 64-bit BFD.
1038 * configure: Regenerated.
1040 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1042 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
1043 (_bfd_i386_elf_convert_load): This. Remove static.
1044 (elf_i386_size_dynamic_sections): Removed.
1045 (elf_backend_size_dynamic_sections): Likewise.
1046 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
1047 (_bfd_x86_64_elf_convert_load): This. Remove static.
1048 (elf_x86_64_size_dynamic_sections): Removed.
1049 (elf_backend_size_dynamic_sections): Likewise.
1050 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
1051 (elf_x86_allocate_dynrelocs): This. Make it static.
1052 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
1053 (elf_x86_allocate_local_dynreloc): This. Make it static.
1054 (elf_i386_is_reloc_section): New function.
1055 (elf_x86_64_is_reloc_section): Likewise.
1056 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
1057 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1058 Rearrange got_entry_size initialization.
1059 (_bfd_x86_elf_size_dynamic_sections): New function.
1060 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
1061 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1062 (_bfd_i386_elf_convert_load): New.
1063 (_bfd_x86_64_elf_convert_load): Likewise.
1064 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1065 (elf_backend_size_dynamic_sections): Likewise.
1066 (_bfd_x86_elf_allocate_dynrelocs): Removed.
1067 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1069 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1071 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
1074 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1076 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1077 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
1079 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1081 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1082 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
1083 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1084 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
1085 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1086 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
1088 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1090 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
1091 (elf_i386_allocate_local_dynrelocs): Likewise.
1092 (elf_i386_size_dynamic_sections): Replace
1093 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
1094 with _bfd_x86_elf_allocate_dynrelocs and
1095 _bfd_x86_elf_allocate_local_dynrelocs.
1096 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
1097 (elf_x86_64_allocate_local_dynrelocs): Likewise.
1098 (elf_x86_64_size_dynamic_sections): Replace
1099 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
1100 with _bfd_x86_elf_allocate_dynrelocs and
1101 _bfd_x86_elf_allocate_local_dynrelocs.
1102 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
1103 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1104 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
1105 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1107 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1109 * elf32-i386.c (is_i386_elf): Removed.
1110 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
1111 (elf_i386_size_dynamic_sections): Likewise.
1112 (elf_i386_relocate_section): Likewise.
1113 * elf64-x86-64.c (is_x86_64_elf): Removed.
1114 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
1116 (elf_x86_64_size_dynamic_sections): Likewise.
1117 (elf_x86_64_relocate_section): Likewise.
1118 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1120 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
1123 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1125 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
1126 (elf_i386_allocate_dynrelocs): Replace
1127 elf_i386_compute_jump_table_size with
1128 elf_x86_compute_jump_table_size.
1129 (elf_i386_size_dynamic_sections): Likewise.
1130 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
1131 (elf_x86_64_allocate_dynrelocs): Replace
1132 elf_x86_64_compute_jump_table_size with
1133 elf_x86_compute_jump_table_size.
1134 (elf_x86_64_size_dynamic_sections): Likewise.
1135 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1137 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
1138 (elf_x86_compute_jump_table_size): New.
1140 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1142 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1144 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
1145 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
1147 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1149 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
1150 with htab->is_vxworks.
1151 (elf_i386_size_dynamic_sections): Likewise.
1152 (elf_i386_relocate_section): Likewise.
1153 (elf_i386_finish_dynamic_symbol): Likewise.
1154 (elf_i386_finish_dynamic_sections): Likewise.
1156 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1158 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1159 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1160 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
1161 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1162 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1163 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
1164 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1165 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
1167 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1170 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
1171 ELF_COMMON_DEF_P for common symbols.
1173 2017-09-02 Alan Modra <amodra@gmail.com>
1175 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
1176 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1177 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1179 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1181 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
1182 (elf_backend_gc_mark_hook): Likewise.
1183 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
1184 (elf_backend_gc_mark_hook): Likewise.
1185 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
1186 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
1187 (elf_backend_gc_mark_hook): Likewise.
1189 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1191 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1192 (elf_backend_adjust_dynamic_symbol): Likewise.
1193 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1194 (elf_backend_adjust_dynamic_symbol): Likewise.
1195 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1196 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1197 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1198 (_bfd_x86_elf_adjust_dynamic_symbol): New.
1199 (elf_backend_adjust_dynamic_symbol): Likewise.
1201 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1203 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1206 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1208 * elf32-i386.c (elf_i386_mkobject): Removed.
1209 (bfd_elf32_mkobject): Likewise.
1210 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1211 (bfd_elf64_mkobject): Likewise.
1212 (bfd_elf32_mkobject): Likewise.
1213 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
1214 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1215 (bfd_elf64_mkobject): Likewise.
1216 (bfd_elf32_mkobject): Likewise.
1218 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1220 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1221 Call _bfd_x86_elf_link_setup_gnu_properties.
1222 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1223 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1225 (elf_x86_64_non_lazy_plt): Likewise.
1226 (elf_x86_64_lazy_bnd_plt): Likewise.
1227 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1228 (elf_x86_64_lazy_ibt_plt): Likewise.
1229 (elf_x32_lazy_ibt_plt): Likewise.
1230 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1231 (elf_x32_non_lazy_ibt_plt): Likewise.
1232 (elf_x86_64_nacl_plt): Likewise.
1233 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1234 _bfd_x86_elf_link_setup_gnu_properties.
1235 * elfxx-x86.c: Include elf-vxworks.h".
1236 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1237 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1238 comments for pic_plt0_entry and pic_plt_entry.
1239 (elf_x86_non_lazy_plt_layout): Likewise.
1240 (elf_x86_plt_layout_table): New.
1241 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1243 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1246 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1247 .eh_frame section for the second PLT.
1248 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1249 alignment of .eh_frame section for the second PLT.
1251 2017-09-01 Nick Clifton <nickc@redhat.com>
1254 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1257 2017-09-01 Nick Clifton <nickc@redhat.com>
1260 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1261 attribute buffer is NUL terminated.
1263 2017-08-31 Nick Clifton <nickc@redhat.com>
1266 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1267 to dwarf string sections.
1269 2017-08-31 Alan Modra <amodra@gmail.com>
1271 * po/SRC-POTFILES.in: Regenerate.
1273 2017-08-31 Alan Modra <amodra@gmail.com>
1275 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1276 for a section containing just a terminator. Allow multiple
1277 terminators at end of section.
1278 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1279 sections when not adding alignment. Assert on terminator in
1282 2017-08-31 Alan Modra <amodra@gmail.com>
1286 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1289 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1291 * configure.ac (bfd_backends): Add elf64.lo together with
1292 elfxx-x86.lo for 64-bit BFD.
1293 * configure: Regenerated.
1295 2017-08-31 James Bowman <james.bowman@ftdichip.com>
1297 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1300 2017-08-31 Alan Modra <amodra@gmail.com>
1303 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1304 before _close_and_cleanup. Call iovec->bclose after.
1305 (bfd_close): Remove code common to, and call, bfd_close_all_done.
1307 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1309 * elf32-i386.c (elf_i386_plt_type): Removed.
1310 (elf_i386_plt): Likewise.
1311 (elf_i386_get_synthetic_symtab): Updated. Call
1312 _bfd_x86_elf_get_synthetic_symtab.
1313 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1314 (elf_x86_64_plt): Likewise.
1315 (elf_x86_64_get_synthetic_symtab): Updated. Call
1316 _bfd_x86_elf_get_synthetic_symtab.
1317 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1318 (elf_x86_64_get_plt_got_vma): Likewise.
1319 (elf_i386_valid_plt_reloc_p): Likewise.
1320 (elf_x86_64_valid_plt_reloc_p): Likewise.
1321 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1322 * elfxx-x86.h (elf_x86_plt_type): New.
1323 (elf_x86_plt): Likewise.
1324 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1326 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1328 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1329 target_id instead of elf_machine_code.
1331 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1333 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1334 (elf_i386_lazy_plt_layout): Likewise.
1335 (elf_i386_non_lazy_plt_layout): Likewise.
1336 (elf_i386_plt_layout): Likewise.
1337 (elf_i386_link_hash_table): Likewise.
1338 (elf_i386_next_tls_desc_index): Likewise.
1339 (elf_i386_srelplt2): Likewise.
1340 (elf_i386_plt): Likewise.
1341 (elf_i386_lazy_plt): Likewise.
1342 (elf_i386_non_lazy_plt): Likewise.
1343 (elf_i386_link_hash_table_create): Likewise.
1344 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1345 (elf_i386_lazy_plt): Updated.
1346 (elf_i386_non_lazy_plt): Likewise.
1347 (elf_i386_lazy_ibt_plt): Likewise.
1348 (elf_i386_non_lazy_ibt_plt): Likewise.
1349 (elf_i386_allocate_dynrelocs): Likewise.
1350 (elf_i386_size_dynamic_sections): Likewise.
1351 (elf_i386_relocate_section): Likewise.
1352 (elf_i386_finish_dynamic_symbol): Likewise.
1353 (elf_i386_finish_dynamic_sections): Likewise.
1354 (elf_i386_get_synthetic_symtab): Likewise.
1355 (elf_i386_link_setup_gnu_properties): Likewise.
1356 (elf_i386_nacl_plt): Likewise.
1357 * elf64-x86-64.c (ABI_64_P): Removed.
1358 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1359 (ELF32_DYNAMIC_INTERPRETER): Likewise.
1360 (elf_x86_64_lazy_plt_layout): Likewise.
1361 (elf_x86_64_non_lazy_plt_layout): Likewise.
1362 (elf_x86_64_plt_layout): Likewise.
1363 (elf_x86_64_link_hash_table): Likewise.
1364 (elf_x86_64_plt): Likewise.
1365 (elf_x86_64_lazy_plt): Likewise.
1366 (elf_x86_64_non_lazy_plt): Likewise.
1367 (elf_x86_64_link_hash_table_create): Likewise.
1368 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1369 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1370 (elf_x86_64_lazy_plt): Updated.
1371 (elf_x86_64_non_lazy_plt): Likewise.
1372 (elf_x86_64_lazy_bnd_plt): Likewise.
1373 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1374 (elf_x86_64_lazy_ibt_plt): Likewise.
1375 (elf_x32_lazy_ibt_plt): Likewise.
1376 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1377 (elf_x32_non_lazy_ibt_plt): Likewise.
1378 (elf_x86_64_allocate_dynrelocs): Likewise.
1379 (elf_x86_64_size_dynamic_sections): Likewise.
1380 (elf_x86_64_relocate_section): Likewise.
1381 (elf_x86_64_finish_dynamic_symbol): Likewise.
1382 (elf_x86_64_finish_dynamic_sections): Likewise.
1383 (elf_x86_64_get_synthetic_symtab): Likewise.
1384 (elf_x86_64_link_setup_gnu_properties): Likewise.
1385 (elf_x86_64_nacl_plt): Likewise.
1386 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1388 (ELF32_DYNAMIC_INTERPRETER): New.
1389 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1390 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1391 (_bfd_x86_elf_link_hash_table_create): Likewise.
1392 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1393 (elf_x86_link_hash_table_free): This. Make it static.
1394 * elfxx-x86.h: Don't include "objalloc.h".
1396 (elf_x86_lazy_plt_layout): Likewise.
1397 (elf_x86_non_lazy_plt_layout): Likewise.
1398 (elf_x86_plt_layout): Likewise.
1399 (_bfd_x86_elf_link_hash_table_create): Likewise.
1400 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1401 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1402 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1403 srelplt2 and next_tls_desc_index.
1404 (_bfd_x86_elf_link_hash_table_free): Removed.
1406 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1408 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1409 branch offset interpretation.
1411 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1414 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1416 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1418 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1419 (elf_x86_64_srelplt2): Likewise.
1421 2017-08-30 Alan Modra <amodra@gmail.com>
1423 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1424 (ppc64_elf_tls_optimize): Set it.
1425 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1426 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1427 addis would add zero.
1428 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1429 (ppc_elf_tls_optimize): Set it.
1430 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1431 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1433 2017-08-30 Alan Modra <amodra@gmail.com>
1435 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1436 __tls_get_addr call sequences to LE, don't move the addi down
1437 to the nop. Replace the bl with addi and leave the nop alone.
1439 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1441 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1443 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1445 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1447 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1449 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1450 (BFD64_BACKENDS): Likewise.
1451 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1452 (BFD64_BACKENDS_CFILES): Likewise.
1453 * Makefile.in: Regenerated.
1454 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1455 elf32-i386.lo and elf64-x86-64.lo.
1456 * configure: Regenerated.
1457 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1458 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1459 "objalloc.h" and "hashtab.h".
1460 (ELIMINATE_COPY_RELOCS): Removed.
1461 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1462 (SYMBOL_NO_COPYRELOC): Likewise.
1463 (elf_i386_link_hash_entry): Likewise.
1464 (GOT_UNKNOWN): Likewise.
1465 (GOT_NORMAL): Likewise.
1466 (GOT_TLS_GD): Likewise.
1467 (elf_i386_hash_entry): Likewise.
1468 (elf_i386_obj_tdata): Likewise.
1469 (elf_i386_tdata): Likewise.
1470 (elf_i386_local_got_tls_type): Likewise.
1471 (elf_i386_local_tlsdesc_gotent): Likewise.
1472 (elf_i386_hash_table): Likewise.
1473 (elf_i386_link_hash_newfunc): Likewise.
1474 (elf_i386_local_htab_hash): Likewise.
1475 (elf_i386_local_htab_eq): Likewise.
1476 (elf_i386_get_local_sym_hash): Likewise.
1477 (elf_i386_link_hash_table_free): Likewise.
1478 (elf_i386_copy_indirect_symbol): Likewise.
1479 (elf_i386_fixup_symbol): Likewise.
1480 (elf_i386_readonly_dynrelocs): Likewise.
1481 (elf_i386_always_size_sections): Likewise.
1482 (elf_i386_set_tls_module_base): Likewise.
1483 (elf_i386_dtpoff_base): Likewise.
1484 (compare_relocs): Likewise.
1485 (elf_i386_hash_symbol): Likewise.
1486 (elf_i386_parse_gnu_properties): Likewise.
1487 (elf_i386_merge_gnu_properties): Likewise.
1488 (elf_i386_link_check_relocs): Likewise.
1489 (elf_i386_merge_symbol_attribute): Likewise.
1490 (bfd_elf32_bfd_link_check_relocs): Likewise.
1491 (elf_backend_copy_indirect_symbol): Likewise.
1492 (elf_backend_always_size_sections): Likewise.
1493 (elf_backend_omit_section_dynsym): Likewise.
1494 (elf_backend_hash_symbol): Likewise.
1495 (elf_backend_fixup_symbol): Likewise.
1496 (elf_backend_parse_gnu_properties): Likewise.
1497 (elf_backend_merge_gnu_properties): Likewise.
1498 (elf_backend_merge_symbol_attribute): Likewise.
1499 (elf_i386_mkobject): Updated.
1500 (elf_i386_link_hash_table_create): Likewise.
1501 (elf_i386_check_tls_transition): Likewise.
1502 (elf_i386_tls_transition): Likewise.
1503 (elf_i386_convert_load_reloc): Likewise.
1504 (elf_i386_check_relocs): Likewise.
1505 (elf_i386_adjust_dynamic_symbol): Likewise.
1506 (elf_i386_allocate_dynrelocs): Likewise.
1507 (elf_i386_convert_load): Likewise.
1508 (elf_i386_size_dynamic_sections): Likewise.
1509 (elf_i386_relocate_section): Likewise.
1510 (elf_i386_finish_dynamic_symbol ): Likewise.
1511 (elf_i386_finish_dynamic_sections): Likewise.
1512 (elf_i386_output_arch_local_syms): Likewise.
1513 (elf_i386_get_synthetic_symtab): Likewise.
1514 (elf_i386_link_setup_gnu_properties): Likewise.
1515 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1516 of elf_link_hash_table, as base.
1517 (elf_i386_next_tls_desc_index): New.
1518 (elf_i386_srelplt2): Likewise.
1519 (elf_i386_plt): Likewise.
1520 (elf_i386_lazy_plt): Likewise.
1521 (elf_i386_non_lazy_plt): Likewise.
1522 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1523 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1524 "objalloc.h" and "hashtab.h".
1525 (ELIMINATE_COPY_RELOCS): Removed.
1526 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1527 (SYMBOL_NO_COPYRELOC): Likewise.
1528 (elf_x86_64_link_hash_entry): Likewise.
1529 (GOT_UNKNOWN): Likewise.
1530 (GOT_NORMAL): Likewise.
1531 (GOT_TLS_GD): Likewise.
1532 (elf_x86_64_hash_entry): Likewise.
1533 (elf_x86_64_obj_tdata): Likewise.
1534 (elf_x86_64_tdata): Likewise.
1535 (elf_x86_64_local_got_tls_type): Likewise.
1536 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1537 (elf_x86_64_hash_table): Likewise.
1538 (elf_x86_64_link_hash_newfunc): Likewise.
1539 (elf_x86_64_local_htab_hash): Likewise.
1540 (elf_x86_64_local_htab_eq): Likewise.
1541 (elf_x86_64_get_local_sym_hash): Likewise.
1542 (elf_x86_64_link_hash_table_free): Likewise.
1543 (elf_x86_64_copy_indirect_symbol): Likewise.
1544 (elf_x86_64_fixup_symbol): Likewise.
1545 (elf_x86_64_readonly_dynrelocs): Likewise.
1546 (elf_x86_64_always_size_sections): Likewise.
1547 (elf_x86_64_set_tls_module_base): Likewise.
1548 (elf_x86_64_dtpoff_base): Likewise.
1549 (compare_relocs): Likewise.
1550 (elf_x86_64_merge_symbol_attribute): Likewise.
1551 (elf_x86_64_hash_symbol): Likewise.
1552 (elf_x86_64_parse_gnu_properties): Likewise.
1553 (elf_x86_64_merge_gnu_properties): Likewise.
1554 (elf_x86_64_link_check_relocs): Likewise.
1555 (elf_backend_copy_indirect_symbol): Likewise.
1556 (elf_backend_always_size_sections): Likewise.
1557 (bfd_elf64_bfd_link_check_relocs): Likewise.
1558 (elf_backend_merge_symbol_attribute): Likewise.
1559 (elf_backend_hash_symbol): Likewise.
1560 (elf_backend_omit_section_dynsym): Likewise.
1561 (elf_backend_fixup_symbol): Likewise.
1562 (elf_backend_parse_gnu_properties): Likewise.
1563 (elf_backend_merge_gnu_properties): Likewise.
1564 (bfd_elf32_bfd_link_check_relocs): Likewise.
1565 (elf_x86_64_mkobject): Updated.
1566 (elf_x86_64_link_hash_table_create): Likewise.
1567 (elf_x86_64_check_tls_transition): Likewise.
1568 (elf_x86_64_tls_transition): Likewise.
1569 (elf_x86_64_convert_load_reloc): Likewise.
1570 (elf_x86_64_check_relocs): Likewise.
1571 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1572 (elf_x86_64_allocate_dynrelocs): Likewise.
1573 (elf_x86_64_convert_load): Likewise.
1574 (elf_x86_64_size_dynamic_sections): Likewise.
1575 (elf_x86_64_relocate_section): Likewise.
1576 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1577 (elf_x86_64_finish_dynamic_sections): Likewise.
1578 (elf_x86_64_output_arch_local_syms): Likewise.
1579 (elf_x86_64_get_synthetic_symtab): Likewise.
1580 (elf_x86_64_link_setup_gnu_properties): Likewise.
1581 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1582 instead of elf_link_hash_table, as base.
1583 (elf_x86_64_next_tls_desc_index): New.
1584 (elf_x86_64_srelplt2): Likewise.
1585 (elf_x86_64_plt): Likewise.
1586 (elf_x86_64_lazy_plt): Likewise.
1587 (elf_x86_64_non_lazy_plt): Likewise.
1588 * elfxx-x86.c: New file.
1589 * elfxx-x86.h: Likewise.
1591 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1593 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1595 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1597 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1599 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1600 sections before checking dynamic relocations and free invalid
1601 PLT section contents.
1602 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1604 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1606 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1607 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1609 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1612 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1614 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1616 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1618 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1620 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1622 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1625 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1626 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1627 Add a has_no_copy_on_protected bitfield.
1628 (elf_has_no_copy_on_protected): New.
1629 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1630 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1631 (elf_merge_gnu_property_list): Likewise.
1632 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1633 to FALSE for elf_has_no_copy_on_protected.
1634 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1635 (elf_i386_link_hash_entry): Add def_protected.
1636 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1637 when checking info->nocopyreloc.
1638 (elf_i386_link_setup_gnu_properties): Don't set
1639 extern_protected_data here.
1640 (elf_i386_merge_symbol_attribute): New function.
1641 (elf_backend_merge_symbol_attribute): New.
1642 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1643 (elf_x86_64_link_hash_entry): Add def_protected.
1644 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1645 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1646 when checking info->nocopyreloc.
1647 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1648 relocation run-time overflow and unresolvable R_X86_64_32S
1649 relocation against protected data symbol defined in shared object
1650 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1651 (elf_x86_64_link_setup_gnu_properties): Don't set
1652 extern_protected_data here.
1653 (elf_x86_64_merge_symbol_attribute): New function.
1654 (elf_backend_merge_symbol_attribute): New.
1656 2017-08-26 Alan Modra <amodra@gmail.com>
1658 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1659 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1660 (ppc_elf_relocate_section): Comment fix.
1661 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1662 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1663 Support dynamic relocs for TPREL16 when non-pic too.
1664 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1665 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1668 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1670 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1671 "symbol" in comments.
1672 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1674 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1677 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1678 R_X86_64_PC32 relocation run-time overflow and unresolvable
1679 R_X86_64_32S relocation with -z nocopyreloc.
1681 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1683 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1684 Undefined symbols may not have a type.
1685 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1687 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1689 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1690 bfd_link_info. Report shared, PIE or PDE object based on
1692 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1693 (elf_x86_64_relocate_section): Likewise.
1695 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1697 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1698 for function symbols.
1699 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1701 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1703 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1704 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1705 is set on any input relocatable file.
1706 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1708 2017-08-23 Alan Modra <amodra@gmail.com>
1711 * elf64-ppc.c (ensure_undef_dynamic): Rename from
1712 ensure_undefweak_dynamic. Handle undefined too.
1713 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1714 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1715 (allocate_dynrelocs): Discard undefined non-default visibility
1716 relocs first. Make undefined syms dynamic. Tidy goto.
1718 2017-08-21 Alan Modra <amodra@gmail.com>
1719 H.J. Lu <hongjiu.lu@intel.com>
1722 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
1723 * elflink.c (bfd_elf_define_start_stop): Rewrite.
1725 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
1728 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
1729 undefined weak symbols.
1731 2017-08-18 Nick Clifton <nickc@redhat.com>
1734 * tekhex.c (getsym): Fix check for source pointer walking off the
1735 end of the input buffer.
1737 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
1740 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
1741 relocations in debug sections, change abort to _bfd_error_handler.
1743 2017-08-14 Nick Clifton <nickc@redhat.com>
1746 * elf.c (setup_group): Check for an empty or very small group
1748 * po/bfd.pot: Regenerate.
1750 2017-08-14 Alan Modra <amodra@gmail.com>
1753 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
1754 alignment padding here.
1755 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
1756 in a reverse pass over sections.
1758 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
1761 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
1762 for @plt suffixes first.
1763 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1765 2017-08-08 Nick Clifton <nickc@redhat.com>
1768 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
1769 small section lengths.
1770 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
1772 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
1773 there is enough data present in the note.
1775 2017-08-08 Alan Modra <amodra@gmail.com>
1778 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
1779 got.refcount for GOTOFF relocs, just create .got section.
1781 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
1783 * elflink.c (elf_link_add_object_symbols): Move common symbol
1784 check after bed->common_definition.
1786 2017-08-07 Alan Modra <amodra@gmail.com>
1789 * elflink.c (bfd_elf_final_link): Don't segfault when sections
1790 needed to define various dynamic tags have been discarded.
1792 2017-08-07 Nick Clifton <nickc@redhat.com>
1795 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
1796 has not been set then use the bfd returned by
1797 _bfd_elf_link_setup_gnu_properties. If that is null then search
1798 through all the input bfds selecting the first normal, ELF format
1800 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1802 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1804 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
1806 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
1807 (elf_i386_check_tls_transition): Check tls_get_addr directly.
1808 (elf_i386_convert_load_reloc): Update tls_get_addr check.
1809 (elf_i386_link_check_relocs): New function.
1810 (bfd_elf32_bfd_link_check_relocs): New.
1811 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
1813 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
1814 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
1815 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
1816 (elf_x86_64_link_check_relocs): New function.
1817 (bfd_elf64_bfd_link_check_relocs): New.
1818 (bfd_elf32_bfd_link_check_relocs): Likewise.
1820 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1823 * elflink.c (elf_link_add_object_symbols): Treat common symbol
1824 as undefined for --no-define-common.
1826 2017-08-05 Alan Modra <amodra@gmail.com>
1828 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
1829 hppa_link_hash_table.
1831 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
1833 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
1834 entries for sysregs with negative indices.
1836 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1838 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
1839 isn't the S/390 specific elf data.
1840 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1842 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
1844 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
1845 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
1846 [R_RISCV_ADD16]: Likewise.
1847 [R_RISCV_ADD32]: Likewise.
1848 [R_RISCV_ADD64]: Likewise.
1849 [R_RISCV_SUB6]: Likewise.
1850 [R_RISCV_SUB8]: Likewise.
1851 [R_RISCV_SUB16]: Likewise.
1852 [R_RISCV_SUB32]: Likewise.
1853 [R_RISCV_SUB64]: Likewise.
1855 2017-07-31 Alan Modra <amodra@gmail.com>
1857 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
1858 without ld.so checks.
1860 2017-07-29 Alan Modra <amodra@gmail.com>
1863 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
1864 (ppc64_elf_merge_symbol): Set non_zero_localentry.
1865 (is_elfv2_localentry0): Test non_zero_localentry.
1866 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
1868 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1870 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
1871 pointer check for htab->elf.irelplt.
1872 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1874 2017-07-27 Nick Clifton <nickc@redhat.com>
1877 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
1879 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
1881 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
1883 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
1885 (evax_bfd_print_emh): Check for invalid string lengths.
1887 2017-07-25 Nick Clifton <nickc@redhat.com>
1889 * po/fr.po: Updated French translation.
1891 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
1894 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
1895 16-bit absolute branches into 10-bit pc-relative branches on the
1896 MSP430 as well as the MSP430X.
1898 2017-07-25 Alan Modra <amodra@gmail.com>
1900 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
1901 (stub_eh_frame_size): New function.
1902 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
1903 (group_sections): Init group tls_get_addr_opt_bctrl.
1904 (ppc64_elf_size_stubs): Update sizing and initialization of
1905 .eh_frame. Iteration over stubs via group list.
1906 (ppc64_elf_build_stubs): Iterate over stubs via group list.
1907 (ppc64_elf_finish_dynamic_sections): Update finalization of
1910 2017-07-24 Nick Clifton <nickc@redhat.com>
1913 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
1914 of the relocs to the canonicalize_one_reloc routine.
1915 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
1916 for the _bfd_mach_o_canonicalize_one_reloc field.
1917 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
1918 res_base parameter. Use to check for corrupt pair relocs.
1919 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
1921 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
1923 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
1926 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
1927 enough data in the record before attempting to parse it.
1928 (_bfd_vms_slurp_eeom): Likewise.
1930 (_bfd_vms_slurp_egsd): Check for an invalid section index.
1931 (image_set_ptr): Likewise.
1932 (alpha_vms_slurp_relocs): Likewise.
1934 (alpha_vms_object_p): Check for a truncated record.
1936 2017-07-24 Nick Clifton <nickc@redhat.com>
1939 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
1940 an unrecognized reloc and sets the bfd_error value.
1941 * libbfd.h: Regenerate.
1942 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
1944 * elf32-i386.c (elf_i386_relocate_section): Likewise.
1945 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1946 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1947 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
1948 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1950 2017-07-23 Alan Modra <amodra@gmail.com>
1952 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
1955 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
1958 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
1959 reloc_class_ifunc for ifunc symbols.
1961 2017-07-19 Nick Clifton <nickc@redhat.com>
1964 * archive.c (bfd_generic_archive_p): If the bfd does not have the
1965 correct magic bytes at the start, set the error to wrong format
1966 and clear the format selector before returning NULL.
1968 2017-07-19 Nick Clifton <nickc@redhat.com>
1971 * coff-rs6000.c (_bfd_strntol): New function.
1972 (_bfd_strntoll): New function.
1973 (GET_VALUE_IN_FIELD): New macro.
1974 (EQ_VALUE_IN_FIELD): new macro.
1975 (_bfd_xcoff_slurp_armap): Use new macros.
1976 (_bfd_xcoff_archive_p): Likewise.
1977 (_bfd_xcoff_read_ar_hdr): Likewise.
1978 (_bfd_xcoff_openr_next_archived_file): Likewise.
1979 (_bfd_xcoff_stat_arch_elt): Likewise.
1980 * coff64-rs6000.c (_bfd_strntol): New function.
1981 (_bfd_strntoll): New function.
1982 (GET_VALUE_IN_FIELD): New macro.
1983 (xcoff64_slurp_armap): Use new macros.
1985 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
1986 John Eric Martin <John.Martin@emmicro-us.com>
1988 * bfd-in2.h: Regenerate.
1989 * libbfd.h: Regenerate.
1990 * elf32-arc.c (JLI): Define.
1991 * reloc.c: Add JLI relocations.
1993 2017-07-18 Nick Clifton <nickc@redhat.com>
1996 * coff-sh.c: Fix spelling typos.
1997 * compress.c: Likewise.
1998 * cpu-pdp11.c: Likewise.
1999 * ecofflink.c: Likewise.
2000 * elf-m10300.c: Likewise.
2002 * elf32-arm.c: Likewise.
2003 * elf32-m68k.c: Likewise.
2004 * elf32-nds32.c: Likewise.
2005 * elf32-ppc.c: Likewise.
2006 * elf32-sh.c: Likewise.
2007 * elf32-v850.c: Likewise.
2008 * elf64-ppc.c: Likewise.
2009 * elf64-x86-64.c: Likewise.
2010 * elflink.c: Likewise.
2011 * elfnn-aarch64.c: Likewise.
2012 * elfxx-mips.c: Likewise.
2014 * sunos.c: Likewise.
2015 * vms-alpha.c: Likewise.
2016 * xcofflink.c: Likewise.
2018 2017-07-18 Nick Clifton <nickc@redhat.com>
2021 * coffcode.h (handle_COMDAT): Replace abort with an error message
2024 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2027 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
2030 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2032 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2034 2017-07-16 Alan Modra <amodra@gmail.com>
2036 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
2037 __tls_index GOT entries when using __tls_get_addr_opt stub.
2038 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2040 2017-07-12 Alan Modra <amodra@gmail.com>
2042 * po/es.po: Update from translationproject.org/latest/bfd/.
2043 * po/fi.po: Likewise.
2044 * po/fr.po: Likewise.
2045 * po/id.po: Likewise.
2046 * po/ja.po: Likewise.
2047 * po/ro.po: Likewise.
2048 * po/ru.po: Likewise.
2049 * po/sr.po: Likewise.
2050 * po/sv.po: Likewise.
2051 * po/tr.po: Likewise.
2052 * po/uk.po: Likewise.
2053 * po/vi.po: Likewise.
2054 * po/zh_CN.po: Likewise.
2055 * po/hr.po: New file from translationproject.org.
2056 * configure.ac (ALL_LINGUAS): Add hr. Sort.
2057 * configure: Regenerate.
2059 2017-07-12 Nick Clifton <nickc@redhat.com>
2061 Fix compile time warnings using gcc 7.1.1.
2062 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
2064 (elf_xtensa_get_gotplt_section): Increase length of got_name
2066 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
2067 default return of FALSE.
2068 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
2069 default return of FALSE.
2071 2017-07-12 Alan Modra <amodra@gmail.com>
2073 * binary.c (binary_set_section_contents): Don't print filepos in
2075 (coff_write_object_contents): Cast size_t for error message.
2076 (coff_slurp_line_table): Don't use bfd_vma symndx.
2077 (coff_slurp_reloc_table): Remove unneeded cast.
2078 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
2080 (find_abstract_instance_name): Likewise.
2081 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
2082 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
2083 (elf32_arm_check_relocs): Make r_symndx an int.
2084 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
2086 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
2088 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
2090 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
2091 * elf32-s390.c (elf_s390_check_relocs): Likewise.
2092 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
2093 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
2094 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2095 * elf64-s390.c (elf_s390_check_relocs): Likewise.
2096 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2097 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
2098 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2099 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
2100 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
2101 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
2102 and use %lu for error message.
2103 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
2104 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
2107 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
2109 (elf32_arm_final_link_relocate): Likewise.
2110 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
2111 * coffcode.h (styp_to_sec_flags): Likewise.
2112 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
2113 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
2114 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
2115 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
2116 (elf32_bfin_merge_private_bfd_data): Likewise.
2117 * elf32-cris.c (cris_elf_relocate_section): Likewise.
2118 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2119 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
2120 (i370_elf_relocate_section): Likewise.
2121 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
2122 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
2123 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
2124 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2125 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
2126 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
2127 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
2128 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
2129 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2130 * ieee.c (ieee_write_id, read_id): Likewise.
2131 * mach-o.c (bfd_mach_o_write_contents): Likewise.
2132 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
2133 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
2134 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
2135 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
2136 * stabs.c (_bfd_link_section_stabs): Likewise.
2138 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
2140 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2141 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2142 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
2143 * coff-sh.c (sh_relax_section): Likewise.
2144 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
2145 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2146 * coffcode.h (coff_slurp_reloc_table): Likewise.
2147 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2148 (_bfd_coff_read_string_table): Likewise.
2149 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
2150 * compress.c (bfd_get_full_section_contents): Likewise.
2151 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
2152 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2153 * elf.c (bfd_elf_string_from_elf_section): Likewise.
2154 * elf32-arc.c (arc_special_overflow_checks): Likewise.
2155 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
2156 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
2157 (elf32_arm_write_section): Likewise.
2158 * elf32-bfin.c (bfin_relocate_section): Likewise.
2159 (bfinfdpic_relocate_section): Likewise.
2160 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2161 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
2162 * elf32-i386.c (elf_i386_tls_transition): Likewise.
2163 (elf_i386_relocate_section): Likewise.
2164 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
2165 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
2166 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2167 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2168 * elf32-metag.c (elf_metag_relocate_section): Likewise.
2169 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
2170 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
2171 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
2172 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
2173 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
2174 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
2175 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
2176 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
2177 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
2178 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
2179 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
2180 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
2181 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
2182 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
2183 * elf32-sh.c (sh_elf_relax_section): Likewise.
2184 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
2185 (sh_elf_relocate_section): Likewise.
2186 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
2187 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2188 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2189 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2190 * elf32-v850.c (v850_elf_relax_section): Likewise.
2191 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2192 (elf_vax_relocate_section): Likewise.
2193 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2194 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2195 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2196 (do_fix_for_relocatable_link): Likewise.
2197 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2198 (elf64_alpha_relax_with_lituse): Likewise.
2199 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2200 (elf_hppa_final_link_relocate): Likewise.
2201 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2202 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2203 (elf64_vms_link_add_object_symbols): Likewise.
2204 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2205 (mmix_final_link_relocate): Likewise.
2206 * elf64-s390.c (invalid_tls_insn): Likewise.
2207 (elf_s390_relocate_section): Likewise.
2208 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2209 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2210 (elf_x86_64_relocate_section): Likewise.
2211 * elfcode.h (elf_slurp_symbol_table): Likewise.
2212 * elfcore.h (elf_core_file_p): Likewise.
2213 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2214 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2215 (elfNN_aarch64_relocate_section): Likewise.
2216 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2217 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2218 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2219 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2220 (_bfd_mips_elf_relocate_section): Likewise.
2221 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2222 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2223 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2224 * ieee.c (ieee_slurp_external_symbols): Likewise.
2225 * ihex.c (ihex_write_object_content): Likewise.
2226 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2227 * merge.c (_bfd_merged_section_offset): Likewise.
2228 * mmo.c (mmo_write_loc_chunk): Likewise.
2229 (mmo_write_object_contents): Likewise.
2230 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2231 * stabs.c (_bfd_link_section_stabs): Likewise.
2232 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2234 2017-07-11 Alan Modra <amodra@gmail.com>
2236 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2238 2017-07-11 Alan Modra <amodra@gmail.com>
2240 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2241 instruction" error using _bfd_error_handler, not einfo.
2243 2017-07-10 Nick Clifton <nickc@redhat.com>
2245 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2246 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2248 2017-07-07 John Baldwin <jhb@FreeBSD.org>
2250 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2252 2017-07-07 Alan Modra <amodra@gmail.com>
2254 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2256 2017-07-07 Alan Modra <amodra@gmail.com>
2258 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2259 as long long. Move code replacing "ll" with "I64", and simplify.
2261 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2263 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2266 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2268 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2270 (line_info_add_file_name): Likewise.
2271 (decode_line_info): Likewise.
2273 2017-07-04 Tristan Gingold <gingold@adacore.com>
2275 * version.m4: Bump version to 2.29.51
2276 * configure: Regenerate.
2278 2017-07-04 Jiong Wang <jiong.wang@arm.com>
2280 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2281 sanity check at the head of this function.
2283 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2285 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2286 dwarf_line_str_size.
2287 (struct attr_abbrev): Add field implicit_const.
2288 (dwarf_debug_sections): Add .debug_line_str.
2289 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2290 (dwarf_debug_section_assert): Add static assertion.
2291 (read_indirect_line_string): New.
2292 (read_abbrevs): Support DW_FORM_implicit_const.
2293 (is_str_attr): Support DW_FORM_line_strp.
2294 (read_attribute_value): Support DW_FORM_line_strp and
2295 DW_FORM_implicit_const.
2296 (read_attribute): Support DW_FORM_implicit_const.
2297 (line_info_add_include_dir, line_info_add_include_dir_stub):
2298 (line_info_add_file_name, read_formatted_entries): New.
2299 (decode_line_info, parse_comp_unit): Support DWARF 5.
2300 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2302 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2304 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2305 abort statement that was put for symbols that are not dynamic.
2307 2017-07-03 Tristan Gingold <gingold@adacore.com>
2309 * po/bfd.pot: Regenerate
2311 2017-07-03 Alan Modra <amodra@gmail.com>
2313 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2314 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
2315 * elf.c (setup_group): Use "Lx" to print sh_size.
2316 (_bfd_elf_setup_sections): Remove unnecessary cast and print
2317 unknown section type in hex.
2318 (copy_special_section_fields): Style fix.
2319 (bfd_section_from_shdr): Correct format for sh_link. Use a
2320 common error message for all the variants of unrecognized
2322 (assign_file_positions_for_load_sections): Use "Lx" for lma
2323 adjust error message.
2324 (assign_file_positions_for_non_load_sections): Formatting.
2325 (rewrite_elf_program_header): Formatting. Use "Lx" for
2326 bfd_vma values in error messages.
2327 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2328 ELF_R_SYM value to type expected by format.
2329 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2331 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2332 (elf_link_input_bfd): Use "Lx" for r_info.
2333 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2335 2017-07-03 Alan Modra <amodra@gmail.com>
2337 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2338 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2339 Microsoft C library variant of long long format specifier.
2340 (PRINT20): Cast value to bfd_uint64_t not long long.
2341 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2342 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2343 long long. Don't cast to bfd_vma.
2344 * elf32-score.c (score3_bfd_getl48): Likewise.
2345 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2347 2017-07-03 Alan Modra <amodra@gmail.com>
2349 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2351 (bfd_elf_print_symbol): Don't cast symbol->flags.
2352 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2353 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2354 _bfd_error_handler argument order.
2355 (ppc_elf_merge_private_bfd_data): Don't cast flags.
2357 2017-07-03 Alan Modra <amodra@gmail.com>
2359 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
2360 AC_TYPE_LONG_DOUBLE.
2361 * configure: Regenerate.
2362 * config.in: Regenerate.
2364 2017-06-29 Andrew Waterman <andrew@sifive.com>
2366 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2369 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2371 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2372 unless it is undefined weak.
2373 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2374 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2376 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2377 is not dynamic in PIC, abort.
2379 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2382 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2383 undefined weak symbols into dynamic.
2384 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2385 relocation for non-dynamic symbols.
2386 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2388 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2390 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2391 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2392 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2393 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2394 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2397 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
2399 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2400 (elfcore_write_s390_gs_bc): Likewise.
2401 * elf.c (elfcore_grok_s390_gs_cb): New function.
2402 (elfcore_grok_s390_gs_bc): New function.
2403 (elfcore_grok_note): Call them.
2404 (elfcore_write_s390_gs_cb): New function.
2405 (elfcore_write_s390_gs_bc): New function.
2406 (elfcore_write_register_note): Call them.
2408 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2410 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2411 bfd_get_file_size. Check archive element size.
2412 (_bfd_generic_get_section_contents_in_window): Likewise.
2414 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2416 * bfd-in2.h: Regenerated.
2417 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2418 (bfd_get_file_size): Likewise.
2420 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2421 Matthew Fortune <matthew.fortune@imgtec.com>
2423 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2424 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2425 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2426 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2428 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2429 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2430 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2431 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2432 `bfd_mach_mips_interaptiv_mr2' entries.
2433 * bfd-in2.h: Regenerate.
2435 2017-06-27 Nick Clifton <nickc@redhat.com>
2437 * tekhex.c (pass_over): Revert accidental conversion of a local
2438 array to a static array.
2440 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2443 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2444 reloc addend if necessary. Adjust diff only if
2445 shrinked_insn_address < end_address.
2447 2017-06-27 Alan Modra <amodra@gmail.com>
2450 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2451 (_bfd_generic_get_section_contents_in_window): Likewise.
2453 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2455 * elfnn-riscv.c (perform_relocation): Support the new
2456 R_RISCV_32_PCREL relocation.
2457 (riscv_elf_relocate_section): Likewise.
2458 * elfxx-riscv.c (howto_table): Likewise.
2459 (riscv_reloc_map): Likewise.
2460 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2461 * libbfd.h: Regenerate.
2463 2017-06-27 Alan Modra <amodra@gmail.com>
2466 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2467 Use unsigned file pointer type, and remove cast.
2468 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2469 Add "count", not "sz".
2471 2017-06-26 Pedro Alves <palves@redhat.com>
2474 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2477 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2480 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2483 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2485 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2486 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2487 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2488 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2489 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2491 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2494 * compress.c (bfd_get_full_section_contents): Don't check the
2496 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2497 reject a section whose size + offset is greater than the size
2499 (_bfd_generic_get_section_contents_in_window): Likewise.
2501 2017-06-26 Nick Clifton <nickc@redhat.com>
2504 * tekhex.c (getvalue): Check for the source pointer exceeding the
2505 end pointer before the first byte is read.
2507 2017-06-26 Nick Clifton <nickc@redhat.com>
2510 * opncls.c (get_build_id): Check that the section is big enough
2511 to contain the whole note.
2512 * compress.c (bfd_get_full_section_contents): Check for and reject
2513 a section whose size is greater than the size of the entire file.
2514 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2515 contain a notes section.
2517 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2519 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2521 (elf_s390_modify_segment_map): Likewise.
2522 (bfd_elf_s390_set_options): Lisewise.
2524 2017-06-26 Alan Modra <amodra@gmail.com>
2526 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2528 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2529 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2530 .preinit_array on --just-syms bfds.
2531 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2532 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2533 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2535 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2537 * elf.c (find_link): Bounds check "hint".
2539 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2541 * elf32-arm.c (using_thumb_only): Update list of architectures in
2542 BFD_ASSERT for which the logic is valid.
2543 (using_thumb2_bl): Likewise.
2544 (using_thumb2): Likewise and return true for ARMv8-R.
2545 (arch_has_arm_nop): Likewise.
2546 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2547 merging logic. Update commentis for value 15 of v8m_baseline,
2548 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2549 merging of value 15 of Tag_CPU_arch.
2551 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2553 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2554 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2555 * bfd-in2.h: Regenerate.
2557 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2559 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2560 the error_alignment label forward. Properly align program
2561 property note section.
2563 2017-06-22 Eric Christopher <echristo@gmail.com>
2565 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2566 abs to fix a truncation warning.
2568 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2570 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2571 local undefined weak symbol to 0.
2572 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2574 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2576 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2577 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2578 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2579 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2580 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2581 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2582 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2583 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2585 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2587 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2588 (elf_i386_lazy_ibt_plt_entry): Likewise.
2589 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2590 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2591 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2592 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2593 (elf_i386_lazy_plt_layout): Likewise.
2594 (elf_i386_non_lazy_plt_layout): Likewise.
2595 (elf_i386_link_hash_entry): Add plt_second.
2596 (elf_i386_link_hash_table): Add plt_second and
2597 plt_second_eh_frame.
2598 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2599 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2600 the second PLT. Check the second PLT.
2601 (elf_i386_relocate_section): Use the second PLT to resolve
2602 PLT reference if needed.
2603 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2605 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2606 second PLT. Generate unwind info for the second PLT.
2607 (elf_i386_plt_type): Add plt_second.
2608 (elf_i386_get_synthetic_symtab): Support the second PLT.
2609 (elf_i386_parse_gnu_properties): Support
2610 GNU_PROPERTY_X86_FEATURE_1_AND.
2611 (elf_i386_merge_gnu_properties): Support
2612 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2613 on GNU_PROPERTY_X86_FEATURE_1_IBT
2614 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2615 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2616 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2617 is set on all relocatable inputs.
2618 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2619 (elf_x32_lazy_ibt_plt_entry): Likewise.
2620 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2621 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2622 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2623 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2624 (elf_x86_64_lazy_ibt_plt): Likewise.
2625 (elf_x32_lazy_ibt_plt): Likewise.
2626 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2627 (elf_x32_non_lazy_ibt_plt): Likewise.
2628 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2629 (elf_x86_64_parse_gnu_properties): Support
2630 GNU_PROPERTY_X86_FEATURE_1_AND.
2631 (elf_x86_64_merge_gnu_properties): Support
2632 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2633 on GNU_PROPERTY_X86_FEATURE_1_IBT
2634 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2635 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2636 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2637 is set on all relocatable inputs.
2639 2017-06-22 Nick Clifton <nickc@redhat.com>
2642 * som.c (setup_sections): NUL terminate the space_strings buffer.
2643 Check that the space.name field does not index beyond the end of
2644 the space_strings buffer.
2646 2017-06-21 Nick Clifton <nickc@redhat.com>
2649 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2651 2017-06-21 Nick Clifton <nickc@redhat.com>
2654 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2655 type of the size parameter.
2656 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2657 length of the counted string.
2658 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2659 (_bfd_vms_save_counted_string): Likewise.
2660 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2661 _bfd_vms_save_counted_string.
2662 (_bfd_vms_slurp_ehdr): Likewise.
2663 (_bfd_vms_slurp_egsd): Likewise.
2664 (Parse_module): Likewise.
2666 2017-06-21 Alan Modra <amodra@gmail.com>
2668 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2669 calls before tocsave calls.
2670 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2673 2017-06-21 Nick Clifton <nickc@redhat.com>
2676 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2677 bfd_get_full_section_contents returns no contents.
2679 2017-06-21 Nick Clifton <nickc@redhat.com>
2682 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2685 2017-06-21 Nick Clifton <nickc@redhat.com>
2688 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2690 (image_set_ptr): Likewise.
2691 (alpha_vms_fix_sec_rel): Likewise.
2692 (alpha_vms_slurp_relocs): Likewise.
2694 2017-06-21 Nick Clifton <nickc@redhat.com>
2697 * ieee.c (ieee_slurp_sections): Check for a NULL return from
2699 (ieee_archive_p): Likewise.
2700 (ieee_object_p): Likewise.
2702 2017-06-21 Nick Clifton <nickc@redhat.com>
2705 * elf.c (setup_group): Zero the group section pointer list after
2706 allocation so that loops can be caught. Check for NULL pointers
2707 when processing a group list.
2709 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2711 * elf-s390.h: New file.
2712 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2714 (elf_s390_additional_program_headers): New function.
2715 (elf_s390_modify_segment_map): New function.
2716 (bfd_elf_s390_set_options): New function.
2717 (elf_backend_additional_program_headers)
2718 (elf_backend_modify_segment_map): Add macro definitions.
2720 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
2723 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
2724 the DYNAMIC bit instead of bfd_count_sections.
2726 2017-06-19 Nick Clifton <nickc@redhat.com>
2729 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
2731 (evax_bfd_print_eeom): Likewise.
2732 (evax_bfd_print_egsd): Check for an overlarge record length.
2733 (evax_bfd_print_etir): Likewise.
2735 2017-06-19 Nick Clifton <nickc@redhat.com>
2738 * libieee.h (struct common_header_type): Add end_p field.
2739 * ieee.c (this_byte_and_next): Do not advance input_p beyond
2741 (read_id): Check for a length that exceeds the remaining bytes in
2743 (ieee_seek): Initialise end_p.
2744 (ieee_archive_p): Likewise.
2745 (ieee_object_p): Likewise.
2747 2017-06-19 Nick Clifton <nickc@redhat.com>
2750 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
2751 before reading the EIHS structure entries.
2753 2017-06-19 Nick Clifton <nickc@redhat.com>
2756 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
2757 gsd_size. Check that there are enough bytes remaining to read the
2758 type and size of the next egsd. Check that the size of the egsd
2759 does not exceed the size of the record.
2761 2017-06-19 Alan Modra <amodra@gmail.com>
2763 * config.bfd: Correct targ_underscore for cris.
2765 2017-06-18 Alan Modra <amodra@gmail.com>
2767 * config.bfd: Correct targ_underscore for epiphany, ip2k,
2768 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
2770 2017-06-16 Nick Clifton <nickc@redhat.com>
2772 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
2773 bucketlist is empty because there are no symbols to add to the
2776 2017-06-16 Alan Modra <amodra@gmail.com>
2782 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
2783 (BFD_JUMP_TABLE_LINK): Likewise.
2784 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
2785 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
2786 (bfd_elf_define_start_stop): New function.
2787 * linker.c (bfd_generic_define_start_stop): New function.
2788 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
2790 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
2791 * aout-target.h (MY_bfd_define_start_stop): Define.
2792 * aout-tic30.c (MY_bfd_define_start_stop): Define.
2793 * binary.c (binary_bfd_define_start_stop): Define.
2794 * bout.c (b_out_bfd_define_start_stop): Define.
2795 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
2796 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
2797 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
2798 * coffcode.h (coff_bfd_define_start_stop): Define.
2799 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
2800 * i386msdos.c (msdos_bfd_define_start_stop): Define.
2801 * i386os9k.c (os9k_bfd_define_start_stop): Define.
2802 * ieee.c (ieee_bfd_define_start_stop): Define.
2803 * ihex.c (ihex_bfd_define_start_stop): Define.
2804 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
2805 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
2806 * mmo.c (mmo_bfd_define_start_stop): Define.
2807 * nlm-target.h (nlm_bfd_define_start_stop): Define.
2808 * oasys.c (oasys_bfd_define_start_stop): Define.
2809 * pef.c (bfd_pef_bfd_define_start_stop): Define.
2810 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
2811 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
2812 * som.c (som_bfd_define_start_stop): Define.
2813 * srec.c (srec_bfd_define_start_stop): Define.
2814 * tekhex.c (tekhex_bfd_define_start_stop): Define.
2815 * versados.c (versados_bfd_define_start_stop): Define.
2816 * vms-alpha.c (vms_bfd_define_start_stop): Define.
2817 (alpha_vms_bfd_define_start_stop): Define.
2818 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
2819 * bfd-in2.h: Regenerate.
2820 * libbfd.h: Regenerate.
2822 2017-06-16 Jiong Wang <jiong.wang@arm.com>
2824 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
2825 SYMBOL_REFERENCES_LOCAL.
2827 2017-06-15 Jiong Wang <jiong.wang@arm.com>
2830 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
2831 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
2832 runtime for if there needs copy relocation elimination.
2833 (need_copy_relocation_p): New function. Return true for symbol with
2834 pc-relative references and if it's against read-only sections.
2835 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
2836 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
2837 that are related with accessing external objects.
2838 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
2839 in elfNN_aarch64_check_relocs.
2841 2017-06-15 Nick Clifton <nickc@redhat.com>
2844 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
2847 (ieee_archive_p): Likewise.
2849 2017-06-15 Nick Clifton <nickc@redhat.com>
2852 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
2854 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
2856 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
2857 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
2858 keep both windowed and call0 ABI PLT definitions.
2859 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
2860 elf_xtensa_*_plt_entry endex.
2861 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
2863 2017-06-14 Nick Clifton <nickc@redhat.com>
2866 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
2869 2017-06-14 Nick Clifton <nickc@redhat.com>
2872 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
2873 maximum value for the ascic pointer. Check that name processing
2874 does not read beyond this value.
2875 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
2878 2017-06-14 Nick Clifton <nickc@redhat.com>
2881 * versados.c (versados_mkobject): Zero the allocated tdata structure.
2882 (process_otr): Check for an invalid offset in the otr structure.
2884 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
2886 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
2888 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
2894 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
2895 vtable field to a union.
2896 (_bfd_elf_is_start_stop): Removed.
2897 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
2898 __start_SECNAME and __stop_SECNAME symbols.
2899 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
2900 * elflink.c (_bfd_elf_is_start_stop): Removed.
2901 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
2902 _bfd_elf_is_start_stop.
2903 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
2904 __stop_SECNAME symbols. Updated.
2905 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2906 (bfd_elf_gc_record_vtinherit): Likewise.
2907 (bfd_elf_gc_record_vtentry): Likewise.
2909 2017-06-13 Nick Clifton <nickc@redhat.com>
2912 * elflink.c (elf_link_adjust_relocs): Generate an error when
2913 encountering a reloc against a symbol removed by garbage
2916 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
2918 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
2919 to merge_gnu_properties.
2920 * elf-properties.c (elf_merge_gnu_properties): Add struct
2921 bfd_link_info * and pass it to merge_gnu_properties.
2922 (elf_merge_gnu_property_list): Add struct bfd_link_info *
2923 and pass it to elf_merge_gnu_properties.
2924 (_bfd_elf_link_setup_gnu_properties): Pass info to
2925 elf_merge_gnu_property_list.
2926 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
2928 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
2930 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
2933 * binary.c (binary_set_section_contents): Scale lma by octets
2934 per byte to set filepos.
2936 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2938 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
2941 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2943 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
2946 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2948 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
2949 patched section contents for TLS IE reloc.
2950 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
2952 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2954 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
2955 RELOC_FOR_GLOBAL_SYMBOL macro.
2957 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2959 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
2962 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2964 * config/tc-arc.c (md_undefined_symbol): Changed.
2965 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
2967 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2969 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
2972 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2974 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
2975 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
2977 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2979 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
2982 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
2984 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
2985 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
2986 is non-zero. Add clarifying comments.
2988 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
2990 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
2991 name. Use local IFUNC symbol name string to report unsupported
2992 non-PIC call to IFUNC function.
2993 (elf_i386_relocate_section): Dump local IFUNC name with minfo
2994 when generating R_386_IRELATIVE relocation.
2995 (elf_i386_finish_dynamic_symbol): Likewise.
2996 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
2998 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
2999 when generating R_X86_64_IRELATIVE relocation.
3000 (elf_x86_64_finish_dynamic_symbol): Likewise.
3002 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3004 * elf.c (setup_group): Make sure BFD sections are created for all
3005 group sections in the input file when processing SHF_GROUP
3007 (bfd_section_from_shdr): Avoid duplicating logic already
3008 implemented in `setup_group'.
3010 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
3013 * peXXigen.c (pe_print_idata): Use the address of the first thunk
3014 if the hint address is zero.
3016 2017-06-06 James Clarke <jrtc27@jrtc27.com>
3019 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
3020 ELF_COMMON_DEF_P for common symbols.
3022 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
3024 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
3025 SEC_GROUP sections as SEC_EXCLUDE.
3026 (bfd_elf_set_group_contents): Replace use of abort with an assert.
3027 (assign_section_numbers): Use resolve_section_groups flag instead
3028 of relocatable link type.
3029 (_bfd_elf_init_private_section_data): Use resolve_section_groups
3030 flag instead of checking the final_link flag for part of the
3031 checks in here. Fix white space as a result.
3032 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
3033 instead of relocatable link type.
3034 (bfd_elf_final_link): Likewise.
3036 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3038 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
3040 * elf32-score.c (score_elf_final_link_relocate): Likewise.
3041 (s3_bfd_score_elf_check_relocs): Likewise.
3042 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3043 (score_elf_final_link_relocate): Likewise.
3044 (s7_bfd_score_elf_check_relocs): Likewise.
3046 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3048 * elflink.c (init_reloc_cookie_rels): Remove unused variable
3051 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
3053 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
3054 from `reloc_count' rather than decrementing it.
3055 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
3056 `reloc_count' by `int_rels_per_ext_rel'.
3057 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
3058 `reloc_count' by `int_rels_per_ext_rel' for last relocation
3059 entry determination.
3060 (s3_bfd_score_elf_check_relocs): Likewise.
3061 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
3062 (s7_bfd_score_elf_relocate_section): Likewise.
3063 (s7_bfd_score_elf_check_relocs): Likewise.
3064 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
3065 prototype and function.
3066 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
3067 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
3068 triple rather than once the sum of REL and RELA relocation entry
3070 (bfd_elf64_get_reloc_upper_bound): Remove macro.
3071 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
3072 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
3073 storage allocation size determination.
3074 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
3075 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
3076 by `int_rels_per_ext_rel' for last relocation entry
3078 (bfd_elf_final_link): Do not multiply `reloc_count' by
3079 `int_rels_per_ext_rel' for internal relocation storage
3080 allocation size determination.
3081 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
3082 `int_rels_per_ext_rel' for last relocation entry determination.
3083 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3084 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
3085 (_bfd_mips_elf_relocate_section): Likewise.
3087 2017-06-05 Alan Modra <amodra@gmail.com>
3090 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
3092 2017-06-01 John Baldwin <jhb@FreeBSD.org>
3094 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
3095 determine structure sizes.
3096 (elfcore_grok_freebsd_prstatus): Likewise.
3098 2017-06-01 Alan Modra <amodra@gmail.com>
3100 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
3101 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
3103 (is_elfv2_localentry0): New function.
3104 (ppc64_elf_tls_setup): Default params->plt_localentry0.
3105 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
3106 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
3107 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
3108 optimized localentry:0 stubs.
3109 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
3110 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
3112 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
3114 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3116 2017-05-30 Casey Smith <clegg89@gmail.com>
3119 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
3120 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
3122 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
3124 * cpu-arc.c (arc_compatible): New function.
3126 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
3128 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
3130 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
3133 * bfdio.c (bfd_get_file_size): New function.
3134 * bfd-in2.h: Regenerated.
3136 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
3138 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
3141 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
3143 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
3144 dynobj instead of htab->elf.dynobj.
3146 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
3148 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
3150 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
3151 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
3152 actual number of internal relocations retrieved. Adjust
3153 function description.
3154 (bfd_elf64_canonicalize_reloc): Remove macro.
3155 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
3157 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
3159 * archures.c (bfd_mach_sparc_v9m8): Define.
3160 (bfd_mach_sparc_v8plusm8): Likewise.
3161 (bfd_mach_sparc_v9_p): Adjust to M8.
3162 (bfd_mach_sparc_64bit_p): Likewise.
3163 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
3164 bfd_mach_sparc_v8plusm8.
3165 * bfd-in2.h: Regenerated.
3166 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
3168 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
3169 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
3170 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
3172 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3173 bfd_mach_sparc_v8plusm8.
3175 2017-05-19 Alan Modra <amodra@gmail.com>
3177 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
3178 debug and special sections when no non-note alloc sections in an
3181 2017-05-18 Alan Modra <amodra@gmail.com>
3183 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
3184 * elf-m10300.c: Likewise.
3186 * elf32-arc.c: Likewise.
3187 * elf32-bfin.c: Likewise.
3188 * elf32-m68k.c: Likewise.
3189 * elf32-nds32.c: Likewise.
3190 * elf32-tilepro.c: Likewise.
3191 * elflink.c: Likewise.
3192 * elfnn-aarch64.c: Likewise.
3193 * elfnn-riscv.c: Likewise.
3194 * elfxx-tilegx.c: Likewise.
3195 * mach-o.c: Likewise.
3196 * peXXigen.c: Likewise.
3197 * vms-alpha.c: Likewise.
3198 * vms-lib.c: Likewise.
3200 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3203 * elflink.c (elf_gc_mark_debug_section): New function.
3204 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3205 referenced by kept debug sections.
3207 2017-05-16 Alan Modra <amodra@gmail.com>
3209 * elf-m10300.c: Rename occurrences of non_ir_ref.
3210 * elf32-arm.c: Likewise.
3211 * elf32-bfin.c: Likewise.
3212 * elf32-cr16.c: Likewise.
3213 * elf32-cris.c: Likewise.
3214 * elf32-d10v.c: Likewise.
3215 * elf32-dlx.c: Likewise.
3216 * elf32-fr30.c: Likewise.
3217 * elf32-frv.c: Likewise.
3218 * elf32-hppa.c: Likewise.
3219 * elf32-i370.c: Likewise.
3220 * elf32-i386.c: Likewise.
3221 * elf32-iq2000.c: Likewise.
3222 * elf32-lm32.c: Likewise.
3223 * elf32-m32c.c: Likewise.
3224 * elf32-m32r.c: Likewise.
3225 * elf32-m68hc1x.c: Likewise.
3226 * elf32-m68k.c: Likewise.
3227 * elf32-mcore.c: Likewise.
3228 * elf32-metag.c: Likewise.
3229 * elf32-microblaze.c: Likewise.
3230 * elf32-moxie.c: Likewise.
3231 * elf32-msp430.c: Likewise.
3232 * elf32-mt.c: Likewise.
3233 * elf32-nios2.c: Likewise.
3234 * elf32-or1k.c: Likewise.
3235 * elf32-ppc.c: Likewise.
3236 * elf32-rl78.c: Likewise.
3237 * elf32-s390.c: Likewise.
3238 * elf32-score.c: Likewise.
3239 * elf32-score7.c: Likewise.
3240 * elf32-sh.c: Likewise.
3241 * elf32-tic6x.c: Likewise.
3242 * elf32-tilepro.c: Likewise.
3243 * elf32-v850.c: Likewise.
3244 * elf32-vax.c: Likewise.
3245 * elf32-xstormy16.c: Likewise.
3246 * elf32-xtensa.c: Likewise.
3247 * elf64-alpha.c: Likewise.
3248 * elf64-hppa.c: Likewise.
3249 * elf64-ia64-vms.c: Likewise.
3250 * elf64-mmix.c: Likewise.
3251 * elf64-ppc.c: Likewise.
3252 * elf64-s390.c: Likewise.
3253 * elf64-sh64.c: Likewise.
3254 * elf64-x86-64.c: Likewise.
3255 * elflink.c: Likewise.
3256 * elfnn-aarch64.c: Likewise.
3257 * elfnn-ia64.c: Likewise.
3258 * elfnn-riscv.c: Likewise.
3259 * elfxx-mips.c: Likewise.
3260 * elfxx-sparc.c: Likewise.
3261 * elfxx-tilegx.c: Likewise.
3262 * linker.c: Likewise.
3264 2017-05-16 Alan Modra <amodra@gmail.com>
3266 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3267 * elflink.c (elf_link_add_object_symbols): Update to use
3269 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3271 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3273 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3275 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3277 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3279 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3280 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3282 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3284 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3286 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3288 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3289 to plt_second/plt_second_eh_frame.
3290 (elf_x86_64_link_hash_newfunc): Updated.
3291 (elf_x86_64_allocate_dynrelocs): Likewise.
3292 (elf_x86_64_size_dynamic_sections): Likewise.
3293 (elf_x86_64_relocate_section): Likewise.
3294 (elf_x86_64_finish_dynamic_symbol): Likewise.
3295 (elf_x86_64_finish_dynamic_sections): Likewise.
3296 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3297 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3299 (elf_backend_setup_gnu_properties): Updated. Create the
3300 .plt.sec section instead of the .plt.sec section.
3302 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3304 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3305 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3306 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3308 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3310 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3311 (bfd_elf64_set_reloc): Define.
3312 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3314 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3316 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3317 (struct bfd_target): New field _bfd_set_reloc.
3318 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3319 * reloc.c (_bfd_generic_set_reloc): New function.
3320 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3321 * nlm-target.h (nlm_set_reloc): Likewise.
3322 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3323 * aout-tic30.c (MY_set_reloc): Likewise.
3324 * aout-target.h (MY_set_reloc): Likewise.
3325 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3326 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3327 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3328 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3329 * aout-adobe.c (aout_32_set_reloc): Likewise.
3330 * bout.c (b_out_set_reloc): Likewise.
3331 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3332 * i386os9k.c (aout_32_set_reloc): Likewise.
3333 * ieee.c (ieee_set_reloc): Likewise.
3334 * oasys.c (oasys_set_reloc): Likewise.
3335 * som.c (som_set_reloc): Likewise.
3336 * versados.c (versados_set_reloc): Likewise.
3337 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3338 _bfd_generic_set_reloc.
3339 (rs6000_xcoff64_aix_vec): LIkewise.
3340 * libbfd.c (_bfd_norelocs_set_reloc): New function.
3341 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3342 * i386msdos.c (msdos_set_reloc): Define to
3343 _bfd_norelocs_set_reloc.
3344 * elfcode.h (elf_set_reloc): Define.
3345 * bfd-in2.h: Regenerated.
3347 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
3350 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3351 for IFUNC function address.
3353 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
3355 * elf32-arc.c (FEATURE_LIST_NAME): Define.
3356 (CONFLICT_LIST): Likewise.
3357 (opcode/arc-attrs.h): Include.
3358 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3359 (arc_extract_features): New file.
3360 (arc_stralloc): Likewise.
3361 (arc_elf_merge_attributes): Likewise.
3362 (arc_elf_merge_private_bfd_data): Use object attributes.
3363 (bfd_arc_get_mach_from_attributes): New function.
3364 (arc_elf_object_p): Use object attributes.
3365 (arc_elf_final_write_processing): Likewise.
3366 (elf32_arc_obj_attrs_arg_type): New function.
3367 (elf32_arc_obj_attrs_handle_unknown): Likewise.
3368 (elf32_arc_section_from_shdr): Likewise.
3369 (elf_backend_obj_attrs_vendor): Define.
3370 (elf_backend_obj_attrs_section): Likewise.
3371 (elf_backend_obj_attrs_arg_type): Likewise.
3372 (elf_backend_obj_attrs_section_type): Likewise.
3373 (elf_backend_obj_attrs_handle_unknown): Likewise.
3374 (elf_backend_section_from_shdr): Likewise.
3376 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
3379 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3380 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3381 and the destination is a Thumb symbol.
3383 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3385 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3386 initializer to silence GCC 4.2.
3387 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3389 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3391 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3392 (LAZY_PLT_ENTRY_SIZE): This.
3393 (NON_LAZY_PLT_ENTRY_SIZE): New.
3394 (elf_x86_64_plt0_entry): Renamed to ...
3395 (elf_x86_64_lazy_plt0_entry): This.
3396 (elf_x86_64_plt_entry): Renamed to ...
3397 (elf_x86_64_lazy_plt_entry): This.
3398 (elf_x86_64_bnd_plt0_entry): Renamed to ...
3399 (elf_x86_64_lazy_bnd_plt0_entry): This.
3400 (elf_x86_64_legacy_plt_entry): Removed.
3401 (elf_x86_64_bnd_plt_entry): Renamed to ...
3402 (elf_x86_64_lazy_bnd_plt_entry): This.
3403 (elf_x86_64_legacy_plt2_entry): Renamed to ...
3404 (elf_x86_64_non_lazy_plt_entry): This.
3405 (elf_x86_64_bnd_plt2_entry): Renamed to ...
3406 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3407 (elf_x86_64_eh_frame_plt): Renamed to ...
3408 (elf_x86_64_eh_frame_lazy_plt): This.
3409 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3410 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3411 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3412 (elf_x86_64_eh_frame_non_lazy_plt): This.
3413 (elf_x86_64_lazy_plt_layout): New.
3414 (elf_x86_64_non_lazy_plt_layout): Likewise.
3415 (elf_x86_64_plt_layout): Likewise.
3416 (elf_x86_64_backend_data): Remove PLT layout information. Add
3417 os for target system.
3418 (GET_PLT_ENTRY_SIZE): Removed.
3419 (elf_x86_64_lazy_plt): New.
3420 (elf_x86_64_non_lazy_plt): Likewise.
3421 (elf_x86_64_lazy_bnd_plt): Likewise.
3422 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3423 (elf_x86-64_arch_bed): Updated.
3424 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3425 (elf_x86_64_create_dynamic_sections): Removed.
3426 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3427 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3428 (elf_x86-64_adjust_dynamic_symbol): Updated.
3429 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3430 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3431 size for PLT0 if there is no PLT0. Get plt_entry_size from
3432 non_lazy_plt for non-lazy PLT entries.
3433 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3434 from non_lazy_plt for non-lazy PLT entries.
3435 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3436 if there is no PLT0.
3437 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3438 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3439 entries with non-lazy PLT layout. Don't fill the second and third
3440 slots in the PLT entry if there is no PLT0.
3441 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3442 if there is no PLT0. Set sh_entsize on the .plt.got section.
3443 (compare_relocs): New.
3444 (elf_x86_64_plt_type): Likewise.
3445 (elf_x86_64_plt): Likewise.
3446 (elf_x86_64_nacl_plt): New. Forward declaration.
3447 (elf_x86_64_get_plt_sym_val): Removed.
3448 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3449 against all dynamic relocations.
3450 (elf_x86_64_link_setup_gnu_properties): New function.
3451 (elf_backend_create_dynamic_sections): Updated.
3452 (elf_backend_setup_gnu_properties): New.
3453 (elf_x86_64_nacl_plt): New.
3454 (elf_x86_64_nacl_arch_bed): Updated.
3456 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3458 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3459 (LAZY_PLT_ENTRY_SIZE): This.
3460 (NON_LAZY_PLT_ENTRY_SIZE): New.
3461 (elf_i386_plt0_entry): Renamed to ...
3462 (elf_i386_lazy_plt0_entry): This.
3463 (elf_i386_plt_entry): Renamed to ...
3464 (elf_i386_lazy_plt_entry): This.
3465 (elf_i386_pic_plt0_entry): Renamed to ...
3466 (elf_i386_pic_lazy_plt0_entry): This.
3467 (elf_i386_pic_plt_entry): Renamed to ...
3468 (elf_i386_pic_lazy_plt_entry): This.
3469 (elf_i386_got_plt_entry): Renamed to ...
3470 (elf_i386_non_lazy_plt_entry): This.
3471 (elf_i386_pic_got_plt_entry): Renamed to ...
3472 (elf_i386_pic_non_lazy_plt_entry): This.
3473 (elf_i386_eh_frame_plt): Renamed to ...
3474 (elf_i386_eh_frame_lazy_plt): This.
3475 (elf_i386_eh_frame_plt_got): Renamed to ...
3476 (elf_i386_eh_frame_non_lazy_plt): This.
3477 (elf_i386_plt_layout): Renamed to ...
3478 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3479 eh_frame_plt_got_size.
3480 (elf_i386_non_lazy_plt_layout): New.
3481 (elf_i386_plt_layout): Likewise.
3482 (elf_i386_non_lazy_plt): Likewise.
3483 (GET_PLT_ENTRY_SIZE): Removed.
3484 (elf_i386_plt): Renamed to ...
3485 (elf_i386_lazy_plt): This.
3486 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3487 (elf_i386_arch_bed): Updated.
3488 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3489 (elf_i386_create_dynamic_sections): Removed.
3490 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3491 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3492 (elf_i386_adjust_dynamic_symbol): Updated.
3493 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3494 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3495 size for PLT0 if there is no PLT0.
3496 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3497 output section is discarded only if GOT isn't empty.
3498 (elf_i386_relocate_section): Updated. Properly get PLT index
3499 if there is no PLT0.
3500 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3501 second and third slots in the PLT entry if there is no PLT0.
3502 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3503 if there is no PLT0. Set sh_entsize on the .plt.got section.
3504 (elf_i386_nacl_plt): Forward declaration.
3505 (elf_i386_get_plt_sym_val): Removed.
3506 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3507 against all dynamic relocations.
3508 (elf_i386_link_setup_gnu_properties): New function.
3509 (elf_backend_create_dynamic_sections): Updated.
3510 (elf_backend_setup_gnu_properties): New.
3511 (elf_i386_nacl_plt): Updated.
3512 (elf_i386_nacl_arch_bed): Likewise.
3513 (elf_i386_vxworks_arch_bed): Likewise.
3515 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3517 * elflink.c (elf_output_implib): Remove executable flag from import
3519 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3520 library is a relocatable object file.
3522 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3525 * elf32-avr.c (avr_should_move_sym): New function.
3526 (avr_should_reduce_sym_size): Likewise.
3527 (avr_should_increase_sym_size): Likewise.
3528 (elf32_avr_relax_delete_bytes): Adjust symbol values
3529 and sizes by calling new functions.
3531 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3533 * config.bfd (riscv32-*): Enable rv64.
3535 2017-05-02 Alan Modra <amodra@gmail.com>
3538 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3539 rather than h->root.type == bfd_link_hash_new.
3540 (bfd_elf_record_link_assignment): Similarly, call
3541 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3543 2017-04-29 Alan Modra <amodra@gmail.com>
3546 * reloc.c (reloc_offset_in_range): New function.
3547 (bfd_perform_relocation, bfd_install_relocation): Use it.
3548 (_bfd_final_link_relocate): Likewise.
3550 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3552 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3553 before using .plt.got.
3554 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3556 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3558 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3559 instead of "+=" to update 0.
3561 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3563 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3564 .plt.got section here.
3565 (elf_i386_check_relocs): Don't create the .plt.got section.
3566 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3567 the .plt.got and .plt.bnd sections here.
3568 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3571 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3573 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3575 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3576 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3577 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3578 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3581 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3583 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3585 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3586 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3587 the first relocatable ELF input with GNU properties.
3589 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3591 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3592 VxWorks for non-PIC.
3594 2017-04-27 Alan Modra <amodra@gmail.com>
3596 * elf-bfd.h (struct elf_backend_data): Make asection param of
3597 elf_backend_eh_frame_address_size const.
3598 (_bfd_elf_eh_frame_address_size): Likewise.
3599 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3600 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3601 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3602 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3603 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3604 (next_cie_fde_offset): Constify params.
3605 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3607 2017-04-27 Alan Modra <amodra@gmail.com>
3609 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3610 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3611 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3613 (offset_adjust): New function.
3614 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3615 (adjust_eh_frame_local_symbols): Likewise.
3616 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3617 after changing anything. Return true if anything changed.
3618 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3619 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3621 2017-04-27 Alan Modra <amodra@gmail.com>
3623 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3626 2017-04-27 Alan Modra <amodra@gmail.com>
3628 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3629 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3630 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3631 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3632 for undef and undefweak dyn_relocs.
3633 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3634 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3635 (allocate_got, allocate_dynrelocs): Likewise.
3636 (ppc64_elf_relocate_section): Likewise.
3638 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3640 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3641 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3642 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3643 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3645 2017-04-26 Nick Clifton <nickc@redhat.com>
3648 * reloc.c (bfd_perform_relocation): Check for a negative address
3651 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3654 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3656 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3657 (elf_backend_always_renumber_dynsyms): Define.
3658 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3659 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3660 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3661 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3663 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3665 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3667 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3668 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3669 sections have been created.
3671 2017-04-26 Nick Clifton <nickc@redhat.com>
3674 * compress.c (bfd_init_section_compress_status): Check the return
3675 value from bfd_malloc.
3677 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3679 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3680 no_finish_dynamic_symbol.
3681 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3683 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3684 weak symbol, don't make it dynamic.
3685 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3686 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3687 relocation for GOT reference.
3688 (elf_x86_64_finish_dynamic_symbol): Abort if
3689 no_finish_dynamic_symbol isn't 0.
3691 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3694 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3695 undefined weak symbol, don't make it dynamic.
3696 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3697 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3698 relocation for R_386_GOT32.
3700 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3703 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3705 2017-04-23 Alan Modra <amodra@gmail.com>
3708 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3709 * elf.c (lcomm_sym): New.
3710 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3711 * bfd-in2.h: Regenerate.
3713 2017-04-23 Alan Modra <amodra@gmail.com>
3716 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3717 parameters and comment.
3718 (_bfd_elf_get_reloc_section): Delete.
3719 (_bfd_elf_plt_get_reloc_section): Declare.
3720 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3721 New functions. Don't blindly skip over assumed .rel/.rela prefix.
3723 (_bfd_elf_get_reloc_section): ..here. Delete.
3724 (assign_section_numbers): Call elf_get_reloc_section.
3725 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
3726 * elfxx-target.h (elf_backend_get_reloc_section): Update.
3728 2017-04-23 Alan Modra <amodra@gmail.com>
3731 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
3734 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3737 * elf32-i386.c (elf_i386_link_hash_entry): Add
3738 no_finish_dynamic_symbol.
3739 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
3740 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
3741 symbol, don't make it dynamic in PIE.
3742 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
3743 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3744 relocation for R_386_GOT32
3745 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
3748 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3752 * elflink.c (elf_link_add_object_symbols): Require
3753 --no-dynamic-linker with -E/--dynamic-list when creating
3756 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3758 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
3761 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3763 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
3764 dynamic symbol sorting.
3766 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
3769 * elflink.c (elf_link_add_object_symbols): Preserve
3770 dynamic_ref_after_ir_def when restoring the symbol table for
3771 unneeded dynamic object.
3773 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
3776 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
3777 on on undefined IFUNC symbol in the second PLT.
3779 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
3781 * peXXigen.c (pe_print_reloc): Correct chunk_end.
3783 2017-04-19 Alan Modra <amodra@gmail.com>
3785 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
3786 or make dynamic for info->dynamic_undefined_weak 0 and 1.
3787 * elf32-ppc.c:Formatting.
3788 (ensure_undefweak_dynamic): Don't make dynamic when
3789 info->dynamic_undefined_weak is zero.
3790 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3791 info->dynamic_undefined_weak. Discard undef dyn_relocs when
3792 not default visibility. Discard undef and undefweak
3794 (ppc_elf_relocate_section): Adjust to suit.
3795 * elf64-ppc.c: Formatting.
3796 (ensure_undefweak_dynamic): Don't make dynamic when
3797 info->dynamic_undefined_weak is zero.
3798 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3799 info->dynamic_undefined_weak. Discard them earlier.
3801 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
3804 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
3805 before generating the version definition section.
3807 2017-04-17 Alan Modra <amodra@gmail.com>
3809 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
3810 state when a regular object file defines a symbol with
3811 incompatible type to that defined by an earlier shared lib.
3813 2017-04-13 Alan Modra <amodra@gmail.com>
3815 * coffcode.h: Wrap some overly long _bfd_error_handler args.
3817 * elf32-arm.c: Likewise.
3818 * elf32-i386.c: Likewise.
3819 * elf32-mep.c: Likewise.
3820 * elf64-ia64-vms.c: Likewise.
3821 * elf64-x86-64.c: Likewise.
3822 * elflink.c: Likewise.
3823 * elfnn-ia64.c: Likewise.
3824 * elfxx-mips.c: Likewise.
3826 2017-04-13 Alan Modra <amodra@gmail.com>
3828 * aoutx.h: Use %B and %A in error messages throughout file.
3829 * aout-cris.c: Likewise.
3830 * archive.c: Likewise.
3831 * binary.c: Likewise.
3832 * coff-rs6000.c: Likewise.
3833 * coff-tic4x.c: Likewise.
3834 * coffcode.h: Likewise.
3835 * coffgen.c: Likewise.
3836 * cofflink.c: Likewise.
3837 * coffswap.h: Likewise.
3838 * cpu-arm.c: Likewise.
3839 * elf-eh-frame.c: Likewise.
3840 * elf-m10300.c: Likewise.
3842 * elf32-arc.c: Likewise.
3843 * elf32-arm.c: Likewise.
3844 * elf32-bfin.c: Likewise.
3845 * elf32-frv.c: Likewise.
3846 * elf32-iq2000.c: Likewise.
3847 * elf32-m32c.c: Likewise.
3848 * elf32-microblaze.c: Likewise.
3849 * elf32-nds32.c: Likewise.
3850 * elf32-rl78.c: Likewise.
3851 * elf32-rx.c: Likewise.
3852 * elf32-score.c: Likewise.
3853 * elf32-score7.c: Likewise.
3854 * elf32-sh64.c: Likewise.
3855 * elf32-v850.c: Likewise.
3856 * elf32-vax.c: Likewise.
3857 * elf32-visium.c: Likewise.
3858 * elf64-ia64-vms.c: Likewise.
3859 * elf64-mmix.c: Likewise.
3860 * elf64-sh64.c: Likewise.
3861 * elfcode.h: Likewise.
3862 * elfnn-aarch64.c: Likewise.
3863 * elfnn-ia64.c: Likewise.
3864 * elfxx-mips.c: Likewise.
3865 * hpux-core.c: Likewise.
3868 * linker.c: Likewise.
3869 * merge.c: Likewise.
3871 * oasys.c: Likewise.
3872 * pdp11.c: Likewise.
3873 * peXXigen.c: Likewise.
3874 * rs6000-core.c: Likewise.
3875 * vms-alpha.c: Likewise.
3876 * xcofflink.c: Likewise.
3878 2017-04-13 Alan Modra <amodra@gmail.com>
3880 * bfd.c (PRINT_TYPE): Define.
3881 (_doprnt): New function.
3882 (error_handler_internal): Use _doprnt.
3883 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
3884 calls in their natural order, throughout file.
3885 * coff-mcore.c: Likewise.
3886 * coff-ppc.c: Likewise.
3887 * coff-tic80.c: Likewise.
3888 * cofflink.c: Likewise.
3889 * elf-s390-common.c: Likewise.
3891 * elf32-arm.c: Likewise.
3892 * elf32-i386.c: Likewise.
3893 * elf32-m32r.c: Likewise.
3894 * elf32-msp430.c: Likewise.
3895 * elf32-spu.c: Likewise.
3896 * elf64-ia64-vms.c: Likewise.
3897 * elf64-sparc.c: Likewise.
3898 * elf64-x86-64.c: Likewise.
3899 * elflink.c: Likewise.
3900 * elfnn-aarch64.c: Likewise.
3901 * elfnn-ia64.c: Likewise.
3902 * elfxx-mips.c: Likewise.
3904 2017-04-13 Alan Modra <amodra@gmail.com>
3906 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
3907 branch veneers" error. Fix double space and format message.
3908 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
3909 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
3911 2017-04-13 Alan Modra <amodra@gmail.com>
3913 * bfd-in2.h: Regenerate.
3915 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3917 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
3918 extra `\n' in warning/error messages.
3919 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
3920 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3922 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3924 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
3925 processor-specific properties with generic ELF target vector.
3927 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
3929 * elf32-sparc.c (elf_backend_fixup_symbol): New.
3930 * elf64-sparc.c (elf_backend_fixup_symbol): New.
3931 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
3932 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
3934 (link_hash_newfunc): Initialize has_got_reloc and
3936 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
3938 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
3940 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
3942 (_bfd_sparc_elf_fixup_symbol): New function.
3943 (allocate_dynrelocs): Don't allocate space for dynamic
3944 relocations and discard relocations against resolved undefined
3945 weak symbols in executable. Don't make resolved undefined weak
3946 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
3947 relocation against undefined weak symbols in PIE.
3948 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
3949 relocations against resolved undefined weak symbols in PIE
3950 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
3951 without ynamic PLT/GOT relocations for resolved undefined weak
3953 Don't generate dynamic relocation against resolved undefined
3954 weak symbol in executable.
3955 (pie_finish_undefweak_symbol): New function.
3956 (_bfd_sparc_elf_finish_dynamic_sections): Call
3957 pie_finish_undefweak_symbol on all symbols in PIE.
3958 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
3959 (_bfd_sparc_elf_fixup_symbol): New function.
3961 2017-04-10 Nick Clifton <nickc@redhat.com>
3963 * config.bfd: Remove ns32k from obsolete list.
3965 2017-04-10 Alan Modra <amodra@gmail.com>
3968 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
3969 (special_sections_i): Likewise for .init_array.
3970 (special_sections_p): Likewise for .preinit_array.
3972 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
3976 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
3977 ELF_COMMON_DEF_P for common symbols.
3978 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3979 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
3980 * elflink.c (_bfd_elf_merge_symbol): Revert commits
3981 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
3982 07492f668d2173da7a2bda3707ff0985e0f460b6.
3984 2017-04-07 Pedro Alves <palves@redhat.com>
3986 * opncls.c (bfd_get_debug_link_info): Rename to...
3987 (bfd_get_debug_link_info_1): ... this. Change type of second
3988 parameter to void pointer. Adjust.
3989 (bfd_get_debug_link_info): Reimplement on top of
3990 bfd_get_debug_link_info_1.
3991 (separate_debug_file_exists, separate_alt_debug_file_exists):
3992 Change type of second parameter to void pointer. Adjust.
3993 (get_func_type, check_func_type): Change type of second parameter
3995 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
3996 the callback functions instead of passing the address of a local.
3997 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
3998 find_separate_debug_file.
3999 (get_alt_debug_link_info_shim): Change type of second parameter to
4000 void pointer. Adjust.
4001 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
4002 find_separate_debug_file.
4003 (get_build_id_name, bfd_boolean check_build_id_file): Change type
4004 of second parameter to void pointer. Adjust.
4005 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
4006 pointer local to find_separate_debug_file.
4008 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
4010 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
4011 external symbols with a definition.
4012 (_bfd_coff_gc_mark_extra_sections): Fix typo.
4014 2017-04-07 Alan Modra <amodra@gmail.com>
4016 * po/SRC-POTFILES.in: Regenerate.
4018 2017-04-05 Alan Modra <amodra@gmail.com>
4020 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
4023 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
4025 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
4026 numbers for DataDirectory entry indicies passed to
4029 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
4031 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
4032 each GNU_MBIND section and align GNU_MBIND section to page size.
4033 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
4034 segment for each GNU_MBIND section.
4035 (_bfd_elf_init_private_section_data): Copy sh_info from input
4036 for GNU_MBIND section.
4038 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
4040 * elfnn-riscv.c (GP_NAME): Delete.
4041 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
4042 (_bfd_riscv_relax_lui): Likewise.
4044 2017-04-04 Nick Clifton <nickc@redhat.com>
4047 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
4049 (bfd_elf_final_link): Only initialize the extended symbol index
4050 section if there are extended symbol tables to list.
4052 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
4054 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
4055 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
4056 * configure.ac (elf): Add elf-properties.lo.
4057 * Makefile.in: Regenerated.
4058 * configure: Likewise.
4059 * elf-bfd.h (elf_property_kind): New.
4060 (elf_property): Likewise.
4061 (elf_property_list): Likewise.
4062 (elf_properties): Likewise.
4063 (_bfd_elf_parse_gnu_properties): Likewise.
4064 (_bfd_elf_get_property): Likewise.
4065 (_bfd_elf_link_setup_gnu_properties): Likewise.
4066 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
4067 and setup_gnu_properties.
4068 (elf_obj_tdata): Add properties.
4069 * elf-properties.c: New file.
4070 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
4071 (elf_i386_merge_gnu_properties): Likewise.
4072 (elf_backend_parse_gnu_properties): Likewise.
4073 (elf_backend_merge_gnu_properties): Likewise.
4074 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4075 (elf_x86_64_merge_gnu_properties): Likewise.
4076 (elf_backend_parse_gnu_properties): Likewise.
4077 (elf_backend_merge_gnu_properties): Likewise.
4078 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
4079 (elf_backend_parse_gnu_properties): Likewise.
4080 (elf_backend_setup_gnu_properties): Likewise.
4081 (elfNN_bed): Add elf_backend_parse_gnu_properties,
4082 elf_backend_merge_gnu_properties and
4083 elf_backend_setup_gnu_properties.
4085 2017-03-30 Pip Cet <pipcet@gmail.com>
4087 * elf32-wasm32.c: Add relocation code, two relocs.
4088 * reloc.c: Add wasm32 relocations.
4089 * libbfd.h: Regenerate.
4090 * bfd-in2.h: Regenerate.
4091 * bfd/po/bfd.pot: Regenerate.
4093 2017-03-29 Nick Clifton <nickc@redhat.com>
4096 * coff-bfd.h (struct coff_section_data): Add new fields:
4097 saved_bias and bias.
4098 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
4099 computed for PE binaries.
4100 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
4103 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
4106 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
4107 to handle a local symbol with a hash-symbol-entry; without PLT.
4108 Add BFD_ASSERT for an incidental case with GOT entry present.
4109 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
4110 isn't forced-or-set local.
4112 2017-03-27 Pip Cet <pipcet@gmail.com>
4114 * wasm-module.c: New file to support WebAssembly modules.
4115 * wasm-module.h: New file to support WebAssembly modules.
4116 * doc/webassembly.texi: Start documenting wasm-module.c.
4117 * config.bfd: Add wasm_vec.
4118 * targets.c: Likewise.
4119 * configure.ac: Likewise.
4120 * Makefile.am: Add entries for wasm-module.c.
4121 * Makefile.in: Regenerate.
4122 * configure: Regenerate.
4123 * po/SRC-POTFILES.in: Regenerate.
4125 2017-03-27 Pip Cet <pipcet@gmail.com>
4127 * cpu-wasm32.c: New file to support wasm32 architecture.
4128 * elf32-wasm32.c: New file to support wasm32 architecture.
4129 * Makefile.am: Add wasm32 architecture.
4130 * archures.c: Likewise.
4131 * config.bfd: Likewise.
4132 * configure.ac: Likewise.
4133 * targets.c: Likewise.
4134 * Makefile.in: Regenerate.
4135 * bfd-in2.h: Regenerate.
4136 * configure: Regenerate.
4137 * po/SRC-POTFILES.in: Regenerate.
4139 2017-03-20 Alan Modra <amodra@gmail.com>
4142 * elf64-ppc.c (compare_symbols): Stabilize sort.
4144 2017-03-18 Alan Modra <amodra@gmail.com>
4146 * elf64-ppc.c (struct ppc_link_hash_table): Add
4147 local_ifunc_resolver and maybe_local_ifunc_resolver.
4148 (ppc_build_one_stub): Set flags on emitting dynamic
4149 relocation to ifunc.
4150 (ppc64_elf_relocate_section): Likewise.
4151 (ppc64_elf_finish_dynamic_symbol): Likewise.
4152 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
4153 local dynamic relocs to ifuncs.
4154 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
4155 local_ifunc_resolver and maybe_local_ifunc_resolver.
4156 (ppc_elf_relocate_section): Set flag on emitting dynamic
4157 relocation to ifuncs.
4158 (ppc_elf_finish_dynamic_symbol): Likewise.
4159 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
4160 dynamic relocs to ifuncs.
4162 2017-03-13 Nick Clifton <nickc@redhat.com>
4165 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
4166 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
4167 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
4168 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
4169 * bfd-in2.h: Regenerate.
4170 * libbfd.h: Regenerate.
4171 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
4173 (IS_AARCH64_TLSDESC_RELOC): Likewise.
4174 (elfNN_aarch64_howto_table): Likewise.
4175 (aarch64_tls_transition_without_check): Likewise.
4176 (aarch64_reloc_got_type): Likewise.
4177 (elfNN_aarch64_final_link_relocate): Likewise.
4178 (elfNN_aarch64_tls_relax): Likewise.
4179 (elfNN_aarch64_relocate_section): Likewise.
4180 (elfNN_aarch64_gc_sweep_hook): Likewise.
4181 (elfNN_aarch64_check_relocs): Likewise.
4182 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4183 (_bfd_aarch64_elf_resolve_relocation): Likewise.
4185 2017-03-11 Alan Modra <amodra@gmail.com>
4187 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
4188 parameter is in fact used. Whitespace fixes.
4189 * elf64-ppc.c: Likewise.
4191 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4193 * rs6000-core.c (CORE_NEW): Simplify macro when
4194 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4196 2017-03-07 Alan Modra <amodra@gmail.com>
4200 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4203 2017-03-05 Alan Modra <amodra@gmail.com>
4205 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4206 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4207 (next_cie_fde_offset): New function.
4208 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4209 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4210 four bytes. Align CIEs to four or eight bytes depending on
4211 per_encoding_aligned8. Align FDEs according to their encoding.
4212 Pad last FDE to output section alignment.
4213 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4215 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4216 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4217 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4219 2017-03-02 Martin Bickel <binutils@ineranves.de>
4222 * elf.c (rewrite_elf_program_header): Do not issue a warning for
4223 empty segments which have a zero filesz, but a non-zero memsz.
4225 2017-03-02 Alan Modra <amodra@gmail.com>
4227 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4229 2017-02-28 Alan Modra <amodra@gmail.com>
4231 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4232 (ppc64_elf_relocate_section): Likewise.
4234 2017-02-28 Alan Modra <amodra@gmail.com>
4237 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4238 rather than elf32_nios2_hash_table or elf_hash_table.
4239 (create_got_section): Likewise.
4240 (nios2_elf32_finish_dynamic_symbol): Likewise.
4241 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4242 (nios2_elf32_size_dynamic_sections): Likewise.
4243 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4244 vars. Use htab equivalents directly instead. Don't create
4245 all dynamic sections on needing just the GOT. Use a goto
4246 rather than a fall-through with reloc test. Ensure
4247 htab->dynobj is set when making dynamic sreloc section.
4248 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4249 equivalent directly instead. Don't segfault on looking for
4250 .dynamic when dynamic sections have not been created. Don't
4251 segfault on .got.plt being discarded.
4252 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4253 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4254 fixme and another not so relevant comment.
4255 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4256 already set, set hash table dynobj on creating .sbss.
4258 2017-02-28 Alan Modra <amodra@gmail.com>
4260 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4261 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4262 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4263 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4264 (ppc64_elf_relocate_section): Likewise.
4265 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4266 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4267 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4268 * libbfd.h: Regenerate.
4269 * bfd-in2.h: Regenerate.
4271 2017-02-28 Alan Modra <amodra@gmail.com>
4273 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4274 dynamic .data.rel.ro read-only.
4275 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4276 rather than section flags when deciding where copy reloc goes.
4277 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4278 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4279 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4280 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4281 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4282 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4283 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4284 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4285 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4286 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4287 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4288 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4289 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4290 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4291 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4292 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4293 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4294 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4295 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4297 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4299 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4300 `jalr $0, $25' instruction encoding.
4302 2017-02-27 Nick Clifton <nickc@redhat.com>
4305 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4306 generating a seg-fault when encountering a symbol that has been
4307 deleted by garbage collection.
4309 2017-02-25 Alan Modra <amodra@gmail.com>
4311 * elf32-arc.c (struct dynamic_sections): Delete.
4312 (enum dyn_section_types): Delete.
4313 (dyn_section_names): Delete.
4314 (arc_create_dynamic_sections): Delete.
4315 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
4316 segfault on discarded .rela.plt section.
4317 (elf_arc_size_dynamic_sections): Formatting. Don't call
4318 arc_create_dynamic_sections. Don't allocate memory for sections
4319 handled by the generic linker. Correct code finding relocs in
4320 read-only sections. Set SEC_EXCLUDE on zero size .got,
4321 .got.plt, and .dynbss sections. Do set .interp for pies.
4323 2017-02-24 Andrew Waterman <andrew@sifive.com>
4325 * elfnn-riscv.c (GP_NAME): New macro.
4326 (riscv_global_pointer_value): Use it.
4327 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4328 output section, consider only that section's alignment.
4330 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4332 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4333 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4334 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4335 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4337 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4339 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4340 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4343 2017-02-23 Alan Modra <amodra@gmail.com>
4346 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4348 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4349 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4352 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
4355 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4356 processing ahead of the call to `elf_gc_sweep_symbol'.
4358 2017-02-22 Nick Clifton <nickc@redhat.com>
4361 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4362 created section 4-byte alignment.
4364 2017-02-22 Alan Modra <amodra@gmail.com>
4366 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4367 on .got or .plt output section being discarded by script.
4368 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
4371 2017-02-21 Alan Modra <amodra@gmail.com>
4373 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4374 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4376 2017-02-20 Alan Modra <amodra@gmail.com>
4379 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4380 if DT_RELSZ/DT_RELASZ is zero.
4382 2017-02-17 Nick Clifton <nickc@redhat.com>
4384 * compress.c (bfd_get_full_section_contents): Remember to reduce
4385 compressed size by the sizeof the compression header when
4386 decompressing the contents.
4388 2017-02-17 Pedro Alves <palves@redhat.com>
4390 * srec.c (Chunk): Rename to ...
4391 (_bfd_srec_len): ... this.
4392 (S3Forced): Rename to ...
4393 (_bfd_srec_forceS3): ... this.
4394 * objcopy.c: Adjust all references.
4396 2017-02-17 Pedro Alves <palves@redhat.com>
4398 * archive.c (bsd_write_armap): Rename to ...
4399 (_bfd_bsd_write_armap): ... this.
4400 (coff_write_armap): Rename to ...
4401 (_bfd_coff_write_armap): ... this.
4402 * libbfd-in.h (bsd_write_armap): Rename to ...
4403 (_bfd_bsd_write_armap): ... this.
4404 (coff_write_armap): Rename to ...
4405 (_bfd_coff_write_armap): ... this.
4406 * aout-target.h, aout-tic30.c: Adjust all users.
4407 * libbfd.h: Regenerate.
4409 2017-02-17 Pedro Alves <palves@redhat.com>
4411 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4412 (warn_deprecated): Rename to ...
4413 (_bfd_warn_deprecated): ... this.
4414 * libbfd.c (warn_deprecated): Rename to ...
4415 (_bfd_warn_deprecated): ... this.
4416 * bfd-in2.h: Regenerate.
4418 2017-02-17 Pedro Alves <palves@redhat.com>
4420 * bfdio.c (real_ftell): Rename to ...
4421 (_bfd_real_ftell): ... this.
4422 (real_fseek): Rename to ...
4423 (_bfd_real_fseek): ... this.
4424 (real_fopen): Rename to ...
4425 (_bfd_real_fopen): ... this.
4426 * libbfd-in.h (real_ftell): Rename to ...
4427 (_bfd_real_ftell): ... this.
4428 (real_fseek): Rename to ...
4429 (_bfd_real_fseek): ... this.
4430 (real_fopen): Rename to ...
4431 (_bfd_real_fopen): ... this.
4432 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4433 * libbfd.h: Regenerate.
4435 2017-02-17 Pedro Alves <palves@redhat.com>
4437 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4438 * libbfd.c (read_unsigned_leb128): Rename to ...
4439 (_bfd_read_unsigned_leb128): ... this.
4440 (read_signed_leb128): Rename to ...
4441 (_bfd_read_signed_leb128): ... this.
4442 (safe_read_leb128): Rename to ...
4443 (_bfd_safe_read_leb128): ... this.
4444 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4445 (_bfd_read_unsigned_leb128): ... this.
4446 (read_signed_leb128): Rename to ...
4447 (_bfd_read_signed_leb128): ... this.
4448 (safe_read_leb128): Rename to ...
4449 (_bfd_safe_read_leb128): ... this.
4450 * libbfd.h: Renegerate.
4452 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4454 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4455 before trying to fine matching file and line information.
4457 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4459 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4460 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4461 not match current bfd, then reload debug information. Record bfd
4462 we're loading debug info for in the stash. If we have debug
4463 informatin in the cache then perform section placement before
4466 2017-02-16 Alan Modra <amodra@gmail.com>
4469 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4470 * elfxx-target.h (elf_backend_no_page_alias): Define.
4471 (elfNN_bed): Init new field.
4472 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4473 ensure PT_LOAD segment starts on a new page.
4474 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4476 2017-02-16 Alan Modra <amodra@gmail.com>
4479 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4482 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4484 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4485 * bfd-in2.h: Regenerated.
4487 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4490 * elf32-i386.c (elf_i386_relocate_section): Allow
4491 "lea foo@GOT, %reg" in PIC.
4493 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4496 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4497 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4498 error against local IFUNC symbol without a base register for
4501 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4503 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4504 `%P: %H:' with `info->callbacks->einfo'.
4505 (ppc_elf_relocate_section): Likewise.
4506 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4507 (ppc64_elf_edit_toc): Likewise.
4508 (ppc64_elf_relocate_section): Likewise.
4510 2017-02-14 Alan Modra <amodra@gmail.com>
4512 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4513 --gc-keep-exported, and test versioned field of sym rather than
4514 looking for @ in name.
4516 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4518 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4521 2017-02-13 Nick Clifton <nickc@redhat.com>
4524 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4527 2017-02-07 Andrew Waterman <andrew@sifive.com>
4529 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4530 entry size if PLT header is written.
4532 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4534 Fix sparc64 dynamic relocation processing to use the dynamic
4536 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4537 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4540 2017-02-03 Nick Clifton <nickc@redhat.com>
4543 * coffcode.h (coff_write_object_contents): Enlarge size of
4544 s_name_buf in order to avoid compile time warning about possible
4546 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4547 32-bits of insn value before printing into buffer.
4549 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4551 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4552 `max_local_dynindx'.
4553 (mips_elf_sort_hash_table): Handle it.
4554 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4555 symbols bump up `max_local_dynindx' rather than
4556 `max_non_got_dynindx'.
4558 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4560 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4561 `min_got_dynindx', `max_unref_got_dynindx' and
4562 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4563 (mips_elf_sort_hash_table): Adjust accordingly.
4565 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4567 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4568 to access the hash table.
4570 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4572 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4573 non-NULL `htab' to the beginning.
4575 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4577 * elflink.c (elf_gc_sweep): Wrap overlong line.
4579 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4581 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4582 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4583 * elfxx-mips.c (mips_elf_link_hash_table): Add
4584 `ignore_branch_isa' member.
4585 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4586 in branch relocation calculation as an error if
4587 `ignore_branch_isa' has been set.
4588 (_bfd_mips_elf_insn32): Rename to...
4589 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4590 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4591 Handle the new parameter.
4593 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4595 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4596 local variable dynobj.
4599 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4600 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4601 executable from read-only sections into sdynrelro.
4602 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4603 dynamic relocs in sdynrelro.
4604 (elf_backend_want_dynrelro): Define.
4606 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4608 * config.bfd (*-*-rtemsaout*): Mark as removed.
4610 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4612 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4613 (arm-*-rtems*): Move to (arm*-*-eabi*).
4614 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4615 (m68-*-rtems*): Move to (m68*-*-elf*).
4617 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4619 * config.bfd (*-*-rtemscoff*): Mark as removed.
4621 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4624 * elflink.c (bfd_elf_record_link_assignment): Revert last
4625 change and don't ever clear `forced_local'. Set `mark'
4627 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4629 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4630 (bfd_elf_size_dynamic_sections): ... here.
4631 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4632 and set `mark' instead in `__tls_get_addr_opt' processing.
4633 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4635 2017-01-24 Alan Modra <amodra@gmail.com>
4637 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4638 where dynamic relocs are preferable. Allow ifunc too.
4639 (ensure_undefweak_dynamic): New function.
4640 (allocate_dynrelocs): Use it here. Move plt handling last and
4641 don't make symbols dynamic, simplifying loop. Only make undef
4642 weak symbols with GOT entries dynamic. Correct condition
4643 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4644 comments. Remove goto.
4645 (ppc_elf_relocate_section): Correct test for using dynamic
4646 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4647 to suit. Set up explicit tls_index entries and implicit GOT
4648 tls_index entries resolvable at link time for
4649 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4650 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4651 (ensure_undefweak_dynamic): New function.
4652 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4653 with GOT entries dynamic. Remove unnecessary test of
4654 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4655 (ppc64_elf_relocate_section): Correct test for using dynamic
4656 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4657 to suit. Set up explicit tls_index entries and implicit GOT
4658 tls_index entries resolvable at link time for __tls_get_addr_opt.
4659 Simplify expression to clear mem for prelink.
4661 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4663 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4665 2017-01-20 Jiong Wang <jiong.wang@arm.com>
4667 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4668 (elf_backend_hash_symbol): Define.
4670 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4673 * elflink.c (bfd_elf_record_link_assignment): Clear any
4674 `forced_local' marking for DSO symbols that are not being
4677 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4679 * elfnn-riscv.c (riscv_elf_object_p): New function.
4681 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4684 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4686 (elf_x86_64_check_relocs): Create .eh_frame section for the
4688 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4689 .eh_frame section for the .plt.bnd section.
4690 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4691 for the .plt.bnd section.
4693 2017-01-12 Nick Clifton <nickc@redhat.com>
4696 * opncls.c (find_separate_debug_file): Add include_dirs
4697 parameter. Only include the directory part of the bfd's filename
4698 in search paths if include_dirs is true. Add a couple of extra
4699 locations for looking for debug files.
4700 ( bfd_follow_gnu_debuglink): Update invocation of
4701 find_separate_debug_file.
4702 (bfd_follow_gnu_debugaltlink): Likewise.
4703 (get_build_id): New function: Finds the build-id of the given bfd.
4704 (get_build_id_name): New function: Computes the name of the
4705 separate debug info file for a bfd, based upon its build-id.
4706 (check_build_id_file): New function: Checks to see if a separate
4707 debug info file exists at the given location, and that its
4708 build-id matches that of the original bfd.
4709 (bfd_follow_build_id_debuglink): New function: Finds a separate
4710 debug info file for a given bfd by using the build-id method.
4711 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4712 method of locating a separate debug info file before using the
4714 * bfd-in2.h: Regenerate.
4716 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
4719 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4720 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4721 elf_x86_64_eh_frame_plt_got.
4722 (elf_x86_64_size_dynamic_sections): Get unwind info from
4723 elf_x86_64_bnd_arch_bed for the BND PLT.
4725 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
4727 * config.bfd: Add entries for i686-redox and x86_64-redox.
4729 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4731 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
4733 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
4734 .eh_frame section to 4 bytes for x32.
4735 (elf_x86_64_check_relocs): Likewise.
4737 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4740 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
4741 (PLT_GOT_FDE_LENGTH): Likewise.
4742 (elf_i386_plt_layout): Add eh_frame_plt_got and
4743 eh_frame_plt_got_size.
4744 (elf_i386_plt): Updated.
4745 (elf_i386_link_hash_table): Add plt_got_eh_frame.
4746 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
4747 (elf_i386_size_dynamic_sections): Allocate and initialize
4748 .eh_frame section for .plt.got.
4749 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
4751 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
4752 eh_frame_plt_got_size.
4753 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
4754 (PLT_GOT_FDE_LENGTH): Likewise.
4755 (elf_x86_64_backend_data): Add eh_frame_plt_got and
4756 eh_frame_plt_got_size.
4757 (elf_x86_64_arch_bed): Updated.
4758 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
4759 eh_frame_plt_got_size.
4760 (elf_x86_64_nacl_arch_bed): Likewise.
4761 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
4762 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
4763 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4764 .eh_frame section for .plt.got.
4765 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4768 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4770 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
4771 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
4773 2017-01-09 Nick Clifton <nickc@redhat.com>
4775 * dwarf2.c (lookup_address_in_function_table): Return early if
4776 there are no functions in the given comp unit, or if the high
4777 address of the last function in the comp unit is less than the
4780 2017-01-09 Nick Clifton <nickc@redhat.com>
4783 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
4784 message if there are too many symbols to load.
4786 2017-01-04 James Clarke <jrtc27@jrtc27.com>
4788 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
4789 if relocs are cached.
4791 2017-01-03 Rich Felker <bugdal@aerifal.cx>
4794 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
4795 for R_MICROBLAZE_GOTOFF_64.
4797 2017-01-03 Nick Clifton <nickc@redhat.com>
4799 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
4800 warning about using a possibly uninitialised variable.
4802 2017-01-02 Alan Modra <amodra@gmail.com>
4804 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
4805 (allocate_plt_static, allocate_dynrelocs): Use it.
4807 2017-01-02 Alan Modra <amodra@gmail.com>
4809 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
4810 .PARISC.unwind section.
4812 2017-01-02 Alan Modra <amodra@gmail.com>
4815 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
4816 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
4817 indirect to GOT pointer relative code edit.
4819 2017-01-02 Alan Modra <amodra@gmail.com>
4821 Update year range in copyright notice of all files.
4823 For older changes see ChangeLog-2016
4825 Copyright (C) 2017 Free Software Foundation, Inc.
4827 Copying and distribution of this file, with or without modification,
4828 are permitted in any medium without royalty provided the copyright
4829 notice and this notice are preserved.
4835 version-control: never