1 2017-10-25 Alan Modra <amodra@gmail.com>
3 * archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
4 optionally prefixed with "_".
5 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
7 2017-10-24 Andrew Waterman <andrew@sifive.com>
9 * elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
12 2017-10-24 Renlin Li <renlin.li@arm.com>
15 * elflink.c (_bfd_elf_merge_symbol): Handle multiple definition case.
17 2017-10-23 Nick Clifton <nickc@redhat.com>
20 * elflink.c (elf_link_output_extsym): Keep global undefined
21 symbols if they have been marked as needed.
23 2017-10-23 Maciej W. Rozycki <macro@imgtec.com>
25 * elfn32-mips.c (mips_elf_n32_mkobject): New prototype and
27 (bfd_elf32_mkobject): Use `mips_elf_n32_mkobject' rather than
28 `_bfd_mips_elf_mkobject'.
30 2017-10-22 Hans-Peter Nilsson <hp@axis.com>
33 * config.bfd (cris-*-* | crisv32-*-*): Require a 64-bit BFD.
35 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
37 * elfnn-riscv.c (riscv_pcgp_hi_reloc): New structure.
38 (riscv_pcgp_lo_reloc): Likewise.
39 (riscv_pcgp_relocs): Likewise.
40 (riscv_init_pcgp_relocs): New function.
41 (riscv_free_pcgp_relocs): Likewise.
42 (riscv_record_pcgp_hi_reloc): Likewise.
43 (riscv_record_pcgp_lo_reloc): Likewise.
44 (riscv_delete_pcgp_hi_reloc): Likewise.
45 (riscv_use_pcgp_hi_reloc): Likewise.
46 (riscv_record_pcgp_lo_reloc): Likewise.
47 (riscv_find_pcgp_lo_reloc): Likewise.
48 (riscv_delete_pcgp_lo_reloc): Likewise.
49 (_bfd_riscv_relax_pc): Likewise.
50 (_bfd_riscv_relax_section): Handle R_RISCV_PCREL_* relocations
51 via the new functions above.
53 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
55 * elfnn-riscv.c (R_RISCV_DELETE): New define.
56 (_bfd_riscv_relax_delete): New function.
57 (perform_relocation): Handle R_RISCV_DELETE.
58 (_bfd_riscv_relax_section): Likewise.
60 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
63 * elfxx-tilegx.c (tilegx_elf_tls_transition): Replace
64 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
65 bfd_link_executable for TLS check.
66 (tilegx_elf_check_relocs): Likewise.
67 (allocate_dynrelocs): Likewise.
68 (tilegx_elf_relocate_section): Likewise.
70 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
73 * elf32-tilepro.c (tilepro_elf_tls_transition): Replace
74 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
75 bfd_link_executable for TLS check.
76 (tilepro_elf_check_relocs): Likewise.
77 (allocate_dynrelocs): Likewise.
78 (tilepro_elf_relocate_section): Likewise.
80 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
83 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
84 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
85 bfd_link_executable for TLS check.
86 (_bfd_sparc_elf_check_relocs): Likewise.
87 (allocate_dynrelocs): Likewise.
88 (_bfd_sparc_elf_relocate_section): Likewise.
90 2017-10-18 H.J. Lu <hongjiu.lu@intel.com>
92 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
93 _bfd_generic_link_add_one_symbol to mark __tls_get_addr.
94 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
96 2017-10-17 H.J. Lu <hongjiu.lu@intel.com>
98 * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
99 indirect and warning symbols.
101 2017-10-17 Alan Modra <amodra@gmail.com>
104 * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
105 against size left rather than comparing pointers. Reorganise loop.
107 2017-10-17 Alan Modra <amodra@gmail.com>
110 * aoutx.h (aout_get_external_symbols): Handle stringsize of zero,
111 and error for any other size that doesn't cover the header word.
113 2017-10-16 H.J. Lu <hongjiu.lu@intel.com>
115 * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook.
116 * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed.
117 (elf_backend_gc_sweep_hook): Likewise.
118 * elf32-bfin.c (bfin_gc_sweep_hook): Likewise.
119 (bfinfdpic_gc_sweep_hook): Likewise.
120 (elf_backend_gc_sweep_hook): Likewise.
121 * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise.
122 (elf_backend_gc_sweep_hook): Likewise.
123 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
124 (elf_backend_gc_sweep_hook): Likewise.
125 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
126 (elf_backend_gc_sweep_hook): Likewise.
127 * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise.
128 (elf_backend_gc_sweep_hook): Likewise.
129 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
130 (elf_backend_gc_sweep_hook): Likewise.
131 * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook
133 (elf_m68k_remove_got_entry_type): Removed.
134 (elf_m68k_find_got_entry_ptr): Likewise.
135 (elf_m68k_remove_got_entry): Likewise.
136 (elf_m68k_gc_sweep_hook): Likewise.
137 (elf_backend_gc_sweep_hook): Likewise.
138 * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise.
139 (elf_backend_gc_sweep_hook): Likewise.
140 * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise.
141 (elf_backend_gc_sweep_hook): Likewise.
142 * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise.
143 (elf_backend_gc_sweep_hook): Likewise.
144 * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise.
145 (elf_backend_gc_sweep_hook): Likewise.
146 * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise.
147 (elf_backend_gc_sweep_hook): Likewise.
148 * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise.
149 (elf_backend_gc_sweep_hook): Likewise.
150 * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise.
151 (elf_backend_gc_sweep_hook): Likewise.
152 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
153 (elf_backend_gc_sweep_hook): Likewise.
154 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
155 (elf_backend_gc_sweep_hook): Likewise.
156 * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise.
157 * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise.
158 (elf_backend_gc_sweep_hook): Likewise.
159 * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
160 * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise.
161 (elf_backend_gc_sweep_hook): Likewise.
162 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
163 (elf_backend_gc_sweep_hook): Likewise.
164 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
165 (elf_backend_gc_sweep_hook): Likewise.
166 * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise.
167 (elf_backend_gc_sweep_hook): Likewise.
168 * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise.
169 * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise.
170 (elf_backend_gc_sweep_hook): Likewise.
171 * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise.
172 (ppc64_elf_gc_sweep_hook): Likewise.
173 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
174 (elf_backend_gc_sweep_hook): Likewise.
175 * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise.
176 * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
177 * elflink.c (elf_link_add_object_symbols): Don't call
178 _bfd_elf_link_check_relocs here.
179 (gc_sweep_hook_fn): Removed.
180 (elf_gc_sweep): Remove gc_sweep_hook.
181 * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed.
182 (elf_backend_gc_sweep_hook): Likewise.
183 * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise.
184 (elf_backend_gc_sweep_hook): Likewise.
185 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
186 * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise.
187 (elf_backend_gc_sweep_hook): Likewise.
188 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
189 * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise.
190 * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise.
191 (elfNN_bed): Remove elf_backend_gc_sweep_hook.
192 * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed.
193 * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise.
195 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
197 * elf32-i386.c (elf_i386_backend_data): Removed.
198 (get_elf_i386_backend_data): Likewise.
199 (elf_i386_arch_bed): Replace elf_i386_backend_data with
200 elf_x86_backend_data.
201 (elf_i386_get_synthetic_symtab): Likewise.
202 (elf_i386_nacl_arch_bed): Likewise.
203 (elf_i386_vxworks_arch_bed): Likewise.
204 (elf_i386_relocate_section): Check target_os instead of
206 (elf_i386_finish_dynamic_symbol): Likewise.
207 (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
208 Check target_os instead of is_vxworks.
209 (elf_i386_link_setup_gnu_properties): Remove normal_target and
210 is_vxworks. Initialize plt0_pad_byte.
211 * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
212 (get_elf_x86_64_arch_data): Likewise.
213 (get_elf_x86_64_backend_data): Likewise.
214 (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
215 elf_x86_backend_data.
216 (elf_x86_64_get_synthetic_symtab): Likewise.
217 (elf_x86_64_nacl_arch_bed): Likewise.
218 (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
219 normal_target. Initialize plt0_pad_byte.
220 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
221 instead of is_vxworks.
222 (_bfd_x86_elf_size_dynamic_sections): Likewise.
223 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
224 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
225 (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
226 (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
227 Update normal_target. Set up plt0_pad_byte. Check target_os
228 instead of is_vxworks.
229 * elfxx-x86.h (elf_x86_target_os): New.
230 (elf_x86_backend_data): Likewise.
231 (get_elf_x86_backend_data): Likewise.
232 (elf_x86_link_hash_table): Remove is_vxworks. Add plt0_pad_byte
234 (elf_x86_init_table): Remove normal_target and is_vxworks. Add
237 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
239 * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
240 _bfd_x86_elf_finish_dynamic_sections.
241 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
242 * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
244 * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
247 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
250 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
251 hide symbol which was forced to be dynamic.
253 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
256 * elf32-cris.c (cris_elf_relocate_section): Don't generate
257 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
258 (cris_elf_check_relocs): Don't allocate dynamic relocation
259 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
261 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
264 * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
265 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
266 (sh_elf_relocate_section): Don't generate dynamic relocation if
267 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
269 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
272 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
273 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
274 (elf_s390_relocate_section): Don't generate dynamic relocation
275 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
276 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
277 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
278 (elf_s390_relocate_section): Don't generate dynamic relocation
279 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
281 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
284 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
285 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
286 (allocate_dynrelocs): Discard dynamic relocations if
287 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
289 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
292 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
293 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
295 (allocate_dynrelocs): Discard dynamic relocations if
296 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
298 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
301 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
302 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
303 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
304 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
305 (elf_m68k_relocate_section): Don't generate dynamic relocation
306 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
308 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
311 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
312 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
313 (allocate_dynrelocs): Discard dynamic relocations if
314 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
315 (elf32_hppa_relocate_section): Don't generate dynamic
316 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
318 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
321 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
322 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
323 (allocate_fptr): Don't allocate function pointer if
324 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
325 (allocate_dynrel_entries): Don't allocate dynamic relocation
326 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
327 (set_got_entry): Don't set GOT entry if
328 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
329 (set_pltoff_entry): Don't set PLTOFF entry if
330 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
331 (elfNN_ia64_relocate_section): Don't install dynamic relocation
332 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
334 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
337 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
338 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
339 (allocate_dynrelocs): Don't allocate dynamic relocations if
340 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
342 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
345 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
346 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
347 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
348 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
350 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
353 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
354 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
355 (tilepro_elf_relocate_section): Don't generate dynamic
356 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
357 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
358 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
359 (tilegx_elf_relocate_section): Don't generate dynamic
360 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
362 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
365 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
366 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
368 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
369 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
371 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
373 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
374 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
375 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
377 2017-10-12 James Bowman <james.bowman@ftdichip.com>
379 * bfd-in2.h: Regenerate.
380 * libbfd.h: Regenerate.
381 * elf32-ft32.c: Add HOWTO R_FT32_15.
382 * reloc.c: Add BFD_RELOC_FT32_15.
384 2017-10-12 Nick Clifton <nickc@redhat.com>
386 * reloc.c (enum bfd_reloc_status): Start values at 2.
387 * bfd-in2.h: Regenerate.
388 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
389 that a TRUE return indicates success. Compare the result of
390 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
391 (build_one_stub): Change sense of tests against aarch64_relocate
393 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
394 than FALSE, when an error is detected.
395 (elfNN_aarch64_final_link_relocate): Likewise.
397 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
399 * elf32-i386.c (elf_backend_hide_symbol): New.
400 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
401 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
402 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
404 2017-10-12 Alan Modra <amodra@gmail.com>
406 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
407 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
408 (bfd_elf_define_start_stop): Likewise.
410 2017-10-12 Alan Modra <amodra@gmail.com>
412 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
413 when executable rather than non-PIC.
414 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
415 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
417 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
419 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
421 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
422 (elf_external_linux_prpsinfo64_ugid32): ... this.
423 (swap_linux_prpsinfo32_out): Rename to...
424 (swap_linux_prpsinfo32_ugid32_out): ... this.
425 (elf_external_linux_prpsinfo64_ugid16): New structure.
426 (swap_linux_prpsinfo64_ugid16_out): New function.
427 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
428 (elf_backend_linux_prpsinfo64_ugid16): Define.
429 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
430 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
431 of the 64-bit Linux core PRPSINFO note.
432 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
434 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
436 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
438 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
439 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
440 (elf_external_ppc_linux_prpsinfo32)
441 (swap_ppc_linux_prpsinfo32_out): Move to...
442 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
443 (swap_linux_prpsinfo32_ugid32_out): ... these.
444 (elf_external_linux_prpsinfo32): Rename to...
445 (elf_external_linux_prpsinfo32_ugid16): ... this.
446 (swap_linux_prpsinfo32_out): Rename to...
447 (swap_linux_prpsinfo32_ugid16_out): ... this.
448 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
449 (elf_backend_linux_prpsinfo32_ugid16): Define.
450 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
451 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
452 of the 32-bit Linux core PRPSINFO note.
453 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
454 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
455 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
456 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
457 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
458 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
459 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
460 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
461 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
462 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
464 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
466 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
467 `gap' member ahead of `pr_flag'.
469 2017-10-11 Pedro Alves <palves@redhat.com>
471 * bfd.c (_doprnt): Rename to ...
472 (_bfd_doprnt): ... this.
473 (error_handler_internal): Adjust.
475 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
477 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
478 instead of incrementing it.
479 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
481 2017-10-10 Renlin Li <renlin.li@arm.com>
484 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
485 symbols into dynamic.
487 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
490 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
491 (riscv_elf_link_hash_table_create): Initialize max_alignment to
493 (_bfd_riscv_relax_section): Cache the max alignment of output
494 sections if possible.
496 2017-10-10 Alan Modra <amodra@gmail.com>
498 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
499 .opd whenever .opd is present and non-zero size. Move code
500 setting abiversion to/from output file earlier. Only set
501 u.opd.func_sec when --gc-sections. Read relocs and set up
502 u.opd.func_sec values here..
503 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
505 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
507 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
509 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
512 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
514 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
515 .interp section with "ld --no-dynamic-linker".
517 2017-10-09 Alan Modra <amodra@gmail.com>
520 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
521 funcinfo_hash_table and varinfo_hash_table.
523 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
525 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
526 in read-only section with minfo.
527 (sh_elf_size_dynamic_sections): Likewise.
529 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
531 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
534 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
536 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
537 this_hdr.sh_entsize only if section size > 0.
539 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
541 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
543 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
545 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
546 in read-only section with minfo.
547 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
549 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
551 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
554 2017-10-06 John Baldwin <jhb@FreeBSD.org>
556 * elf-bfd.h (struct elf_backend_data): Add
557 `elf_backend_grok_freebsd_prstatus'.
558 * elf.c (elfcore_grok_freebsd_note): Call
559 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
561 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
563 (elf_backend_grok_freebsd_prstatus): Define.
564 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
565 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
567 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
569 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
570 and has_non_got_reloc with zero_undefweak.
571 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
572 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
574 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
575 has_non_got_reloc with zero_undefweak.
576 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
577 has_got_reloc and has_non_got_reloc with zero_undefweak.
578 (elf_x86_link_hash_entry): Likewise.
580 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
582 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
583 (VERIFY_COPY_RELOC): Likewise.
585 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
587 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
588 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
589 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
591 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
593 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
594 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
595 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
597 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
599 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
600 * elf32-i386.c (elf_i386_relocate_section): Use it.
601 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
603 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
605 * elf32-i386.c (X86_SIZE_TYPE_P): New.
606 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
607 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
608 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
609 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
611 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
613 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
614 (PLT_LOCAL_IFUNC_P): Likewise.
615 * elf32-i386.c (elf_i386_relocate_section): Use them.
616 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
618 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
620 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
621 * elf32-i386.c (elf_i386_relocate_section): Use it.
622 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
624 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
626 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
627 * elf32-i386.c (elf_i386_relocate_section): Use it.
628 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
630 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
632 * elf32-i386.c (X86_PCREL_TYPE_P): New.
633 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
634 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
635 (X86_PCREL_TYPE_P): This.
636 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
637 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
638 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
640 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
642 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
644 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
645 * elf32-i386.c (elf_i386_tls_transition): Use it.
646 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
648 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
650 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
651 Dump dynamic relocation in read-only section with minfo if
653 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
654 (maybe_set_textrel): Likewise.
655 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
656 read-only section with minfo.
658 2017-10-05 John Baldwin <jhb@FreeBSD.org>
660 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
662 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
664 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
665 in read-only section with minfo.
666 (tilepro_elf_size_dynamic_sections): Likewise.
667 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
668 (tilegx_elf_size_dynamic_sections): Likewise.
670 2017-10-05 Pedro Alves <palves@redhat.com>
673 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
674 ellipsis parameter. Split out bfd_error_on_input code to..
675 (bfd_set_input_error): .. New function.
676 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
677 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
678 * bfd-in2.h: Regenerate.
680 2017-10-05 Alan Modra <amodra@gmail.com>
682 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
683 fini_array error value.
685 2017-10-05 Alan Modra <amodra@gmail.com>
688 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
690 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
692 (elf_fake_sections): Adjust calls. Exit immediately on failure.
693 (bfd_elf_set_group_contents): Add associated reloc section indices
696 2017-10-04 Alan Modra <amodra@gmail.com>
698 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
699 classify symbols for ELFv2.
701 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
704 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
705 undergoes default promotion.
706 * bfd-in2.h: Regenerate.
708 2017-10-02 Alan Modra <amodra@gmail.com>
710 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
711 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
713 2017-10-01 Alan Modra <amodra@gmail.com>
716 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
717 (add_line_info): Always put end_sequence last.
719 2017-10-01 Alan Modra <amodra@gmail.com>
722 * dwarf2.c (read_section): Allocate buffer with extra byte for
723 bfd_simple_get_relocated_section_contents rather than copying
726 2017-09-29 Alan Modra <amodra@gmail.com>
728 * merge.c (merge_strings): Return FALSE on malloc failure.
729 (_bfd_merge_sections): Return failures from record_section and
732 2017-09-28 Alan Modra <amodra@gmail.com>
735 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
736 a case where plugin_notice isn't called.
738 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
740 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
743 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
746 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
747 output_bfd to info->callbacks->minfo.
749 2017-09-26 Nick Clifton <nickc@redhat.com>
752 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
753 assertion failure if elf_x86_64_rtype_to_howto has already issued
756 2017-09-26 Alan Modra <amodra@gmail.com>
759 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
762 2017-09-26 Nick Clifton <nickc@redhat.com>
765 * dwarf2.c (read_formatted_entries): Fail early if we know that
766 the loop parsing data entries will overflow the end of the
769 2017-09-26 Alan Modra <amodra@gmail.com>
772 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
773 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
774 to stash->info_ptr_memory, and check die_ref is within that memory.
775 Set info_ptr_end correctly when another CU is refd. Check die_ref
776 for DW_FORM_ref4 etc. is within CU.
778 2017-09-26 Alan Modra <amodra@gmail.com>
781 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
782 (read_formatted_entries): Init "fe".
783 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
785 2017-09-26 Alan Modra <amodra@gmail.com>
788 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
789 bounds in inner loop.
791 2017-09-25 Alan Modra <amodra@gmail.com>
794 * dwarf1.c (parse_die): Sanity check pointer against section limit
795 before dereferencing.
796 (parse_line_table): Likewise.
798 2017-09-25 Alan Modra <amodra@gmail.com>
801 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
803 (parse_comp_unit): Likewise.
805 2017-09-25 Alan Modra <amodra@gmail.com>
808 * dwarf2.c (read_formatted_entries): Error on format_count zero.
810 2017-09-24 Alan Modra <amodra@gmail.com>
813 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
814 within section bounds.
816 2017-09-24 Alan Modra <amodra@gmail.com>
819 * dwarf2.c (decode_line_info): Properly free line sequences on error.
821 2017-09-24 Alan Modra <amodra@gmail.com>
824 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
825 pname param. Return status. Make name const. Don't abort,
826 return an error. Formatting. Exit if current info_ptr matches
827 orig_info_ptr. Update callers.
828 (scan_unit_for_symbols): Start at nesting_level of zero. Make
829 nested_funcs an array of structs for extensibility. Formatting.
831 2017-09-24 Alan Modra <amodra@gmail.com>
834 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
835 rather than dividing by zero.
837 2017-09-24 Alan Modra <amodra@gmail.com>
840 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
842 2017-09-24 Alan Modra <amodra@gmail.com>
845 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
847 2017-09-24 Alan Modra <amodra@gmail.com>
850 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
851 SHT_GNU_verneed section for sanity. Don't zalloc memory for
854 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
857 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
860 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
863 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
864 -1 if bfd_canonicalize_dynamic_reloc returns 0.
866 2017-09-22 Pedro Alves <palves@redhat.com>
867 Alan Modra <amodra@gmail.com>
869 * version.h: Add comment.
871 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
873 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
874 NT_S390_GS_BC, correct the previously swapped invocations of
875 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
877 2017-09-19 Alan Modra <amodra@gmail.com>
880 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
883 2017-09-19 Alan Modra <amodra@gmail.com>
886 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
887 symbols before calculating verrefs. Don't renumber dynsyms
888 after gc. Exclude .gnu.version when zero or one dynsym.
889 Localize some vars and reindent.
891 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
894 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
895 return from bfd_canonicalize_dynamic_reloc.
897 2017-09-15 Alan Modra <amodra@gmail.com>
900 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
901 overflows bfd_size_type.
903 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
906 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
907 to indicate if conversion is performed.
908 (elf_i386_check_relocs): Cache section contents and relocations
909 if conversion is performed.
910 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
911 contents and relocations if conversion is performed.
913 2017-09-14 Nick Clifton <nickc@redhat.com>
916 * peXXigen.c (pe_print_idata): Extend check for HintName vector
919 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
921 * elfxx-x86.h: Fix a typo in comments.
923 2017-09-09 Kamil Rytarowski <n54@gmx.com>
925 * elf32-nds32.c: Rename __BIT() to N32_BIT().
927 2017-09-09 Alan Modra <amodra@gmail.com>
929 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
932 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
934 * elf32-i386.c (elf_i386_relocate_section): Update usage of
935 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
936 (elf_i386_finish_dynamic_symbol): Likewise.
937 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
938 (elf_x86_64_finish_dynamic_symbol): Likewise.
939 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
940 (_bfd_x86_elf_fixup_symbol): Likewise.
942 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
944 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
945 check has_non_got_reloc.
947 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
950 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
951 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
952 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
953 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
954 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
955 and linker_def on __ehdr_start if it is referenced and not
957 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
958 and return TRUE when building executable, if a symbol has
959 non-GOT/non-PLT relocations in text section or there is no
961 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
963 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
965 * elfxx-x86.h: Update comments.
967 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
969 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
970 elf_x86_plt_layout_table with elf_x86_init_table.
971 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
973 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
975 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
976 (elf_x86_init_table): This.
977 (_bfd_x86_elf_link_setup_gnu_properties): Replace
978 elf_x86_plt_layout_table with elf_x86_init_table.
980 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
982 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
983 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
984 * configure: Regenerated.
985 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
986 and r_sym fields of plt_layout.
987 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
989 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
990 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
991 r_info nor r_sym fields.
992 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
994 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
996 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
998 * (_bfd_riscv_relax_align): Call bfd_set_error and
999 print an error message when unable to relax a .align directive.
1001 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1003 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
1004 (riscv_record_pcrel_hi_reloc): Add absolute argument.
1005 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
1006 R_RISCV_PCREL_HI20 relocs, and pass the result to
1007 riscv_record_pcrel_hi_reloc.
1009 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1011 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
1012 r_type_p. Remove the converted argument. Replace
1013 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
1014 the new relocation type via r_type_p.
1015 (elf_i386_relocate_section): Likewise.
1016 (elf_i386_finish_dynamic_symbol): Likewise.
1017 (need_convert_load): Removed.
1018 (check_relocs_failed): Updated.
1019 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
1020 instead of setting need_convert_load.
1021 (_bfd_i386_elf_convert_load): Removed.
1022 * elf64-x86-64.c (need_convert_load): Removed.
1023 (check_relocs_failed): Updated.
1024 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
1025 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
1026 Return the new relocation type via r_type_p.
1027 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
1028 instead of setting need_convert_load.
1029 (elf_x86_64_check_relocs): Don't check PIC if relocation has
1031 (_bfd_x86_64_elf_convert_load): Removed.
1032 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
1033 with SYMBOL_REFERENCES_LOCAL_P.
1034 (elf_x86_64_finish_dynamic_symbol): Likewise.
1035 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
1037 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
1038 (_bfd_x86_elf_link_symbol_references_local): New function.
1039 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
1040 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
1041 SYMBOL_REFERENCES_LOCAL_P.
1042 (elf_x86_link_hash_entry): Add local_ref.
1043 (elf_x86_link_hash_table): Remove convert_load.
1044 (_bfd_i386_elf_convert_load): Removed.
1045 (_bfd_x86_64_elf_convert_load): Likewise.
1046 (_bfd_x86_elf_link_symbol_references_local): New.
1048 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1050 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
1051 (elf_x86_64_info_to_howto): Get the real relocation type by
1052 masking out R_X86_64_converted_reloc_bit.
1053 (elf_x86_64_check_tls_transition): Get the real relocation type
1054 by masking out R_X86_64_converted_reloc_bit.
1055 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
1056 instead of setting converted_reloc.
1057 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
1058 instead of converted_reloc. Get the real relocation type by
1059 masking out R_X86_64_converted_reloc_bit.
1060 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
1061 R_X86_64_converted_reloc_bit is valid.
1062 * elfxx-x86.h (converted_reloc): Removed.
1064 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1066 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
1067 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
1068 to get the relocation type again.
1069 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
1070 r_type when calling elf_x86_64_tls_transition. Don't use
1071 ELF32_R_TYPE to get the relocation type again.
1073 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1075 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
1078 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1080 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
1081 argument. Don't check relocation overflow. Avoid relocation
1082 overflow if --no-relax is used. Set converted_reloc on symbol
1083 if a GOTPCREL relocation is converted.
1084 (elf_x86_64_relocate_section): Issue a fatal error and suggest
1085 --no-relax if GOTPCREL relocation conversion leads to relocation
1087 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
1089 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
1090 Edmar Wienskoski <edmar.wienskoski@nxp.com
1092 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
1093 (ppc_elf_check_relocs): Handle it.
1094 (ppc_elf_vle_split20): New function.
1095 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
1097 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
1100 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
1101 for x86-64 if GOT_TLS_GDESC_P is true.
1103 2017-09-03 Alan Modra <amodra@gmail.com>
1106 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
1108 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1110 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1111 tls_get_addr for x86-64 in one place.
1113 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1115 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
1116 with elfxx-x86.lo for 64-bit BFD.
1117 * configure: Regenerated.
1119 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1121 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
1122 (_bfd_i386_elf_convert_load): This. Remove static.
1123 (elf_i386_size_dynamic_sections): Removed.
1124 (elf_backend_size_dynamic_sections): Likewise.
1125 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
1126 (_bfd_x86_64_elf_convert_load): This. Remove static.
1127 (elf_x86_64_size_dynamic_sections): Removed.
1128 (elf_backend_size_dynamic_sections): Likewise.
1129 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
1130 (elf_x86_allocate_dynrelocs): This. Make it static.
1131 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
1132 (elf_x86_allocate_local_dynreloc): This. Make it static.
1133 (elf_i386_is_reloc_section): New function.
1134 (elf_x86_64_is_reloc_section): Likewise.
1135 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
1136 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1137 Rearrange got_entry_size initialization.
1138 (_bfd_x86_elf_size_dynamic_sections): New function.
1139 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
1140 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1141 (_bfd_i386_elf_convert_load): New.
1142 (_bfd_x86_64_elf_convert_load): Likewise.
1143 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1144 (elf_backend_size_dynamic_sections): Likewise.
1145 (_bfd_x86_elf_allocate_dynrelocs): Removed.
1146 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1148 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1150 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
1153 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1155 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1156 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
1158 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1160 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1161 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
1162 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1163 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
1164 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1165 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
1167 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1169 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
1170 (elf_i386_allocate_local_dynrelocs): Likewise.
1171 (elf_i386_size_dynamic_sections): Replace
1172 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
1173 with _bfd_x86_elf_allocate_dynrelocs and
1174 _bfd_x86_elf_allocate_local_dynrelocs.
1175 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
1176 (elf_x86_64_allocate_local_dynrelocs): Likewise.
1177 (elf_x86_64_size_dynamic_sections): Replace
1178 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
1179 with _bfd_x86_elf_allocate_dynrelocs and
1180 _bfd_x86_elf_allocate_local_dynrelocs.
1181 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
1182 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1183 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
1184 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1186 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1188 * elf32-i386.c (is_i386_elf): Removed.
1189 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
1190 (elf_i386_size_dynamic_sections): Likewise.
1191 (elf_i386_relocate_section): Likewise.
1192 * elf64-x86-64.c (is_x86_64_elf): Removed.
1193 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
1195 (elf_x86_64_size_dynamic_sections): Likewise.
1196 (elf_x86_64_relocate_section): Likewise.
1197 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1199 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
1202 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1204 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
1205 (elf_i386_allocate_dynrelocs): Replace
1206 elf_i386_compute_jump_table_size with
1207 elf_x86_compute_jump_table_size.
1208 (elf_i386_size_dynamic_sections): Likewise.
1209 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
1210 (elf_x86_64_allocate_dynrelocs): Replace
1211 elf_x86_64_compute_jump_table_size with
1212 elf_x86_compute_jump_table_size.
1213 (elf_x86_64_size_dynamic_sections): Likewise.
1214 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1216 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
1217 (elf_x86_compute_jump_table_size): New.
1219 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1221 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1223 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
1224 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
1226 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1228 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
1229 with htab->is_vxworks.
1230 (elf_i386_size_dynamic_sections): Likewise.
1231 (elf_i386_relocate_section): Likewise.
1232 (elf_i386_finish_dynamic_symbol): Likewise.
1233 (elf_i386_finish_dynamic_sections): Likewise.
1235 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1237 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1238 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1239 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
1240 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1241 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1242 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
1243 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1244 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
1246 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1249 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
1250 ELF_COMMON_DEF_P for common symbols.
1252 2017-09-02 Alan Modra <amodra@gmail.com>
1254 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
1255 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1256 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1258 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1260 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
1261 (elf_backend_gc_mark_hook): Likewise.
1262 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
1263 (elf_backend_gc_mark_hook): Likewise.
1264 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
1265 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
1266 (elf_backend_gc_mark_hook): Likewise.
1268 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1270 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1271 (elf_backend_adjust_dynamic_symbol): Likewise.
1272 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1273 (elf_backend_adjust_dynamic_symbol): Likewise.
1274 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1275 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1276 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1277 (_bfd_x86_elf_adjust_dynamic_symbol): New.
1278 (elf_backend_adjust_dynamic_symbol): Likewise.
1280 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1282 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1285 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1287 * elf32-i386.c (elf_i386_mkobject): Removed.
1288 (bfd_elf32_mkobject): Likewise.
1289 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1290 (bfd_elf64_mkobject): Likewise.
1291 (bfd_elf32_mkobject): Likewise.
1292 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
1293 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1294 (bfd_elf64_mkobject): Likewise.
1295 (bfd_elf32_mkobject): Likewise.
1297 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1299 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1300 Call _bfd_x86_elf_link_setup_gnu_properties.
1301 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1302 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1304 (elf_x86_64_non_lazy_plt): Likewise.
1305 (elf_x86_64_lazy_bnd_plt): Likewise.
1306 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1307 (elf_x86_64_lazy_ibt_plt): Likewise.
1308 (elf_x32_lazy_ibt_plt): Likewise.
1309 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1310 (elf_x32_non_lazy_ibt_plt): Likewise.
1311 (elf_x86_64_nacl_plt): Likewise.
1312 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1313 _bfd_x86_elf_link_setup_gnu_properties.
1314 * elfxx-x86.c: Include elf-vxworks.h".
1315 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1316 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1317 comments for pic_plt0_entry and pic_plt_entry.
1318 (elf_x86_non_lazy_plt_layout): Likewise.
1319 (elf_x86_plt_layout_table): New.
1320 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1322 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1325 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1326 .eh_frame section for the second PLT.
1327 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1328 alignment of .eh_frame section for the second PLT.
1330 2017-09-01 Nick Clifton <nickc@redhat.com>
1333 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1336 2017-09-01 Nick Clifton <nickc@redhat.com>
1339 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1340 attribute buffer is NUL terminated.
1342 2017-08-31 Nick Clifton <nickc@redhat.com>
1345 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1346 to dwarf string sections.
1348 2017-08-31 Alan Modra <amodra@gmail.com>
1350 * po/SRC-POTFILES.in: Regenerate.
1352 2017-08-31 Alan Modra <amodra@gmail.com>
1354 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1355 for a section containing just a terminator. Allow multiple
1356 terminators at end of section.
1357 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1358 sections when not adding alignment. Assert on terminator in
1361 2017-08-31 Alan Modra <amodra@gmail.com>
1365 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1368 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1370 * configure.ac (bfd_backends): Add elf64.lo together with
1371 elfxx-x86.lo for 64-bit BFD.
1372 * configure: Regenerated.
1374 2017-08-31 James Bowman <james.bowman@ftdichip.com>
1376 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1379 2017-08-31 Alan Modra <amodra@gmail.com>
1382 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1383 before _close_and_cleanup. Call iovec->bclose after.
1384 (bfd_close): Remove code common to, and call, bfd_close_all_done.
1386 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1388 * elf32-i386.c (elf_i386_plt_type): Removed.
1389 (elf_i386_plt): Likewise.
1390 (elf_i386_get_synthetic_symtab): Updated. Call
1391 _bfd_x86_elf_get_synthetic_symtab.
1392 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1393 (elf_x86_64_plt): Likewise.
1394 (elf_x86_64_get_synthetic_symtab): Updated. Call
1395 _bfd_x86_elf_get_synthetic_symtab.
1396 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1397 (elf_x86_64_get_plt_got_vma): Likewise.
1398 (elf_i386_valid_plt_reloc_p): Likewise.
1399 (elf_x86_64_valid_plt_reloc_p): Likewise.
1400 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1401 * elfxx-x86.h (elf_x86_plt_type): New.
1402 (elf_x86_plt): Likewise.
1403 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1405 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1407 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1408 target_id instead of elf_machine_code.
1410 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1412 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1413 (elf_i386_lazy_plt_layout): Likewise.
1414 (elf_i386_non_lazy_plt_layout): Likewise.
1415 (elf_i386_plt_layout): Likewise.
1416 (elf_i386_link_hash_table): Likewise.
1417 (elf_i386_next_tls_desc_index): Likewise.
1418 (elf_i386_srelplt2): Likewise.
1419 (elf_i386_plt): Likewise.
1420 (elf_i386_lazy_plt): Likewise.
1421 (elf_i386_non_lazy_plt): Likewise.
1422 (elf_i386_link_hash_table_create): Likewise.
1423 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1424 (elf_i386_lazy_plt): Updated.
1425 (elf_i386_non_lazy_plt): Likewise.
1426 (elf_i386_lazy_ibt_plt): Likewise.
1427 (elf_i386_non_lazy_ibt_plt): Likewise.
1428 (elf_i386_allocate_dynrelocs): Likewise.
1429 (elf_i386_size_dynamic_sections): Likewise.
1430 (elf_i386_relocate_section): Likewise.
1431 (elf_i386_finish_dynamic_symbol): Likewise.
1432 (elf_i386_finish_dynamic_sections): Likewise.
1433 (elf_i386_get_synthetic_symtab): Likewise.
1434 (elf_i386_link_setup_gnu_properties): Likewise.
1435 (elf_i386_nacl_plt): Likewise.
1436 * elf64-x86-64.c (ABI_64_P): Removed.
1437 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1438 (ELF32_DYNAMIC_INTERPRETER): Likewise.
1439 (elf_x86_64_lazy_plt_layout): Likewise.
1440 (elf_x86_64_non_lazy_plt_layout): Likewise.
1441 (elf_x86_64_plt_layout): Likewise.
1442 (elf_x86_64_link_hash_table): Likewise.
1443 (elf_x86_64_plt): Likewise.
1444 (elf_x86_64_lazy_plt): Likewise.
1445 (elf_x86_64_non_lazy_plt): Likewise.
1446 (elf_x86_64_link_hash_table_create): Likewise.
1447 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1448 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1449 (elf_x86_64_lazy_plt): Updated.
1450 (elf_x86_64_non_lazy_plt): Likewise.
1451 (elf_x86_64_lazy_bnd_plt): Likewise.
1452 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1453 (elf_x86_64_lazy_ibt_plt): Likewise.
1454 (elf_x32_lazy_ibt_plt): Likewise.
1455 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1456 (elf_x32_non_lazy_ibt_plt): Likewise.
1457 (elf_x86_64_allocate_dynrelocs): Likewise.
1458 (elf_x86_64_size_dynamic_sections): Likewise.
1459 (elf_x86_64_relocate_section): Likewise.
1460 (elf_x86_64_finish_dynamic_symbol): Likewise.
1461 (elf_x86_64_finish_dynamic_sections): Likewise.
1462 (elf_x86_64_get_synthetic_symtab): Likewise.
1463 (elf_x86_64_link_setup_gnu_properties): Likewise.
1464 (elf_x86_64_nacl_plt): Likewise.
1465 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1467 (ELF32_DYNAMIC_INTERPRETER): New.
1468 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1469 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1470 (_bfd_x86_elf_link_hash_table_create): Likewise.
1471 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1472 (elf_x86_link_hash_table_free): This. Make it static.
1473 * elfxx-x86.h: Don't include "objalloc.h".
1475 (elf_x86_lazy_plt_layout): Likewise.
1476 (elf_x86_non_lazy_plt_layout): Likewise.
1477 (elf_x86_plt_layout): Likewise.
1478 (_bfd_x86_elf_link_hash_table_create): Likewise.
1479 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1480 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1481 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1482 srelplt2 and next_tls_desc_index.
1483 (_bfd_x86_elf_link_hash_table_free): Removed.
1485 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1487 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1488 branch offset interpretation.
1490 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1493 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1495 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1497 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1498 (elf_x86_64_srelplt2): Likewise.
1500 2017-08-30 Alan Modra <amodra@gmail.com>
1502 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1503 (ppc64_elf_tls_optimize): Set it.
1504 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1505 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1506 addis would add zero.
1507 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1508 (ppc_elf_tls_optimize): Set it.
1509 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1510 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1512 2017-08-30 Alan Modra <amodra@gmail.com>
1514 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1515 __tls_get_addr call sequences to LE, don't move the addi down
1516 to the nop. Replace the bl with addi and leave the nop alone.
1518 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1520 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1522 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1524 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1526 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1528 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1529 (BFD64_BACKENDS): Likewise.
1530 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1531 (BFD64_BACKENDS_CFILES): Likewise.
1532 * Makefile.in: Regenerated.
1533 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1534 elf32-i386.lo and elf64-x86-64.lo.
1535 * configure: Regenerated.
1536 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1537 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1538 "objalloc.h" and "hashtab.h".
1539 (ELIMINATE_COPY_RELOCS): Removed.
1540 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1541 (SYMBOL_NO_COPYRELOC): Likewise.
1542 (elf_i386_link_hash_entry): Likewise.
1543 (GOT_UNKNOWN): Likewise.
1544 (GOT_NORMAL): Likewise.
1545 (GOT_TLS_GD): Likewise.
1546 (elf_i386_hash_entry): Likewise.
1547 (elf_i386_obj_tdata): Likewise.
1548 (elf_i386_tdata): Likewise.
1549 (elf_i386_local_got_tls_type): Likewise.
1550 (elf_i386_local_tlsdesc_gotent): Likewise.
1551 (elf_i386_hash_table): Likewise.
1552 (elf_i386_link_hash_newfunc): Likewise.
1553 (elf_i386_local_htab_hash): Likewise.
1554 (elf_i386_local_htab_eq): Likewise.
1555 (elf_i386_get_local_sym_hash): Likewise.
1556 (elf_i386_link_hash_table_free): Likewise.
1557 (elf_i386_copy_indirect_symbol): Likewise.
1558 (elf_i386_fixup_symbol): Likewise.
1559 (elf_i386_readonly_dynrelocs): Likewise.
1560 (elf_i386_always_size_sections): Likewise.
1561 (elf_i386_set_tls_module_base): Likewise.
1562 (elf_i386_dtpoff_base): Likewise.
1563 (compare_relocs): Likewise.
1564 (elf_i386_hash_symbol): Likewise.
1565 (elf_i386_parse_gnu_properties): Likewise.
1566 (elf_i386_merge_gnu_properties): Likewise.
1567 (elf_i386_link_check_relocs): Likewise.
1568 (elf_i386_merge_symbol_attribute): Likewise.
1569 (bfd_elf32_bfd_link_check_relocs): Likewise.
1570 (elf_backend_copy_indirect_symbol): Likewise.
1571 (elf_backend_always_size_sections): Likewise.
1572 (elf_backend_omit_section_dynsym): Likewise.
1573 (elf_backend_hash_symbol): Likewise.
1574 (elf_backend_fixup_symbol): Likewise.
1575 (elf_backend_parse_gnu_properties): Likewise.
1576 (elf_backend_merge_gnu_properties): Likewise.
1577 (elf_backend_merge_symbol_attribute): Likewise.
1578 (elf_i386_mkobject): Updated.
1579 (elf_i386_link_hash_table_create): Likewise.
1580 (elf_i386_check_tls_transition): Likewise.
1581 (elf_i386_tls_transition): Likewise.
1582 (elf_i386_convert_load_reloc): Likewise.
1583 (elf_i386_check_relocs): Likewise.
1584 (elf_i386_adjust_dynamic_symbol): Likewise.
1585 (elf_i386_allocate_dynrelocs): Likewise.
1586 (elf_i386_convert_load): Likewise.
1587 (elf_i386_size_dynamic_sections): Likewise.
1588 (elf_i386_relocate_section): Likewise.
1589 (elf_i386_finish_dynamic_symbol ): Likewise.
1590 (elf_i386_finish_dynamic_sections): Likewise.
1591 (elf_i386_output_arch_local_syms): Likewise.
1592 (elf_i386_get_synthetic_symtab): Likewise.
1593 (elf_i386_link_setup_gnu_properties): Likewise.
1594 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1595 of elf_link_hash_table, as base.
1596 (elf_i386_next_tls_desc_index): New.
1597 (elf_i386_srelplt2): Likewise.
1598 (elf_i386_plt): Likewise.
1599 (elf_i386_lazy_plt): Likewise.
1600 (elf_i386_non_lazy_plt): Likewise.
1601 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1602 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1603 "objalloc.h" and "hashtab.h".
1604 (ELIMINATE_COPY_RELOCS): Removed.
1605 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1606 (SYMBOL_NO_COPYRELOC): Likewise.
1607 (elf_x86_64_link_hash_entry): Likewise.
1608 (GOT_UNKNOWN): Likewise.
1609 (GOT_NORMAL): Likewise.
1610 (GOT_TLS_GD): Likewise.
1611 (elf_x86_64_hash_entry): Likewise.
1612 (elf_x86_64_obj_tdata): Likewise.
1613 (elf_x86_64_tdata): Likewise.
1614 (elf_x86_64_local_got_tls_type): Likewise.
1615 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1616 (elf_x86_64_hash_table): Likewise.
1617 (elf_x86_64_link_hash_newfunc): Likewise.
1618 (elf_x86_64_local_htab_hash): Likewise.
1619 (elf_x86_64_local_htab_eq): Likewise.
1620 (elf_x86_64_get_local_sym_hash): Likewise.
1621 (elf_x86_64_link_hash_table_free): Likewise.
1622 (elf_x86_64_copy_indirect_symbol): Likewise.
1623 (elf_x86_64_fixup_symbol): Likewise.
1624 (elf_x86_64_readonly_dynrelocs): Likewise.
1625 (elf_x86_64_always_size_sections): Likewise.
1626 (elf_x86_64_set_tls_module_base): Likewise.
1627 (elf_x86_64_dtpoff_base): Likewise.
1628 (compare_relocs): Likewise.
1629 (elf_x86_64_merge_symbol_attribute): Likewise.
1630 (elf_x86_64_hash_symbol): Likewise.
1631 (elf_x86_64_parse_gnu_properties): Likewise.
1632 (elf_x86_64_merge_gnu_properties): Likewise.
1633 (elf_x86_64_link_check_relocs): Likewise.
1634 (elf_backend_copy_indirect_symbol): Likewise.
1635 (elf_backend_always_size_sections): Likewise.
1636 (bfd_elf64_bfd_link_check_relocs): Likewise.
1637 (elf_backend_merge_symbol_attribute): Likewise.
1638 (elf_backend_hash_symbol): Likewise.
1639 (elf_backend_omit_section_dynsym): Likewise.
1640 (elf_backend_fixup_symbol): Likewise.
1641 (elf_backend_parse_gnu_properties): Likewise.
1642 (elf_backend_merge_gnu_properties): Likewise.
1643 (bfd_elf32_bfd_link_check_relocs): Likewise.
1644 (elf_x86_64_mkobject): Updated.
1645 (elf_x86_64_link_hash_table_create): Likewise.
1646 (elf_x86_64_check_tls_transition): Likewise.
1647 (elf_x86_64_tls_transition): Likewise.
1648 (elf_x86_64_convert_load_reloc): Likewise.
1649 (elf_x86_64_check_relocs): Likewise.
1650 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1651 (elf_x86_64_allocate_dynrelocs): Likewise.
1652 (elf_x86_64_convert_load): Likewise.
1653 (elf_x86_64_size_dynamic_sections): Likewise.
1654 (elf_x86_64_relocate_section): Likewise.
1655 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1656 (elf_x86_64_finish_dynamic_sections): Likewise.
1657 (elf_x86_64_output_arch_local_syms): Likewise.
1658 (elf_x86_64_get_synthetic_symtab): Likewise.
1659 (elf_x86_64_link_setup_gnu_properties): Likewise.
1660 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1661 instead of elf_link_hash_table, as base.
1662 (elf_x86_64_next_tls_desc_index): New.
1663 (elf_x86_64_srelplt2): Likewise.
1664 (elf_x86_64_plt): Likewise.
1665 (elf_x86_64_lazy_plt): Likewise.
1666 (elf_x86_64_non_lazy_plt): Likewise.
1667 * elfxx-x86.c: New file.
1668 * elfxx-x86.h: Likewise.
1670 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1672 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1674 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1676 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1678 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1679 sections before checking dynamic relocations and free invalid
1680 PLT section contents.
1681 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1683 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1685 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1686 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1688 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1691 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1693 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1695 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1697 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1699 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1701 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1704 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1705 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1706 Add a has_no_copy_on_protected bitfield.
1707 (elf_has_no_copy_on_protected): New.
1708 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1709 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1710 (elf_merge_gnu_property_list): Likewise.
1711 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1712 to FALSE for elf_has_no_copy_on_protected.
1713 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1714 (elf_i386_link_hash_entry): Add def_protected.
1715 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1716 when checking info->nocopyreloc.
1717 (elf_i386_link_setup_gnu_properties): Don't set
1718 extern_protected_data here.
1719 (elf_i386_merge_symbol_attribute): New function.
1720 (elf_backend_merge_symbol_attribute): New.
1721 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1722 (elf_x86_64_link_hash_entry): Add def_protected.
1723 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1724 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1725 when checking info->nocopyreloc.
1726 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1727 relocation run-time overflow and unresolvable R_X86_64_32S
1728 relocation against protected data symbol defined in shared object
1729 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1730 (elf_x86_64_link_setup_gnu_properties): Don't set
1731 extern_protected_data here.
1732 (elf_x86_64_merge_symbol_attribute): New function.
1733 (elf_backend_merge_symbol_attribute): New.
1735 2017-08-26 Alan Modra <amodra@gmail.com>
1737 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1738 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1739 (ppc_elf_relocate_section): Comment fix.
1740 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1741 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1742 Support dynamic relocs for TPREL16 when non-pic too.
1743 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1744 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1747 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1749 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1750 "symbol" in comments.
1751 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1753 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1756 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1757 R_X86_64_PC32 relocation run-time overflow and unresolvable
1758 R_X86_64_32S relocation with -z nocopyreloc.
1760 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1762 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1763 Undefined symbols may not have a type.
1764 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1766 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1768 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1769 bfd_link_info. Report shared, PIE or PDE object based on
1771 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1772 (elf_x86_64_relocate_section): Likewise.
1774 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1776 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1777 for function symbols.
1778 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1780 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1782 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1783 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1784 is set on any input relocatable file.
1785 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1787 2017-08-23 Alan Modra <amodra@gmail.com>
1790 * elf64-ppc.c (ensure_undef_dynamic): Rename from
1791 ensure_undefweak_dynamic. Handle undefined too.
1792 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1793 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1794 (allocate_dynrelocs): Discard undefined non-default visibility
1795 relocs first. Make undefined syms dynamic. Tidy goto.
1797 2017-08-21 Alan Modra <amodra@gmail.com>
1798 H.J. Lu <hongjiu.lu@intel.com>
1801 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
1802 * elflink.c (bfd_elf_define_start_stop): Rewrite.
1804 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
1807 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
1808 undefined weak symbols.
1810 2017-08-18 Nick Clifton <nickc@redhat.com>
1813 * tekhex.c (getsym): Fix check for source pointer walking off the
1814 end of the input buffer.
1816 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
1819 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
1820 relocations in debug sections, change abort to _bfd_error_handler.
1822 2017-08-14 Nick Clifton <nickc@redhat.com>
1825 * elf.c (setup_group): Check for an empty or very small group
1827 * po/bfd.pot: Regenerate.
1829 2017-08-14 Alan Modra <amodra@gmail.com>
1832 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
1833 alignment padding here.
1834 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
1835 in a reverse pass over sections.
1837 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
1840 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
1841 for @plt suffixes first.
1842 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1844 2017-08-08 Nick Clifton <nickc@redhat.com>
1847 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
1848 small section lengths.
1849 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
1851 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
1852 there is enough data present in the note.
1854 2017-08-08 Alan Modra <amodra@gmail.com>
1857 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
1858 got.refcount for GOTOFF relocs, just create .got section.
1860 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
1862 * elflink.c (elf_link_add_object_symbols): Move common symbol
1863 check after bed->common_definition.
1865 2017-08-07 Alan Modra <amodra@gmail.com>
1868 * elflink.c (bfd_elf_final_link): Don't segfault when sections
1869 needed to define various dynamic tags have been discarded.
1871 2017-08-07 Nick Clifton <nickc@redhat.com>
1874 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
1875 has not been set then use the bfd returned by
1876 _bfd_elf_link_setup_gnu_properties. If that is null then search
1877 through all the input bfds selecting the first normal, ELF format
1879 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1881 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1883 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
1885 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
1886 (elf_i386_check_tls_transition): Check tls_get_addr directly.
1887 (elf_i386_convert_load_reloc): Update tls_get_addr check.
1888 (elf_i386_link_check_relocs): New function.
1889 (bfd_elf32_bfd_link_check_relocs): New.
1890 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
1892 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
1893 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
1894 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
1895 (elf_x86_64_link_check_relocs): New function.
1896 (bfd_elf64_bfd_link_check_relocs): New.
1897 (bfd_elf32_bfd_link_check_relocs): Likewise.
1899 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1902 * elflink.c (elf_link_add_object_symbols): Treat common symbol
1903 as undefined for --no-define-common.
1905 2017-08-05 Alan Modra <amodra@gmail.com>
1907 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
1908 hppa_link_hash_table.
1910 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
1912 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
1913 entries for sysregs with negative indices.
1915 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1917 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
1918 isn't the S/390 specific elf data.
1919 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1921 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
1923 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
1924 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
1925 [R_RISCV_ADD16]: Likewise.
1926 [R_RISCV_ADD32]: Likewise.
1927 [R_RISCV_ADD64]: Likewise.
1928 [R_RISCV_SUB6]: Likewise.
1929 [R_RISCV_SUB8]: Likewise.
1930 [R_RISCV_SUB16]: Likewise.
1931 [R_RISCV_SUB32]: Likewise.
1932 [R_RISCV_SUB64]: Likewise.
1934 2017-07-31 Alan Modra <amodra@gmail.com>
1936 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
1937 without ld.so checks.
1939 2017-07-29 Alan Modra <amodra@gmail.com>
1942 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
1943 (ppc64_elf_merge_symbol): Set non_zero_localentry.
1944 (is_elfv2_localentry0): Test non_zero_localentry.
1945 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
1947 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1949 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
1950 pointer check for htab->elf.irelplt.
1951 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1953 2017-07-27 Nick Clifton <nickc@redhat.com>
1956 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
1958 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
1960 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
1962 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
1964 (evax_bfd_print_emh): Check for invalid string lengths.
1966 2017-07-25 Nick Clifton <nickc@redhat.com>
1968 * po/fr.po: Updated French translation.
1970 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
1973 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
1974 16-bit absolute branches into 10-bit pc-relative branches on the
1975 MSP430 as well as the MSP430X.
1977 2017-07-25 Alan Modra <amodra@gmail.com>
1979 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
1980 (stub_eh_frame_size): New function.
1981 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
1982 (group_sections): Init group tls_get_addr_opt_bctrl.
1983 (ppc64_elf_size_stubs): Update sizing and initialization of
1984 .eh_frame. Iteration over stubs via group list.
1985 (ppc64_elf_build_stubs): Iterate over stubs via group list.
1986 (ppc64_elf_finish_dynamic_sections): Update finalization of
1989 2017-07-24 Nick Clifton <nickc@redhat.com>
1992 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
1993 of the relocs to the canonicalize_one_reloc routine.
1994 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
1995 for the _bfd_mach_o_canonicalize_one_reloc field.
1996 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
1997 res_base parameter. Use to check for corrupt pair relocs.
1998 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
2000 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
2002 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
2005 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
2006 enough data in the record before attempting to parse it.
2007 (_bfd_vms_slurp_eeom): Likewise.
2009 (_bfd_vms_slurp_egsd): Check for an invalid section index.
2010 (image_set_ptr): Likewise.
2011 (alpha_vms_slurp_relocs): Likewise.
2013 (alpha_vms_object_p): Check for a truncated record.
2015 2017-07-24 Nick Clifton <nickc@redhat.com>
2018 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
2019 an unrecognized reloc and sets the bfd_error value.
2020 * libbfd.h: Regenerate.
2021 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
2023 * elf32-i386.c (elf_i386_relocate_section): Likewise.
2024 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2025 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2026 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
2027 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2029 2017-07-23 Alan Modra <amodra@gmail.com>
2031 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
2034 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
2037 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
2038 reloc_class_ifunc for ifunc symbols.
2040 2017-07-19 Nick Clifton <nickc@redhat.com>
2043 * archive.c (bfd_generic_archive_p): If the bfd does not have the
2044 correct magic bytes at the start, set the error to wrong format
2045 and clear the format selector before returning NULL.
2047 2017-07-19 Nick Clifton <nickc@redhat.com>
2050 * coff-rs6000.c (_bfd_strntol): New function.
2051 (_bfd_strntoll): New function.
2052 (GET_VALUE_IN_FIELD): New macro.
2053 (EQ_VALUE_IN_FIELD): new macro.
2054 (_bfd_xcoff_slurp_armap): Use new macros.
2055 (_bfd_xcoff_archive_p): Likewise.
2056 (_bfd_xcoff_read_ar_hdr): Likewise.
2057 (_bfd_xcoff_openr_next_archived_file): Likewise.
2058 (_bfd_xcoff_stat_arch_elt): Likewise.
2059 * coff64-rs6000.c (_bfd_strntol): New function.
2060 (_bfd_strntoll): New function.
2061 (GET_VALUE_IN_FIELD): New macro.
2062 (xcoff64_slurp_armap): Use new macros.
2064 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
2065 John Eric Martin <John.Martin@emmicro-us.com>
2067 * bfd-in2.h: Regenerate.
2068 * libbfd.h: Regenerate.
2069 * elf32-arc.c (JLI): Define.
2070 * reloc.c: Add JLI relocations.
2072 2017-07-18 Nick Clifton <nickc@redhat.com>
2075 * coff-sh.c: Fix spelling typos.
2076 * compress.c: Likewise.
2077 * cpu-pdp11.c: Likewise.
2078 * ecofflink.c: Likewise.
2079 * elf-m10300.c: Likewise.
2081 * elf32-arm.c: Likewise.
2082 * elf32-m68k.c: Likewise.
2083 * elf32-nds32.c: Likewise.
2084 * elf32-ppc.c: Likewise.
2085 * elf32-sh.c: Likewise.
2086 * elf32-v850.c: Likewise.
2087 * elf64-ppc.c: Likewise.
2088 * elf64-x86-64.c: Likewise.
2089 * elflink.c: Likewise.
2090 * elfnn-aarch64.c: Likewise.
2091 * elfxx-mips.c: Likewise.
2093 * sunos.c: Likewise.
2094 * vms-alpha.c: Likewise.
2095 * xcofflink.c: Likewise.
2097 2017-07-18 Nick Clifton <nickc@redhat.com>
2100 * coffcode.h (handle_COMDAT): Replace abort with an error message
2103 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2106 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
2109 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2111 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2113 2017-07-16 Alan Modra <amodra@gmail.com>
2115 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
2116 __tls_index GOT entries when using __tls_get_addr_opt stub.
2117 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2119 2017-07-12 Alan Modra <amodra@gmail.com>
2121 * po/es.po: Update from translationproject.org/latest/bfd/.
2122 * po/fi.po: Likewise.
2123 * po/fr.po: Likewise.
2124 * po/id.po: Likewise.
2125 * po/ja.po: Likewise.
2126 * po/ro.po: Likewise.
2127 * po/ru.po: Likewise.
2128 * po/sr.po: Likewise.
2129 * po/sv.po: Likewise.
2130 * po/tr.po: Likewise.
2131 * po/uk.po: Likewise.
2132 * po/vi.po: Likewise.
2133 * po/zh_CN.po: Likewise.
2134 * po/hr.po: New file from translationproject.org.
2135 * configure.ac (ALL_LINGUAS): Add hr. Sort.
2136 * configure: Regenerate.
2138 2017-07-12 Nick Clifton <nickc@redhat.com>
2140 Fix compile time warnings using gcc 7.1.1.
2141 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
2143 (elf_xtensa_get_gotplt_section): Increase length of got_name
2145 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
2146 default return of FALSE.
2147 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
2148 default return of FALSE.
2150 2017-07-12 Alan Modra <amodra@gmail.com>
2152 * binary.c (binary_set_section_contents): Don't print filepos in
2154 (coff_write_object_contents): Cast size_t for error message.
2155 (coff_slurp_line_table): Don't use bfd_vma symndx.
2156 (coff_slurp_reloc_table): Remove unneeded cast.
2157 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
2159 (find_abstract_instance_name): Likewise.
2160 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
2161 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
2162 (elf32_arm_check_relocs): Make r_symndx an int.
2163 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
2165 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
2167 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
2169 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
2170 * elf32-s390.c (elf_s390_check_relocs): Likewise.
2171 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
2172 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
2173 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2174 * elf64-s390.c (elf_s390_check_relocs): Likewise.
2175 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2176 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
2177 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2178 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
2179 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
2180 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
2181 and use %lu for error message.
2182 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
2183 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
2186 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
2188 (elf32_arm_final_link_relocate): Likewise.
2189 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
2190 * coffcode.h (styp_to_sec_flags): Likewise.
2191 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
2192 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
2193 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
2194 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
2195 (elf32_bfin_merge_private_bfd_data): Likewise.
2196 * elf32-cris.c (cris_elf_relocate_section): Likewise.
2197 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2198 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
2199 (i370_elf_relocate_section): Likewise.
2200 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
2201 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
2202 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
2203 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2204 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
2205 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
2206 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
2207 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
2208 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2209 * ieee.c (ieee_write_id, read_id): Likewise.
2210 * mach-o.c (bfd_mach_o_write_contents): Likewise.
2211 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
2212 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
2213 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
2214 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
2215 * stabs.c (_bfd_link_section_stabs): Likewise.
2217 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
2219 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2220 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2221 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
2222 * coff-sh.c (sh_relax_section): Likewise.
2223 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
2224 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2225 * coffcode.h (coff_slurp_reloc_table): Likewise.
2226 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2227 (_bfd_coff_read_string_table): Likewise.
2228 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
2229 * compress.c (bfd_get_full_section_contents): Likewise.
2230 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
2231 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2232 * elf.c (bfd_elf_string_from_elf_section): Likewise.
2233 * elf32-arc.c (arc_special_overflow_checks): Likewise.
2234 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
2235 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
2236 (elf32_arm_write_section): Likewise.
2237 * elf32-bfin.c (bfin_relocate_section): Likewise.
2238 (bfinfdpic_relocate_section): Likewise.
2239 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2240 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
2241 * elf32-i386.c (elf_i386_tls_transition): Likewise.
2242 (elf_i386_relocate_section): Likewise.
2243 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
2244 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
2245 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2246 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2247 * elf32-metag.c (elf_metag_relocate_section): Likewise.
2248 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
2249 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
2250 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
2251 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
2252 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
2253 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
2254 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
2255 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
2256 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
2257 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
2258 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
2259 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
2260 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
2261 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
2262 * elf32-sh.c (sh_elf_relax_section): Likewise.
2263 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
2264 (sh_elf_relocate_section): Likewise.
2265 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
2266 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2267 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2268 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2269 * elf32-v850.c (v850_elf_relax_section): Likewise.
2270 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2271 (elf_vax_relocate_section): Likewise.
2272 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2273 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2274 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2275 (do_fix_for_relocatable_link): Likewise.
2276 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2277 (elf64_alpha_relax_with_lituse): Likewise.
2278 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2279 (elf_hppa_final_link_relocate): Likewise.
2280 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2281 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2282 (elf64_vms_link_add_object_symbols): Likewise.
2283 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2284 (mmix_final_link_relocate): Likewise.
2285 * elf64-s390.c (invalid_tls_insn): Likewise.
2286 (elf_s390_relocate_section): Likewise.
2287 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2288 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2289 (elf_x86_64_relocate_section): Likewise.
2290 * elfcode.h (elf_slurp_symbol_table): Likewise.
2291 * elfcore.h (elf_core_file_p): Likewise.
2292 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2293 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2294 (elfNN_aarch64_relocate_section): Likewise.
2295 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2296 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2297 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2298 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2299 (_bfd_mips_elf_relocate_section): Likewise.
2300 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2301 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2302 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2303 * ieee.c (ieee_slurp_external_symbols): Likewise.
2304 * ihex.c (ihex_write_object_content): Likewise.
2305 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2306 * merge.c (_bfd_merged_section_offset): Likewise.
2307 * mmo.c (mmo_write_loc_chunk): Likewise.
2308 (mmo_write_object_contents): Likewise.
2309 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2310 * stabs.c (_bfd_link_section_stabs): Likewise.
2311 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2313 2017-07-11 Alan Modra <amodra@gmail.com>
2315 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2317 2017-07-11 Alan Modra <amodra@gmail.com>
2319 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2320 instruction" error using _bfd_error_handler, not einfo.
2322 2017-07-10 Nick Clifton <nickc@redhat.com>
2324 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2325 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2327 2017-07-07 John Baldwin <jhb@FreeBSD.org>
2329 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2331 2017-07-07 Alan Modra <amodra@gmail.com>
2333 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2335 2017-07-07 Alan Modra <amodra@gmail.com>
2337 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2338 as long long. Move code replacing "ll" with "I64", and simplify.
2340 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2342 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2345 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2347 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2349 (line_info_add_file_name): Likewise.
2350 (decode_line_info): Likewise.
2352 2017-07-04 Tristan Gingold <gingold@adacore.com>
2354 * version.m4: Bump version to 2.29.51
2355 * configure: Regenerate.
2357 2017-07-04 Jiong Wang <jiong.wang@arm.com>
2359 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2360 sanity check at the head of this function.
2362 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2364 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2365 dwarf_line_str_size.
2366 (struct attr_abbrev): Add field implicit_const.
2367 (dwarf_debug_sections): Add .debug_line_str.
2368 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2369 (dwarf_debug_section_assert): Add static assertion.
2370 (read_indirect_line_string): New.
2371 (read_abbrevs): Support DW_FORM_implicit_const.
2372 (is_str_attr): Support DW_FORM_line_strp.
2373 (read_attribute_value): Support DW_FORM_line_strp and
2374 DW_FORM_implicit_const.
2375 (read_attribute): Support DW_FORM_implicit_const.
2376 (line_info_add_include_dir, line_info_add_include_dir_stub):
2377 (line_info_add_file_name, read_formatted_entries): New.
2378 (decode_line_info, parse_comp_unit): Support DWARF 5.
2379 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2381 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2383 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2384 abort statement that was put for symbols that are not dynamic.
2386 2017-07-03 Tristan Gingold <gingold@adacore.com>
2388 * po/bfd.pot: Regenerate
2390 2017-07-03 Alan Modra <amodra@gmail.com>
2392 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2393 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
2394 * elf.c (setup_group): Use "Lx" to print sh_size.
2395 (_bfd_elf_setup_sections): Remove unnecessary cast and print
2396 unknown section type in hex.
2397 (copy_special_section_fields): Style fix.
2398 (bfd_section_from_shdr): Correct format for sh_link. Use a
2399 common error message for all the variants of unrecognized
2401 (assign_file_positions_for_load_sections): Use "Lx" for lma
2402 adjust error message.
2403 (assign_file_positions_for_non_load_sections): Formatting.
2404 (rewrite_elf_program_header): Formatting. Use "Lx" for
2405 bfd_vma values in error messages.
2406 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2407 ELF_R_SYM value to type expected by format.
2408 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2410 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2411 (elf_link_input_bfd): Use "Lx" for r_info.
2412 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2414 2017-07-03 Alan Modra <amodra@gmail.com>
2416 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2417 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2418 Microsoft C library variant of long long format specifier.
2419 (PRINT20): Cast value to bfd_uint64_t not long long.
2420 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2421 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2422 long long. Don't cast to bfd_vma.
2423 * elf32-score.c (score3_bfd_getl48): Likewise.
2424 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2426 2017-07-03 Alan Modra <amodra@gmail.com>
2428 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2430 (bfd_elf_print_symbol): Don't cast symbol->flags.
2431 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2432 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2433 _bfd_error_handler argument order.
2434 (ppc_elf_merge_private_bfd_data): Don't cast flags.
2436 2017-07-03 Alan Modra <amodra@gmail.com>
2438 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
2439 AC_TYPE_LONG_DOUBLE.
2440 * configure: Regenerate.
2441 * config.in: Regenerate.
2443 2017-06-29 Andrew Waterman <andrew@sifive.com>
2445 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2448 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2450 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2451 unless it is undefined weak.
2452 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2453 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2455 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2456 is not dynamic in PIC, abort.
2458 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2461 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2462 undefined weak symbols into dynamic.
2463 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2464 relocation for non-dynamic symbols.
2465 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2467 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2469 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2470 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2471 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2472 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2473 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2476 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
2478 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2479 (elfcore_write_s390_gs_bc): Likewise.
2480 * elf.c (elfcore_grok_s390_gs_cb): New function.
2481 (elfcore_grok_s390_gs_bc): New function.
2482 (elfcore_grok_note): Call them.
2483 (elfcore_write_s390_gs_cb): New function.
2484 (elfcore_write_s390_gs_bc): New function.
2485 (elfcore_write_register_note): Call them.
2487 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2489 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2490 bfd_get_file_size. Check archive element size.
2491 (_bfd_generic_get_section_contents_in_window): Likewise.
2493 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2495 * bfd-in2.h: Regenerated.
2496 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2497 (bfd_get_file_size): Likewise.
2499 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2500 Matthew Fortune <matthew.fortune@imgtec.com>
2502 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2503 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2504 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2505 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2507 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2508 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2509 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2510 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2511 `bfd_mach_mips_interaptiv_mr2' entries.
2512 * bfd-in2.h: Regenerate.
2514 2017-06-27 Nick Clifton <nickc@redhat.com>
2516 * tekhex.c (pass_over): Revert accidental conversion of a local
2517 array to a static array.
2519 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2522 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2523 reloc addend if necessary. Adjust diff only if
2524 shrinked_insn_address < end_address.
2526 2017-06-27 Alan Modra <amodra@gmail.com>
2529 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2530 (_bfd_generic_get_section_contents_in_window): Likewise.
2532 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2534 * elfnn-riscv.c (perform_relocation): Support the new
2535 R_RISCV_32_PCREL relocation.
2536 (riscv_elf_relocate_section): Likewise.
2537 * elfxx-riscv.c (howto_table): Likewise.
2538 (riscv_reloc_map): Likewise.
2539 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2540 * libbfd.h: Regenerate.
2542 2017-06-27 Alan Modra <amodra@gmail.com>
2545 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2546 Use unsigned file pointer type, and remove cast.
2547 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2548 Add "count", not "sz".
2550 2017-06-26 Pedro Alves <palves@redhat.com>
2553 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2556 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2559 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2562 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2564 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2565 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2566 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2567 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2568 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2570 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2573 * compress.c (bfd_get_full_section_contents): Don't check the
2575 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2576 reject a section whose size + offset is greater than the size
2578 (_bfd_generic_get_section_contents_in_window): Likewise.
2580 2017-06-26 Nick Clifton <nickc@redhat.com>
2583 * tekhex.c (getvalue): Check for the source pointer exceeding the
2584 end pointer before the first byte is read.
2586 2017-06-26 Nick Clifton <nickc@redhat.com>
2589 * opncls.c (get_build_id): Check that the section is big enough
2590 to contain the whole note.
2591 * compress.c (bfd_get_full_section_contents): Check for and reject
2592 a section whose size is greater than the size of the entire file.
2593 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2594 contain a notes section.
2596 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2598 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2600 (elf_s390_modify_segment_map): Likewise.
2601 (bfd_elf_s390_set_options): Lisewise.
2603 2017-06-26 Alan Modra <amodra@gmail.com>
2605 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2607 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2608 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2609 .preinit_array on --just-syms bfds.
2610 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2611 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2612 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2614 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2616 * elf.c (find_link): Bounds check "hint".
2618 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2620 * elf32-arm.c (using_thumb_only): Update list of architectures in
2621 BFD_ASSERT for which the logic is valid.
2622 (using_thumb2_bl): Likewise.
2623 (using_thumb2): Likewise and return true for ARMv8-R.
2624 (arch_has_arm_nop): Likewise.
2625 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2626 merging logic. Update commentis for value 15 of v8m_baseline,
2627 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2628 merging of value 15 of Tag_CPU_arch.
2630 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2632 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2633 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2634 * bfd-in2.h: Regenerate.
2636 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2638 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2639 the error_alignment label forward. Properly align program
2640 property note section.
2642 2017-06-22 Eric Christopher <echristo@gmail.com>
2644 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2645 abs to fix a truncation warning.
2647 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2649 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2650 local undefined weak symbol to 0.
2651 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2653 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2655 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2656 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2657 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2658 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2659 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2660 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2661 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2662 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2664 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2666 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2667 (elf_i386_lazy_ibt_plt_entry): Likewise.
2668 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2669 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2670 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2671 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2672 (elf_i386_lazy_plt_layout): Likewise.
2673 (elf_i386_non_lazy_plt_layout): Likewise.
2674 (elf_i386_link_hash_entry): Add plt_second.
2675 (elf_i386_link_hash_table): Add plt_second and
2676 plt_second_eh_frame.
2677 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2678 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2679 the second PLT. Check the second PLT.
2680 (elf_i386_relocate_section): Use the second PLT to resolve
2681 PLT reference if needed.
2682 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2684 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2685 second PLT. Generate unwind info for the second PLT.
2686 (elf_i386_plt_type): Add plt_second.
2687 (elf_i386_get_synthetic_symtab): Support the second PLT.
2688 (elf_i386_parse_gnu_properties): Support
2689 GNU_PROPERTY_X86_FEATURE_1_AND.
2690 (elf_i386_merge_gnu_properties): Support
2691 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2692 on GNU_PROPERTY_X86_FEATURE_1_IBT
2693 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2694 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2695 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2696 is set on all relocatable inputs.
2697 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2698 (elf_x32_lazy_ibt_plt_entry): Likewise.
2699 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2700 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2701 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2702 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2703 (elf_x86_64_lazy_ibt_plt): Likewise.
2704 (elf_x32_lazy_ibt_plt): Likewise.
2705 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2706 (elf_x32_non_lazy_ibt_plt): Likewise.
2707 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2708 (elf_x86_64_parse_gnu_properties): Support
2709 GNU_PROPERTY_X86_FEATURE_1_AND.
2710 (elf_x86_64_merge_gnu_properties): Support
2711 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2712 on GNU_PROPERTY_X86_FEATURE_1_IBT
2713 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2714 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2715 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2716 is set on all relocatable inputs.
2718 2017-06-22 Nick Clifton <nickc@redhat.com>
2721 * som.c (setup_sections): NUL terminate the space_strings buffer.
2722 Check that the space.name field does not index beyond the end of
2723 the space_strings buffer.
2725 2017-06-21 Nick Clifton <nickc@redhat.com>
2728 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2730 2017-06-21 Nick Clifton <nickc@redhat.com>
2733 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2734 type of the size parameter.
2735 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2736 length of the counted string.
2737 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2738 (_bfd_vms_save_counted_string): Likewise.
2739 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2740 _bfd_vms_save_counted_string.
2741 (_bfd_vms_slurp_ehdr): Likewise.
2742 (_bfd_vms_slurp_egsd): Likewise.
2743 (Parse_module): Likewise.
2745 2017-06-21 Alan Modra <amodra@gmail.com>
2747 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2748 calls before tocsave calls.
2749 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2752 2017-06-21 Nick Clifton <nickc@redhat.com>
2755 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2756 bfd_get_full_section_contents returns no contents.
2758 2017-06-21 Nick Clifton <nickc@redhat.com>
2761 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2764 2017-06-21 Nick Clifton <nickc@redhat.com>
2767 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2769 (image_set_ptr): Likewise.
2770 (alpha_vms_fix_sec_rel): Likewise.
2771 (alpha_vms_slurp_relocs): Likewise.
2773 2017-06-21 Nick Clifton <nickc@redhat.com>
2776 * ieee.c (ieee_slurp_sections): Check for a NULL return from
2778 (ieee_archive_p): Likewise.
2779 (ieee_object_p): Likewise.
2781 2017-06-21 Nick Clifton <nickc@redhat.com>
2784 * elf.c (setup_group): Zero the group section pointer list after
2785 allocation so that loops can be caught. Check for NULL pointers
2786 when processing a group list.
2788 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2790 * elf-s390.h: New file.
2791 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2793 (elf_s390_additional_program_headers): New function.
2794 (elf_s390_modify_segment_map): New function.
2795 (bfd_elf_s390_set_options): New function.
2796 (elf_backend_additional_program_headers)
2797 (elf_backend_modify_segment_map): Add macro definitions.
2799 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
2802 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
2803 the DYNAMIC bit instead of bfd_count_sections.
2805 2017-06-19 Nick Clifton <nickc@redhat.com>
2808 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
2810 (evax_bfd_print_eeom): Likewise.
2811 (evax_bfd_print_egsd): Check for an overlarge record length.
2812 (evax_bfd_print_etir): Likewise.
2814 2017-06-19 Nick Clifton <nickc@redhat.com>
2817 * libieee.h (struct common_header_type): Add end_p field.
2818 * ieee.c (this_byte_and_next): Do not advance input_p beyond
2820 (read_id): Check for a length that exceeds the remaining bytes in
2822 (ieee_seek): Initialise end_p.
2823 (ieee_archive_p): Likewise.
2824 (ieee_object_p): Likewise.
2826 2017-06-19 Nick Clifton <nickc@redhat.com>
2829 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
2830 before reading the EIHS structure entries.
2832 2017-06-19 Nick Clifton <nickc@redhat.com>
2835 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
2836 gsd_size. Check that there are enough bytes remaining to read the
2837 type and size of the next egsd. Check that the size of the egsd
2838 does not exceed the size of the record.
2840 2017-06-19 Alan Modra <amodra@gmail.com>
2842 * config.bfd: Correct targ_underscore for cris.
2844 2017-06-18 Alan Modra <amodra@gmail.com>
2846 * config.bfd: Correct targ_underscore for epiphany, ip2k,
2847 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
2849 2017-06-16 Nick Clifton <nickc@redhat.com>
2851 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
2852 bucketlist is empty because there are no symbols to add to the
2855 2017-06-16 Alan Modra <amodra@gmail.com>
2861 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
2862 (BFD_JUMP_TABLE_LINK): Likewise.
2863 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
2864 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
2865 (bfd_elf_define_start_stop): New function.
2866 * linker.c (bfd_generic_define_start_stop): New function.
2867 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
2869 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
2870 * aout-target.h (MY_bfd_define_start_stop): Define.
2871 * aout-tic30.c (MY_bfd_define_start_stop): Define.
2872 * binary.c (binary_bfd_define_start_stop): Define.
2873 * bout.c (b_out_bfd_define_start_stop): Define.
2874 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
2875 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
2876 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
2877 * coffcode.h (coff_bfd_define_start_stop): Define.
2878 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
2879 * i386msdos.c (msdos_bfd_define_start_stop): Define.
2880 * i386os9k.c (os9k_bfd_define_start_stop): Define.
2881 * ieee.c (ieee_bfd_define_start_stop): Define.
2882 * ihex.c (ihex_bfd_define_start_stop): Define.
2883 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
2884 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
2885 * mmo.c (mmo_bfd_define_start_stop): Define.
2886 * nlm-target.h (nlm_bfd_define_start_stop): Define.
2887 * oasys.c (oasys_bfd_define_start_stop): Define.
2888 * pef.c (bfd_pef_bfd_define_start_stop): Define.
2889 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
2890 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
2891 * som.c (som_bfd_define_start_stop): Define.
2892 * srec.c (srec_bfd_define_start_stop): Define.
2893 * tekhex.c (tekhex_bfd_define_start_stop): Define.
2894 * versados.c (versados_bfd_define_start_stop): Define.
2895 * vms-alpha.c (vms_bfd_define_start_stop): Define.
2896 (alpha_vms_bfd_define_start_stop): Define.
2897 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
2898 * bfd-in2.h: Regenerate.
2899 * libbfd.h: Regenerate.
2901 2017-06-16 Jiong Wang <jiong.wang@arm.com>
2903 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
2904 SYMBOL_REFERENCES_LOCAL.
2906 2017-06-15 Jiong Wang <jiong.wang@arm.com>
2909 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
2910 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
2911 runtime for if there needs copy relocation elimination.
2912 (need_copy_relocation_p): New function. Return true for symbol with
2913 pc-relative references and if it's against read-only sections.
2914 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
2915 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
2916 that are related with accessing external objects.
2917 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
2918 in elfNN_aarch64_check_relocs.
2920 2017-06-15 Nick Clifton <nickc@redhat.com>
2923 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
2926 (ieee_archive_p): Likewise.
2928 2017-06-15 Nick Clifton <nickc@redhat.com>
2931 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
2933 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
2935 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
2936 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
2937 keep both windowed and call0 ABI PLT definitions.
2938 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
2939 elf_xtensa_*_plt_entry endex.
2940 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
2942 2017-06-14 Nick Clifton <nickc@redhat.com>
2945 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
2948 2017-06-14 Nick Clifton <nickc@redhat.com>
2951 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
2952 maximum value for the ascic pointer. Check that name processing
2953 does not read beyond this value.
2954 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
2957 2017-06-14 Nick Clifton <nickc@redhat.com>
2960 * versados.c (versados_mkobject): Zero the allocated tdata structure.
2961 (process_otr): Check for an invalid offset in the otr structure.
2963 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
2965 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
2967 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
2973 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
2974 vtable field to a union.
2975 (_bfd_elf_is_start_stop): Removed.
2976 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
2977 __start_SECNAME and __stop_SECNAME symbols.
2978 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
2979 * elflink.c (_bfd_elf_is_start_stop): Removed.
2980 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
2981 _bfd_elf_is_start_stop.
2982 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
2983 __stop_SECNAME symbols. Updated.
2984 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2985 (bfd_elf_gc_record_vtinherit): Likewise.
2986 (bfd_elf_gc_record_vtentry): Likewise.
2988 2017-06-13 Nick Clifton <nickc@redhat.com>
2991 * elflink.c (elf_link_adjust_relocs): Generate an error when
2992 encountering a reloc against a symbol removed by garbage
2995 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
2997 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
2998 to merge_gnu_properties.
2999 * elf-properties.c (elf_merge_gnu_properties): Add struct
3000 bfd_link_info * and pass it to merge_gnu_properties.
3001 (elf_merge_gnu_property_list): Add struct bfd_link_info *
3002 and pass it to elf_merge_gnu_properties.
3003 (_bfd_elf_link_setup_gnu_properties): Pass info to
3004 elf_merge_gnu_property_list.
3005 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
3007 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
3009 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
3012 * binary.c (binary_set_section_contents): Scale lma by octets
3013 per byte to set filepos.
3015 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3017 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
3020 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3022 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
3025 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3027 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
3028 patched section contents for TLS IE reloc.
3029 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
3031 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3033 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
3034 RELOC_FOR_GLOBAL_SYMBOL macro.
3036 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3038 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
3041 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3043 * config/tc-arc.c (md_undefined_symbol): Changed.
3044 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
3046 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3048 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
3051 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3053 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
3054 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
3056 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3058 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
3061 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
3063 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
3064 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
3065 is non-zero. Add clarifying comments.
3067 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
3069 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
3070 name. Use local IFUNC symbol name string to report unsupported
3071 non-PIC call to IFUNC function.
3072 (elf_i386_relocate_section): Dump local IFUNC name with minfo
3073 when generating R_386_IRELATIVE relocation.
3074 (elf_i386_finish_dynamic_symbol): Likewise.
3075 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
3077 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
3078 when generating R_X86_64_IRELATIVE relocation.
3079 (elf_x86_64_finish_dynamic_symbol): Likewise.
3081 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3083 * elf.c (setup_group): Make sure BFD sections are created for all
3084 group sections in the input file when processing SHF_GROUP
3086 (bfd_section_from_shdr): Avoid duplicating logic already
3087 implemented in `setup_group'.
3089 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
3092 * peXXigen.c (pe_print_idata): Use the address of the first thunk
3093 if the hint address is zero.
3095 2017-06-06 James Clarke <jrtc27@jrtc27.com>
3098 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
3099 ELF_COMMON_DEF_P for common symbols.
3101 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
3103 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
3104 SEC_GROUP sections as SEC_EXCLUDE.
3105 (bfd_elf_set_group_contents): Replace use of abort with an assert.
3106 (assign_section_numbers): Use resolve_section_groups flag instead
3107 of relocatable link type.
3108 (_bfd_elf_init_private_section_data): Use resolve_section_groups
3109 flag instead of checking the final_link flag for part of the
3110 checks in here. Fix white space as a result.
3111 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
3112 instead of relocatable link type.
3113 (bfd_elf_final_link): Likewise.
3115 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3117 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
3119 * elf32-score.c (score_elf_final_link_relocate): Likewise.
3120 (s3_bfd_score_elf_check_relocs): Likewise.
3121 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3122 (score_elf_final_link_relocate): Likewise.
3123 (s7_bfd_score_elf_check_relocs): Likewise.
3125 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3127 * elflink.c (init_reloc_cookie_rels): Remove unused variable
3130 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
3132 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
3133 from `reloc_count' rather than decrementing it.
3134 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
3135 `reloc_count' by `int_rels_per_ext_rel'.
3136 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
3137 `reloc_count' by `int_rels_per_ext_rel' for last relocation
3138 entry determination.
3139 (s3_bfd_score_elf_check_relocs): Likewise.
3140 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
3141 (s7_bfd_score_elf_relocate_section): Likewise.
3142 (s7_bfd_score_elf_check_relocs): Likewise.
3143 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
3144 prototype and function.
3145 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
3146 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
3147 triple rather than once the sum of REL and RELA relocation entry
3149 (bfd_elf64_get_reloc_upper_bound): Remove macro.
3150 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
3151 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
3152 storage allocation size determination.
3153 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
3154 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
3155 by `int_rels_per_ext_rel' for last relocation entry
3157 (bfd_elf_final_link): Do not multiply `reloc_count' by
3158 `int_rels_per_ext_rel' for internal relocation storage
3159 allocation size determination.
3160 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
3161 `int_rels_per_ext_rel' for last relocation entry determination.
3162 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3163 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
3164 (_bfd_mips_elf_relocate_section): Likewise.
3166 2017-06-05 Alan Modra <amodra@gmail.com>
3169 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
3171 2017-06-01 John Baldwin <jhb@FreeBSD.org>
3173 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
3174 determine structure sizes.
3175 (elfcore_grok_freebsd_prstatus): Likewise.
3177 2017-06-01 Alan Modra <amodra@gmail.com>
3179 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
3180 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
3182 (is_elfv2_localentry0): New function.
3183 (ppc64_elf_tls_setup): Default params->plt_localentry0.
3184 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
3185 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
3186 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
3187 optimized localentry:0 stubs.
3188 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
3189 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
3191 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
3193 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3195 2017-05-30 Casey Smith <clegg89@gmail.com>
3198 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
3199 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
3201 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
3203 * cpu-arc.c (arc_compatible): New function.
3205 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
3207 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
3209 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
3212 * bfdio.c (bfd_get_file_size): New function.
3213 * bfd-in2.h: Regenerated.
3215 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
3217 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
3220 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
3222 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
3223 dynobj instead of htab->elf.dynobj.
3225 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
3227 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
3229 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
3230 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
3231 actual number of internal relocations retrieved. Adjust
3232 function description.
3233 (bfd_elf64_canonicalize_reloc): Remove macro.
3234 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
3236 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
3238 * archures.c (bfd_mach_sparc_v9m8): Define.
3239 (bfd_mach_sparc_v8plusm8): Likewise.
3240 (bfd_mach_sparc_v9_p): Adjust to M8.
3241 (bfd_mach_sparc_64bit_p): Likewise.
3242 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
3243 bfd_mach_sparc_v8plusm8.
3244 * bfd-in2.h: Regenerated.
3245 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
3247 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
3248 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
3249 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
3251 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3252 bfd_mach_sparc_v8plusm8.
3254 2017-05-19 Alan Modra <amodra@gmail.com>
3256 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
3257 debug and special sections when no non-note alloc sections in an
3260 2017-05-18 Alan Modra <amodra@gmail.com>
3262 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
3263 * elf-m10300.c: Likewise.
3265 * elf32-arc.c: Likewise.
3266 * elf32-bfin.c: Likewise.
3267 * elf32-m68k.c: Likewise.
3268 * elf32-nds32.c: Likewise.
3269 * elf32-tilepro.c: Likewise.
3270 * elflink.c: Likewise.
3271 * elfnn-aarch64.c: Likewise.
3272 * elfnn-riscv.c: Likewise.
3273 * elfxx-tilegx.c: Likewise.
3274 * mach-o.c: Likewise.
3275 * peXXigen.c: Likewise.
3276 * vms-alpha.c: Likewise.
3277 * vms-lib.c: Likewise.
3279 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3282 * elflink.c (elf_gc_mark_debug_section): New function.
3283 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3284 referenced by kept debug sections.
3286 2017-05-16 Alan Modra <amodra@gmail.com>
3288 * elf-m10300.c: Rename occurrences of non_ir_ref.
3289 * elf32-arm.c: Likewise.
3290 * elf32-bfin.c: Likewise.
3291 * elf32-cr16.c: Likewise.
3292 * elf32-cris.c: Likewise.
3293 * elf32-d10v.c: Likewise.
3294 * elf32-dlx.c: Likewise.
3295 * elf32-fr30.c: Likewise.
3296 * elf32-frv.c: Likewise.
3297 * elf32-hppa.c: Likewise.
3298 * elf32-i370.c: Likewise.
3299 * elf32-i386.c: Likewise.
3300 * elf32-iq2000.c: Likewise.
3301 * elf32-lm32.c: Likewise.
3302 * elf32-m32c.c: Likewise.
3303 * elf32-m32r.c: Likewise.
3304 * elf32-m68hc1x.c: Likewise.
3305 * elf32-m68k.c: Likewise.
3306 * elf32-mcore.c: Likewise.
3307 * elf32-metag.c: Likewise.
3308 * elf32-microblaze.c: Likewise.
3309 * elf32-moxie.c: Likewise.
3310 * elf32-msp430.c: Likewise.
3311 * elf32-mt.c: Likewise.
3312 * elf32-nios2.c: Likewise.
3313 * elf32-or1k.c: Likewise.
3314 * elf32-ppc.c: Likewise.
3315 * elf32-rl78.c: Likewise.
3316 * elf32-s390.c: Likewise.
3317 * elf32-score.c: Likewise.
3318 * elf32-score7.c: Likewise.
3319 * elf32-sh.c: Likewise.
3320 * elf32-tic6x.c: Likewise.
3321 * elf32-tilepro.c: Likewise.
3322 * elf32-v850.c: Likewise.
3323 * elf32-vax.c: Likewise.
3324 * elf32-xstormy16.c: Likewise.
3325 * elf32-xtensa.c: Likewise.
3326 * elf64-alpha.c: Likewise.
3327 * elf64-hppa.c: Likewise.
3328 * elf64-ia64-vms.c: Likewise.
3329 * elf64-mmix.c: Likewise.
3330 * elf64-ppc.c: Likewise.
3331 * elf64-s390.c: Likewise.
3332 * elf64-sh64.c: Likewise.
3333 * elf64-x86-64.c: Likewise.
3334 * elflink.c: Likewise.
3335 * elfnn-aarch64.c: Likewise.
3336 * elfnn-ia64.c: Likewise.
3337 * elfnn-riscv.c: Likewise.
3338 * elfxx-mips.c: Likewise.
3339 * elfxx-sparc.c: Likewise.
3340 * elfxx-tilegx.c: Likewise.
3341 * linker.c: Likewise.
3343 2017-05-16 Alan Modra <amodra@gmail.com>
3345 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3346 * elflink.c (elf_link_add_object_symbols): Update to use
3348 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3350 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3352 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3354 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3356 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3358 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3359 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3361 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3363 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3365 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3367 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3368 to plt_second/plt_second_eh_frame.
3369 (elf_x86_64_link_hash_newfunc): Updated.
3370 (elf_x86_64_allocate_dynrelocs): Likewise.
3371 (elf_x86_64_size_dynamic_sections): Likewise.
3372 (elf_x86_64_relocate_section): Likewise.
3373 (elf_x86_64_finish_dynamic_symbol): Likewise.
3374 (elf_x86_64_finish_dynamic_sections): Likewise.
3375 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3376 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3378 (elf_backend_setup_gnu_properties): Updated. Create the
3379 .plt.sec section instead of the .plt.sec section.
3381 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3383 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3384 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3385 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3387 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3389 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3390 (bfd_elf64_set_reloc): Define.
3391 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3393 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3395 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3396 (struct bfd_target): New field _bfd_set_reloc.
3397 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3398 * reloc.c (_bfd_generic_set_reloc): New function.
3399 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3400 * nlm-target.h (nlm_set_reloc): Likewise.
3401 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3402 * aout-tic30.c (MY_set_reloc): Likewise.
3403 * aout-target.h (MY_set_reloc): Likewise.
3404 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3405 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3406 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3407 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3408 * aout-adobe.c (aout_32_set_reloc): Likewise.
3409 * bout.c (b_out_set_reloc): Likewise.
3410 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3411 * i386os9k.c (aout_32_set_reloc): Likewise.
3412 * ieee.c (ieee_set_reloc): Likewise.
3413 * oasys.c (oasys_set_reloc): Likewise.
3414 * som.c (som_set_reloc): Likewise.
3415 * versados.c (versados_set_reloc): Likewise.
3416 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3417 _bfd_generic_set_reloc.
3418 (rs6000_xcoff64_aix_vec): LIkewise.
3419 * libbfd.c (_bfd_norelocs_set_reloc): New function.
3420 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3421 * i386msdos.c (msdos_set_reloc): Define to
3422 _bfd_norelocs_set_reloc.
3423 * elfcode.h (elf_set_reloc): Define.
3424 * bfd-in2.h: Regenerated.
3426 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
3429 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3430 for IFUNC function address.
3432 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
3434 * elf32-arc.c (FEATURE_LIST_NAME): Define.
3435 (CONFLICT_LIST): Likewise.
3436 (opcode/arc-attrs.h): Include.
3437 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3438 (arc_extract_features): New file.
3439 (arc_stralloc): Likewise.
3440 (arc_elf_merge_attributes): Likewise.
3441 (arc_elf_merge_private_bfd_data): Use object attributes.
3442 (bfd_arc_get_mach_from_attributes): New function.
3443 (arc_elf_object_p): Use object attributes.
3444 (arc_elf_final_write_processing): Likewise.
3445 (elf32_arc_obj_attrs_arg_type): New function.
3446 (elf32_arc_obj_attrs_handle_unknown): Likewise.
3447 (elf32_arc_section_from_shdr): Likewise.
3448 (elf_backend_obj_attrs_vendor): Define.
3449 (elf_backend_obj_attrs_section): Likewise.
3450 (elf_backend_obj_attrs_arg_type): Likewise.
3451 (elf_backend_obj_attrs_section_type): Likewise.
3452 (elf_backend_obj_attrs_handle_unknown): Likewise.
3453 (elf_backend_section_from_shdr): Likewise.
3455 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
3458 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3459 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3460 and the destination is a Thumb symbol.
3462 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3464 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3465 initializer to silence GCC 4.2.
3466 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3468 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3470 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3471 (LAZY_PLT_ENTRY_SIZE): This.
3472 (NON_LAZY_PLT_ENTRY_SIZE): New.
3473 (elf_x86_64_plt0_entry): Renamed to ...
3474 (elf_x86_64_lazy_plt0_entry): This.
3475 (elf_x86_64_plt_entry): Renamed to ...
3476 (elf_x86_64_lazy_plt_entry): This.
3477 (elf_x86_64_bnd_plt0_entry): Renamed to ...
3478 (elf_x86_64_lazy_bnd_plt0_entry): This.
3479 (elf_x86_64_legacy_plt_entry): Removed.
3480 (elf_x86_64_bnd_plt_entry): Renamed to ...
3481 (elf_x86_64_lazy_bnd_plt_entry): This.
3482 (elf_x86_64_legacy_plt2_entry): Renamed to ...
3483 (elf_x86_64_non_lazy_plt_entry): This.
3484 (elf_x86_64_bnd_plt2_entry): Renamed to ...
3485 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3486 (elf_x86_64_eh_frame_plt): Renamed to ...
3487 (elf_x86_64_eh_frame_lazy_plt): This.
3488 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3489 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3490 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3491 (elf_x86_64_eh_frame_non_lazy_plt): This.
3492 (elf_x86_64_lazy_plt_layout): New.
3493 (elf_x86_64_non_lazy_plt_layout): Likewise.
3494 (elf_x86_64_plt_layout): Likewise.
3495 (elf_x86_64_backend_data): Remove PLT layout information. Add
3496 os for target system.
3497 (GET_PLT_ENTRY_SIZE): Removed.
3498 (elf_x86_64_lazy_plt): New.
3499 (elf_x86_64_non_lazy_plt): Likewise.
3500 (elf_x86_64_lazy_bnd_plt): Likewise.
3501 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3502 (elf_x86-64_arch_bed): Updated.
3503 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3504 (elf_x86_64_create_dynamic_sections): Removed.
3505 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3506 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3507 (elf_x86-64_adjust_dynamic_symbol): Updated.
3508 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3509 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3510 size for PLT0 if there is no PLT0. Get plt_entry_size from
3511 non_lazy_plt for non-lazy PLT entries.
3512 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3513 from non_lazy_plt for non-lazy PLT entries.
3514 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3515 if there is no PLT0.
3516 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3517 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3518 entries with non-lazy PLT layout. Don't fill the second and third
3519 slots in the PLT entry if there is no PLT0.
3520 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3521 if there is no PLT0. Set sh_entsize on the .plt.got section.
3522 (compare_relocs): New.
3523 (elf_x86_64_plt_type): Likewise.
3524 (elf_x86_64_plt): Likewise.
3525 (elf_x86_64_nacl_plt): New. Forward declaration.
3526 (elf_x86_64_get_plt_sym_val): Removed.
3527 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3528 against all dynamic relocations.
3529 (elf_x86_64_link_setup_gnu_properties): New function.
3530 (elf_backend_create_dynamic_sections): Updated.
3531 (elf_backend_setup_gnu_properties): New.
3532 (elf_x86_64_nacl_plt): New.
3533 (elf_x86_64_nacl_arch_bed): Updated.
3535 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3537 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3538 (LAZY_PLT_ENTRY_SIZE): This.
3539 (NON_LAZY_PLT_ENTRY_SIZE): New.
3540 (elf_i386_plt0_entry): Renamed to ...
3541 (elf_i386_lazy_plt0_entry): This.
3542 (elf_i386_plt_entry): Renamed to ...
3543 (elf_i386_lazy_plt_entry): This.
3544 (elf_i386_pic_plt0_entry): Renamed to ...
3545 (elf_i386_pic_lazy_plt0_entry): This.
3546 (elf_i386_pic_plt_entry): Renamed to ...
3547 (elf_i386_pic_lazy_plt_entry): This.
3548 (elf_i386_got_plt_entry): Renamed to ...
3549 (elf_i386_non_lazy_plt_entry): This.
3550 (elf_i386_pic_got_plt_entry): Renamed to ...
3551 (elf_i386_pic_non_lazy_plt_entry): This.
3552 (elf_i386_eh_frame_plt): Renamed to ...
3553 (elf_i386_eh_frame_lazy_plt): This.
3554 (elf_i386_eh_frame_plt_got): Renamed to ...
3555 (elf_i386_eh_frame_non_lazy_plt): This.
3556 (elf_i386_plt_layout): Renamed to ...
3557 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3558 eh_frame_plt_got_size.
3559 (elf_i386_non_lazy_plt_layout): New.
3560 (elf_i386_plt_layout): Likewise.
3561 (elf_i386_non_lazy_plt): Likewise.
3562 (GET_PLT_ENTRY_SIZE): Removed.
3563 (elf_i386_plt): Renamed to ...
3564 (elf_i386_lazy_plt): This.
3565 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3566 (elf_i386_arch_bed): Updated.
3567 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3568 (elf_i386_create_dynamic_sections): Removed.
3569 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3570 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3571 (elf_i386_adjust_dynamic_symbol): Updated.
3572 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3573 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3574 size for PLT0 if there is no PLT0.
3575 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3576 output section is discarded only if GOT isn't empty.
3577 (elf_i386_relocate_section): Updated. Properly get PLT index
3578 if there is no PLT0.
3579 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3580 second and third slots in the PLT entry if there is no PLT0.
3581 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3582 if there is no PLT0. Set sh_entsize on the .plt.got section.
3583 (elf_i386_nacl_plt): Forward declaration.
3584 (elf_i386_get_plt_sym_val): Removed.
3585 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3586 against all dynamic relocations.
3587 (elf_i386_link_setup_gnu_properties): New function.
3588 (elf_backend_create_dynamic_sections): Updated.
3589 (elf_backend_setup_gnu_properties): New.
3590 (elf_i386_nacl_plt): Updated.
3591 (elf_i386_nacl_arch_bed): Likewise.
3592 (elf_i386_vxworks_arch_bed): Likewise.
3594 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3596 * elflink.c (elf_output_implib): Remove executable flag from import
3598 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3599 library is a relocatable object file.
3601 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3604 * elf32-avr.c (avr_should_move_sym): New function.
3605 (avr_should_reduce_sym_size): Likewise.
3606 (avr_should_increase_sym_size): Likewise.
3607 (elf32_avr_relax_delete_bytes): Adjust symbol values
3608 and sizes by calling new functions.
3610 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3612 * config.bfd (riscv32-*): Enable rv64.
3614 2017-05-02 Alan Modra <amodra@gmail.com>
3617 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3618 rather than h->root.type == bfd_link_hash_new.
3619 (bfd_elf_record_link_assignment): Similarly, call
3620 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3622 2017-04-29 Alan Modra <amodra@gmail.com>
3625 * reloc.c (reloc_offset_in_range): New function.
3626 (bfd_perform_relocation, bfd_install_relocation): Use it.
3627 (_bfd_final_link_relocate): Likewise.
3629 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3631 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3632 before using .plt.got.
3633 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3635 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3637 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3638 instead of "+=" to update 0.
3640 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3642 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3643 .plt.got section here.
3644 (elf_i386_check_relocs): Don't create the .plt.got section.
3645 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3646 the .plt.got and .plt.bnd sections here.
3647 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3650 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3652 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3654 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3655 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3656 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3657 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3660 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3662 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3664 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3665 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3666 the first relocatable ELF input with GNU properties.
3668 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3670 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3671 VxWorks for non-PIC.
3673 2017-04-27 Alan Modra <amodra@gmail.com>
3675 * elf-bfd.h (struct elf_backend_data): Make asection param of
3676 elf_backend_eh_frame_address_size const.
3677 (_bfd_elf_eh_frame_address_size): Likewise.
3678 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3679 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3680 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3681 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3682 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3683 (next_cie_fde_offset): Constify params.
3684 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3686 2017-04-27 Alan Modra <amodra@gmail.com>
3688 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3689 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3690 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3692 (offset_adjust): New function.
3693 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3694 (adjust_eh_frame_local_symbols): Likewise.
3695 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3696 after changing anything. Return true if anything changed.
3697 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3698 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3700 2017-04-27 Alan Modra <amodra@gmail.com>
3702 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3705 2017-04-27 Alan Modra <amodra@gmail.com>
3707 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3708 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3709 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3710 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3711 for undef and undefweak dyn_relocs.
3712 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3713 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3714 (allocate_got, allocate_dynrelocs): Likewise.
3715 (ppc64_elf_relocate_section): Likewise.
3717 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3719 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3720 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3721 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3722 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3724 2017-04-26 Nick Clifton <nickc@redhat.com>
3727 * reloc.c (bfd_perform_relocation): Check for a negative address
3730 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3733 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3735 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3736 (elf_backend_always_renumber_dynsyms): Define.
3737 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3738 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3739 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3740 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3742 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3744 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3746 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3747 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3748 sections have been created.
3750 2017-04-26 Nick Clifton <nickc@redhat.com>
3753 * compress.c (bfd_init_section_compress_status): Check the return
3754 value from bfd_malloc.
3756 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3758 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3759 no_finish_dynamic_symbol.
3760 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3762 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3763 weak symbol, don't make it dynamic.
3764 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3765 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3766 relocation for GOT reference.
3767 (elf_x86_64_finish_dynamic_symbol): Abort if
3768 no_finish_dynamic_symbol isn't 0.
3770 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3773 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3774 undefined weak symbol, don't make it dynamic.
3775 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3776 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3777 relocation for R_386_GOT32.
3779 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3782 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3784 2017-04-23 Alan Modra <amodra@gmail.com>
3787 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3788 * elf.c (lcomm_sym): New.
3789 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3790 * bfd-in2.h: Regenerate.
3792 2017-04-23 Alan Modra <amodra@gmail.com>
3795 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3796 parameters and comment.
3797 (_bfd_elf_get_reloc_section): Delete.
3798 (_bfd_elf_plt_get_reloc_section): Declare.
3799 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3800 New functions. Don't blindly skip over assumed .rel/.rela prefix.
3802 (_bfd_elf_get_reloc_section): ..here. Delete.
3803 (assign_section_numbers): Call elf_get_reloc_section.
3804 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
3805 * elfxx-target.h (elf_backend_get_reloc_section): Update.
3807 2017-04-23 Alan Modra <amodra@gmail.com>
3810 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
3813 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3816 * elf32-i386.c (elf_i386_link_hash_entry): Add
3817 no_finish_dynamic_symbol.
3818 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
3819 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
3820 symbol, don't make it dynamic in PIE.
3821 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
3822 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3823 relocation for R_386_GOT32
3824 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
3827 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3831 * elflink.c (elf_link_add_object_symbols): Require
3832 --no-dynamic-linker with -E/--dynamic-list when creating
3835 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3837 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
3840 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3842 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
3843 dynamic symbol sorting.
3845 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
3848 * elflink.c (elf_link_add_object_symbols): Preserve
3849 dynamic_ref_after_ir_def when restoring the symbol table for
3850 unneeded dynamic object.
3852 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
3855 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
3856 on on undefined IFUNC symbol in the second PLT.
3858 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
3860 * peXXigen.c (pe_print_reloc): Correct chunk_end.
3862 2017-04-19 Alan Modra <amodra@gmail.com>
3864 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
3865 or make dynamic for info->dynamic_undefined_weak 0 and 1.
3866 * elf32-ppc.c:Formatting.
3867 (ensure_undefweak_dynamic): Don't make dynamic when
3868 info->dynamic_undefined_weak is zero.
3869 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3870 info->dynamic_undefined_weak. Discard undef dyn_relocs when
3871 not default visibility. Discard undef and undefweak
3873 (ppc_elf_relocate_section): Adjust to suit.
3874 * elf64-ppc.c: Formatting.
3875 (ensure_undefweak_dynamic): Don't make dynamic when
3876 info->dynamic_undefined_weak is zero.
3877 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3878 info->dynamic_undefined_weak. Discard them earlier.
3880 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
3883 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
3884 before generating the version definition section.
3886 2017-04-17 Alan Modra <amodra@gmail.com>
3888 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
3889 state when a regular object file defines a symbol with
3890 incompatible type to that defined by an earlier shared lib.
3892 2017-04-13 Alan Modra <amodra@gmail.com>
3894 * coffcode.h: Wrap some overly long _bfd_error_handler args.
3896 * elf32-arm.c: Likewise.
3897 * elf32-i386.c: Likewise.
3898 * elf32-mep.c: Likewise.
3899 * elf64-ia64-vms.c: Likewise.
3900 * elf64-x86-64.c: Likewise.
3901 * elflink.c: Likewise.
3902 * elfnn-ia64.c: Likewise.
3903 * elfxx-mips.c: Likewise.
3905 2017-04-13 Alan Modra <amodra@gmail.com>
3907 * aoutx.h: Use %B and %A in error messages throughout file.
3908 * aout-cris.c: Likewise.
3909 * archive.c: Likewise.
3910 * binary.c: Likewise.
3911 * coff-rs6000.c: Likewise.
3912 * coff-tic4x.c: Likewise.
3913 * coffcode.h: Likewise.
3914 * coffgen.c: Likewise.
3915 * cofflink.c: Likewise.
3916 * coffswap.h: Likewise.
3917 * cpu-arm.c: Likewise.
3918 * elf-eh-frame.c: Likewise.
3919 * elf-m10300.c: Likewise.
3921 * elf32-arc.c: Likewise.
3922 * elf32-arm.c: Likewise.
3923 * elf32-bfin.c: Likewise.
3924 * elf32-frv.c: Likewise.
3925 * elf32-iq2000.c: Likewise.
3926 * elf32-m32c.c: Likewise.
3927 * elf32-microblaze.c: Likewise.
3928 * elf32-nds32.c: Likewise.
3929 * elf32-rl78.c: Likewise.
3930 * elf32-rx.c: Likewise.
3931 * elf32-score.c: Likewise.
3932 * elf32-score7.c: Likewise.
3933 * elf32-sh64.c: Likewise.
3934 * elf32-v850.c: Likewise.
3935 * elf32-vax.c: Likewise.
3936 * elf32-visium.c: Likewise.
3937 * elf64-ia64-vms.c: Likewise.
3938 * elf64-mmix.c: Likewise.
3939 * elf64-sh64.c: Likewise.
3940 * elfcode.h: Likewise.
3941 * elfnn-aarch64.c: Likewise.
3942 * elfnn-ia64.c: Likewise.
3943 * elfxx-mips.c: Likewise.
3944 * hpux-core.c: Likewise.
3947 * linker.c: Likewise.
3948 * merge.c: Likewise.
3950 * oasys.c: Likewise.
3951 * pdp11.c: Likewise.
3952 * peXXigen.c: Likewise.
3953 * rs6000-core.c: Likewise.
3954 * vms-alpha.c: Likewise.
3955 * xcofflink.c: Likewise.
3957 2017-04-13 Alan Modra <amodra@gmail.com>
3959 * bfd.c (PRINT_TYPE): Define.
3960 (_doprnt): New function.
3961 (error_handler_internal): Use _doprnt.
3962 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
3963 calls in their natural order, throughout file.
3964 * coff-mcore.c: Likewise.
3965 * coff-ppc.c: Likewise.
3966 * coff-tic80.c: Likewise.
3967 * cofflink.c: Likewise.
3968 * elf-s390-common.c: Likewise.
3970 * elf32-arm.c: Likewise.
3971 * elf32-i386.c: Likewise.
3972 * elf32-m32r.c: Likewise.
3973 * elf32-msp430.c: Likewise.
3974 * elf32-spu.c: Likewise.
3975 * elf64-ia64-vms.c: Likewise.
3976 * elf64-sparc.c: Likewise.
3977 * elf64-x86-64.c: Likewise.
3978 * elflink.c: Likewise.
3979 * elfnn-aarch64.c: Likewise.
3980 * elfnn-ia64.c: Likewise.
3981 * elfxx-mips.c: Likewise.
3983 2017-04-13 Alan Modra <amodra@gmail.com>
3985 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
3986 branch veneers" error. Fix double space and format message.
3987 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
3988 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
3990 2017-04-13 Alan Modra <amodra@gmail.com>
3992 * bfd-in2.h: Regenerate.
3994 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3996 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
3997 extra `\n' in warning/error messages.
3998 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
3999 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4001 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4003 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
4004 processor-specific properties with generic ELF target vector.
4006 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
4008 * elf32-sparc.c (elf_backend_fixup_symbol): New.
4009 * elf64-sparc.c (elf_backend_fixup_symbol): New.
4010 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
4011 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
4013 (link_hash_newfunc): Initialize has_got_reloc and
4015 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
4017 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
4019 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
4021 (_bfd_sparc_elf_fixup_symbol): New function.
4022 (allocate_dynrelocs): Don't allocate space for dynamic
4023 relocations and discard relocations against resolved undefined
4024 weak symbols in executable. Don't make resolved undefined weak
4025 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
4026 relocation against undefined weak symbols in PIE.
4027 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
4028 relocations against resolved undefined weak symbols in PIE
4029 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
4030 without ynamic PLT/GOT relocations for resolved undefined weak
4032 Don't generate dynamic relocation against resolved undefined
4033 weak symbol in executable.
4034 (pie_finish_undefweak_symbol): New function.
4035 (_bfd_sparc_elf_finish_dynamic_sections): Call
4036 pie_finish_undefweak_symbol on all symbols in PIE.
4037 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
4038 (_bfd_sparc_elf_fixup_symbol): New function.
4040 2017-04-10 Nick Clifton <nickc@redhat.com>
4042 * config.bfd: Remove ns32k from obsolete list.
4044 2017-04-10 Alan Modra <amodra@gmail.com>
4047 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
4048 (special_sections_i): Likewise for .init_array.
4049 (special_sections_p): Likewise for .preinit_array.
4051 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
4055 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
4056 ELF_COMMON_DEF_P for common symbols.
4057 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4058 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
4059 * elflink.c (_bfd_elf_merge_symbol): Revert commits
4060 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
4061 07492f668d2173da7a2bda3707ff0985e0f460b6.
4063 2017-04-07 Pedro Alves <palves@redhat.com>
4065 * opncls.c (bfd_get_debug_link_info): Rename to...
4066 (bfd_get_debug_link_info_1): ... this. Change type of second
4067 parameter to void pointer. Adjust.
4068 (bfd_get_debug_link_info): Reimplement on top of
4069 bfd_get_debug_link_info_1.
4070 (separate_debug_file_exists, separate_alt_debug_file_exists):
4071 Change type of second parameter to void pointer. Adjust.
4072 (get_func_type, check_func_type): Change type of second parameter
4074 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
4075 the callback functions instead of passing the address of a local.
4076 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
4077 find_separate_debug_file.
4078 (get_alt_debug_link_info_shim): Change type of second parameter to
4079 void pointer. Adjust.
4080 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
4081 find_separate_debug_file.
4082 (get_build_id_name, bfd_boolean check_build_id_file): Change type
4083 of second parameter to void pointer. Adjust.
4084 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
4085 pointer local to find_separate_debug_file.
4087 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
4089 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
4090 external symbols with a definition.
4091 (_bfd_coff_gc_mark_extra_sections): Fix typo.
4093 2017-04-07 Alan Modra <amodra@gmail.com>
4095 * po/SRC-POTFILES.in: Regenerate.
4097 2017-04-05 Alan Modra <amodra@gmail.com>
4099 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
4102 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
4104 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
4105 numbers for DataDirectory entry indicies passed to
4108 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
4110 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
4111 each GNU_MBIND section and align GNU_MBIND section to page size.
4112 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
4113 segment for each GNU_MBIND section.
4114 (_bfd_elf_init_private_section_data): Copy sh_info from input
4115 for GNU_MBIND section.
4117 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
4119 * elfnn-riscv.c (GP_NAME): Delete.
4120 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
4121 (_bfd_riscv_relax_lui): Likewise.
4123 2017-04-04 Nick Clifton <nickc@redhat.com>
4126 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
4128 (bfd_elf_final_link): Only initialize the extended symbol index
4129 section if there are extended symbol tables to list.
4131 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
4133 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
4134 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
4135 * configure.ac (elf): Add elf-properties.lo.
4136 * Makefile.in: Regenerated.
4137 * configure: Likewise.
4138 * elf-bfd.h (elf_property_kind): New.
4139 (elf_property): Likewise.
4140 (elf_property_list): Likewise.
4141 (elf_properties): Likewise.
4142 (_bfd_elf_parse_gnu_properties): Likewise.
4143 (_bfd_elf_get_property): Likewise.
4144 (_bfd_elf_link_setup_gnu_properties): Likewise.
4145 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
4146 and setup_gnu_properties.
4147 (elf_obj_tdata): Add properties.
4148 * elf-properties.c: New file.
4149 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
4150 (elf_i386_merge_gnu_properties): Likewise.
4151 (elf_backend_parse_gnu_properties): Likewise.
4152 (elf_backend_merge_gnu_properties): Likewise.
4153 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4154 (elf_x86_64_merge_gnu_properties): Likewise.
4155 (elf_backend_parse_gnu_properties): Likewise.
4156 (elf_backend_merge_gnu_properties): Likewise.
4157 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
4158 (elf_backend_parse_gnu_properties): Likewise.
4159 (elf_backend_setup_gnu_properties): Likewise.
4160 (elfNN_bed): Add elf_backend_parse_gnu_properties,
4161 elf_backend_merge_gnu_properties and
4162 elf_backend_setup_gnu_properties.
4164 2017-03-30 Pip Cet <pipcet@gmail.com>
4166 * elf32-wasm32.c: Add relocation code, two relocs.
4167 * reloc.c: Add wasm32 relocations.
4168 * libbfd.h: Regenerate.
4169 * bfd-in2.h: Regenerate.
4170 * bfd/po/bfd.pot: Regenerate.
4172 2017-03-29 Nick Clifton <nickc@redhat.com>
4175 * coff-bfd.h (struct coff_section_data): Add new fields:
4176 saved_bias and bias.
4177 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
4178 computed for PE binaries.
4179 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
4182 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
4185 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
4186 to handle a local symbol with a hash-symbol-entry; without PLT.
4187 Add BFD_ASSERT for an incidental case with GOT entry present.
4188 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
4189 isn't forced-or-set local.
4191 2017-03-27 Pip Cet <pipcet@gmail.com>
4193 * wasm-module.c: New file to support WebAssembly modules.
4194 * wasm-module.h: New file to support WebAssembly modules.
4195 * doc/webassembly.texi: Start documenting wasm-module.c.
4196 * config.bfd: Add wasm_vec.
4197 * targets.c: Likewise.
4198 * configure.ac: Likewise.
4199 * Makefile.am: Add entries for wasm-module.c.
4200 * Makefile.in: Regenerate.
4201 * configure: Regenerate.
4202 * po/SRC-POTFILES.in: Regenerate.
4204 2017-03-27 Pip Cet <pipcet@gmail.com>
4206 * cpu-wasm32.c: New file to support wasm32 architecture.
4207 * elf32-wasm32.c: New file to support wasm32 architecture.
4208 * Makefile.am: Add wasm32 architecture.
4209 * archures.c: Likewise.
4210 * config.bfd: Likewise.
4211 * configure.ac: Likewise.
4212 * targets.c: Likewise.
4213 * Makefile.in: Regenerate.
4214 * bfd-in2.h: Regenerate.
4215 * configure: Regenerate.
4216 * po/SRC-POTFILES.in: Regenerate.
4218 2017-03-20 Alan Modra <amodra@gmail.com>
4221 * elf64-ppc.c (compare_symbols): Stabilize sort.
4223 2017-03-18 Alan Modra <amodra@gmail.com>
4225 * elf64-ppc.c (struct ppc_link_hash_table): Add
4226 local_ifunc_resolver and maybe_local_ifunc_resolver.
4227 (ppc_build_one_stub): Set flags on emitting dynamic
4228 relocation to ifunc.
4229 (ppc64_elf_relocate_section): Likewise.
4230 (ppc64_elf_finish_dynamic_symbol): Likewise.
4231 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
4232 local dynamic relocs to ifuncs.
4233 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
4234 local_ifunc_resolver and maybe_local_ifunc_resolver.
4235 (ppc_elf_relocate_section): Set flag on emitting dynamic
4236 relocation to ifuncs.
4237 (ppc_elf_finish_dynamic_symbol): Likewise.
4238 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
4239 dynamic relocs to ifuncs.
4241 2017-03-13 Nick Clifton <nickc@redhat.com>
4244 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
4245 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
4246 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
4247 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
4248 * bfd-in2.h: Regenerate.
4249 * libbfd.h: Regenerate.
4250 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
4252 (IS_AARCH64_TLSDESC_RELOC): Likewise.
4253 (elfNN_aarch64_howto_table): Likewise.
4254 (aarch64_tls_transition_without_check): Likewise.
4255 (aarch64_reloc_got_type): Likewise.
4256 (elfNN_aarch64_final_link_relocate): Likewise.
4257 (elfNN_aarch64_tls_relax): Likewise.
4258 (elfNN_aarch64_relocate_section): Likewise.
4259 (elfNN_aarch64_gc_sweep_hook): Likewise.
4260 (elfNN_aarch64_check_relocs): Likewise.
4261 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4262 (_bfd_aarch64_elf_resolve_relocation): Likewise.
4264 2017-03-11 Alan Modra <amodra@gmail.com>
4266 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
4267 parameter is in fact used. Whitespace fixes.
4268 * elf64-ppc.c: Likewise.
4270 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4272 * rs6000-core.c (CORE_NEW): Simplify macro when
4273 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4275 2017-03-07 Alan Modra <amodra@gmail.com>
4279 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4282 2017-03-05 Alan Modra <amodra@gmail.com>
4284 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4285 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4286 (next_cie_fde_offset): New function.
4287 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4288 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4289 four bytes. Align CIEs to four or eight bytes depending on
4290 per_encoding_aligned8. Align FDEs according to their encoding.
4291 Pad last FDE to output section alignment.
4292 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4294 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4295 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4296 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4298 2017-03-02 Martin Bickel <binutils@ineranves.de>
4301 * elf.c (rewrite_elf_program_header): Do not issue a warning for
4302 empty segments which have a zero filesz, but a non-zero memsz.
4304 2017-03-02 Alan Modra <amodra@gmail.com>
4306 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4308 2017-02-28 Alan Modra <amodra@gmail.com>
4310 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4311 (ppc64_elf_relocate_section): Likewise.
4313 2017-02-28 Alan Modra <amodra@gmail.com>
4316 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4317 rather than elf32_nios2_hash_table or elf_hash_table.
4318 (create_got_section): Likewise.
4319 (nios2_elf32_finish_dynamic_symbol): Likewise.
4320 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4321 (nios2_elf32_size_dynamic_sections): Likewise.
4322 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4323 vars. Use htab equivalents directly instead. Don't create
4324 all dynamic sections on needing just the GOT. Use a goto
4325 rather than a fall-through with reloc test. Ensure
4326 htab->dynobj is set when making dynamic sreloc section.
4327 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4328 equivalent directly instead. Don't segfault on looking for
4329 .dynamic when dynamic sections have not been created. Don't
4330 segfault on .got.plt being discarded.
4331 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4332 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4333 fixme and another not so relevant comment.
4334 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4335 already set, set hash table dynobj on creating .sbss.
4337 2017-02-28 Alan Modra <amodra@gmail.com>
4339 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4340 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4341 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4342 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4343 (ppc64_elf_relocate_section): Likewise.
4344 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4345 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4346 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4347 * libbfd.h: Regenerate.
4348 * bfd-in2.h: Regenerate.
4350 2017-02-28 Alan Modra <amodra@gmail.com>
4352 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4353 dynamic .data.rel.ro read-only.
4354 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4355 rather than section flags when deciding where copy reloc goes.
4356 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4357 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4358 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4359 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4360 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4361 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4362 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4363 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4364 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4365 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4366 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4367 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4368 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4369 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4370 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4371 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4372 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4373 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4374 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4376 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4378 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4379 `jalr $0, $25' instruction encoding.
4381 2017-02-27 Nick Clifton <nickc@redhat.com>
4384 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4385 generating a seg-fault when encountering a symbol that has been
4386 deleted by garbage collection.
4388 2017-02-25 Alan Modra <amodra@gmail.com>
4390 * elf32-arc.c (struct dynamic_sections): Delete.
4391 (enum dyn_section_types): Delete.
4392 (dyn_section_names): Delete.
4393 (arc_create_dynamic_sections): Delete.
4394 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
4395 segfault on discarded .rela.plt section.
4396 (elf_arc_size_dynamic_sections): Formatting. Don't call
4397 arc_create_dynamic_sections. Don't allocate memory for sections
4398 handled by the generic linker. Correct code finding relocs in
4399 read-only sections. Set SEC_EXCLUDE on zero size .got,
4400 .got.plt, and .dynbss sections. Do set .interp for pies.
4402 2017-02-24 Andrew Waterman <andrew@sifive.com>
4404 * elfnn-riscv.c (GP_NAME): New macro.
4405 (riscv_global_pointer_value): Use it.
4406 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4407 output section, consider only that section's alignment.
4409 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4411 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4412 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4413 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4414 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4416 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4418 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4419 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4422 2017-02-23 Alan Modra <amodra@gmail.com>
4425 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4427 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4428 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4431 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
4434 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4435 processing ahead of the call to `elf_gc_sweep_symbol'.
4437 2017-02-22 Nick Clifton <nickc@redhat.com>
4440 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4441 created section 4-byte alignment.
4443 2017-02-22 Alan Modra <amodra@gmail.com>
4445 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4446 on .got or .plt output section being discarded by script.
4447 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
4450 2017-02-21 Alan Modra <amodra@gmail.com>
4452 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4453 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4455 2017-02-20 Alan Modra <amodra@gmail.com>
4458 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4459 if DT_RELSZ/DT_RELASZ is zero.
4461 2017-02-17 Nick Clifton <nickc@redhat.com>
4463 * compress.c (bfd_get_full_section_contents): Remember to reduce
4464 compressed size by the sizeof the compression header when
4465 decompressing the contents.
4467 2017-02-17 Pedro Alves <palves@redhat.com>
4469 * srec.c (Chunk): Rename to ...
4470 (_bfd_srec_len): ... this.
4471 (S3Forced): Rename to ...
4472 (_bfd_srec_forceS3): ... this.
4473 * objcopy.c: Adjust all references.
4475 2017-02-17 Pedro Alves <palves@redhat.com>
4477 * archive.c (bsd_write_armap): Rename to ...
4478 (_bfd_bsd_write_armap): ... this.
4479 (coff_write_armap): Rename to ...
4480 (_bfd_coff_write_armap): ... this.
4481 * libbfd-in.h (bsd_write_armap): Rename to ...
4482 (_bfd_bsd_write_armap): ... this.
4483 (coff_write_armap): Rename to ...
4484 (_bfd_coff_write_armap): ... this.
4485 * aout-target.h, aout-tic30.c: Adjust all users.
4486 * libbfd.h: Regenerate.
4488 2017-02-17 Pedro Alves <palves@redhat.com>
4490 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4491 (warn_deprecated): Rename to ...
4492 (_bfd_warn_deprecated): ... this.
4493 * libbfd.c (warn_deprecated): Rename to ...
4494 (_bfd_warn_deprecated): ... this.
4495 * bfd-in2.h: Regenerate.
4497 2017-02-17 Pedro Alves <palves@redhat.com>
4499 * bfdio.c (real_ftell): Rename to ...
4500 (_bfd_real_ftell): ... this.
4501 (real_fseek): Rename to ...
4502 (_bfd_real_fseek): ... this.
4503 (real_fopen): Rename to ...
4504 (_bfd_real_fopen): ... this.
4505 * libbfd-in.h (real_ftell): Rename to ...
4506 (_bfd_real_ftell): ... this.
4507 (real_fseek): Rename to ...
4508 (_bfd_real_fseek): ... this.
4509 (real_fopen): Rename to ...
4510 (_bfd_real_fopen): ... this.
4511 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4512 * libbfd.h: Regenerate.
4514 2017-02-17 Pedro Alves <palves@redhat.com>
4516 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4517 * libbfd.c (read_unsigned_leb128): Rename to ...
4518 (_bfd_read_unsigned_leb128): ... this.
4519 (read_signed_leb128): Rename to ...
4520 (_bfd_read_signed_leb128): ... this.
4521 (safe_read_leb128): Rename to ...
4522 (_bfd_safe_read_leb128): ... this.
4523 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4524 (_bfd_read_unsigned_leb128): ... this.
4525 (read_signed_leb128): Rename to ...
4526 (_bfd_read_signed_leb128): ... this.
4527 (safe_read_leb128): Rename to ...
4528 (_bfd_safe_read_leb128): ... this.
4529 * libbfd.h: Renegerate.
4531 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4533 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4534 before trying to fine matching file and line information.
4536 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4538 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4539 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4540 not match current bfd, then reload debug information. Record bfd
4541 we're loading debug info for in the stash. If we have debug
4542 informatin in the cache then perform section placement before
4545 2017-02-16 Alan Modra <amodra@gmail.com>
4548 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4549 * elfxx-target.h (elf_backend_no_page_alias): Define.
4550 (elfNN_bed): Init new field.
4551 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4552 ensure PT_LOAD segment starts on a new page.
4553 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4555 2017-02-16 Alan Modra <amodra@gmail.com>
4558 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4561 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4563 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4564 * bfd-in2.h: Regenerated.
4566 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4569 * elf32-i386.c (elf_i386_relocate_section): Allow
4570 "lea foo@GOT, %reg" in PIC.
4572 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4575 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4576 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4577 error against local IFUNC symbol without a base register for
4580 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4582 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4583 `%P: %H:' with `info->callbacks->einfo'.
4584 (ppc_elf_relocate_section): Likewise.
4585 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4586 (ppc64_elf_edit_toc): Likewise.
4587 (ppc64_elf_relocate_section): Likewise.
4589 2017-02-14 Alan Modra <amodra@gmail.com>
4591 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4592 --gc-keep-exported, and test versioned field of sym rather than
4593 looking for @ in name.
4595 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4597 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4600 2017-02-13 Nick Clifton <nickc@redhat.com>
4603 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4606 2017-02-07 Andrew Waterman <andrew@sifive.com>
4608 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4609 entry size if PLT header is written.
4611 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4613 Fix sparc64 dynamic relocation processing to use the dynamic
4615 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4616 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4619 2017-02-03 Nick Clifton <nickc@redhat.com>
4622 * coffcode.h (coff_write_object_contents): Enlarge size of
4623 s_name_buf in order to avoid compile time warning about possible
4625 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4626 32-bits of insn value before printing into buffer.
4628 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4630 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4631 `max_local_dynindx'.
4632 (mips_elf_sort_hash_table): Handle it.
4633 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4634 symbols bump up `max_local_dynindx' rather than
4635 `max_non_got_dynindx'.
4637 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4639 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4640 `min_got_dynindx', `max_unref_got_dynindx' and
4641 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4642 (mips_elf_sort_hash_table): Adjust accordingly.
4644 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4646 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4647 to access the hash table.
4649 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4651 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4652 non-NULL `htab' to the beginning.
4654 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4656 * elflink.c (elf_gc_sweep): Wrap overlong line.
4658 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4660 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4661 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4662 * elfxx-mips.c (mips_elf_link_hash_table): Add
4663 `ignore_branch_isa' member.
4664 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4665 in branch relocation calculation as an error if
4666 `ignore_branch_isa' has been set.
4667 (_bfd_mips_elf_insn32): Rename to...
4668 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4669 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4670 Handle the new parameter.
4672 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4674 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4675 local variable dynobj.
4678 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4679 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4680 executable from read-only sections into sdynrelro.
4681 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4682 dynamic relocs in sdynrelro.
4683 (elf_backend_want_dynrelro): Define.
4685 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4687 * config.bfd (*-*-rtemsaout*): Mark as removed.
4689 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4691 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4692 (arm-*-rtems*): Move to (arm*-*-eabi*).
4693 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4694 (m68-*-rtems*): Move to (m68*-*-elf*).
4696 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4698 * config.bfd (*-*-rtemscoff*): Mark as removed.
4700 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4703 * elflink.c (bfd_elf_record_link_assignment): Revert last
4704 change and don't ever clear `forced_local'. Set `mark'
4706 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4708 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4709 (bfd_elf_size_dynamic_sections): ... here.
4710 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4711 and set `mark' instead in `__tls_get_addr_opt' processing.
4712 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4714 2017-01-24 Alan Modra <amodra@gmail.com>
4716 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4717 where dynamic relocs are preferable. Allow ifunc too.
4718 (ensure_undefweak_dynamic): New function.
4719 (allocate_dynrelocs): Use it here. Move plt handling last and
4720 don't make symbols dynamic, simplifying loop. Only make undef
4721 weak symbols with GOT entries dynamic. Correct condition
4722 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4723 comments. Remove goto.
4724 (ppc_elf_relocate_section): Correct test for using dynamic
4725 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4726 to suit. Set up explicit tls_index entries and implicit GOT
4727 tls_index entries resolvable at link time for
4728 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4729 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4730 (ensure_undefweak_dynamic): New function.
4731 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4732 with GOT entries dynamic. Remove unnecessary test of
4733 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4734 (ppc64_elf_relocate_section): Correct test for using dynamic
4735 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4736 to suit. Set up explicit tls_index entries and implicit GOT
4737 tls_index entries resolvable at link time for __tls_get_addr_opt.
4738 Simplify expression to clear mem for prelink.
4740 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4742 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4744 2017-01-20 Jiong Wang <jiong.wang@arm.com>
4746 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4747 (elf_backend_hash_symbol): Define.
4749 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4752 * elflink.c (bfd_elf_record_link_assignment): Clear any
4753 `forced_local' marking for DSO symbols that are not being
4756 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4758 * elfnn-riscv.c (riscv_elf_object_p): New function.
4760 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4763 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4765 (elf_x86_64_check_relocs): Create .eh_frame section for the
4767 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4768 .eh_frame section for the .plt.bnd section.
4769 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4770 for the .plt.bnd section.
4772 2017-01-12 Nick Clifton <nickc@redhat.com>
4775 * opncls.c (find_separate_debug_file): Add include_dirs
4776 parameter. Only include the directory part of the bfd's filename
4777 in search paths if include_dirs is true. Add a couple of extra
4778 locations for looking for debug files.
4779 ( bfd_follow_gnu_debuglink): Update invocation of
4780 find_separate_debug_file.
4781 (bfd_follow_gnu_debugaltlink): Likewise.
4782 (get_build_id): New function: Finds the build-id of the given bfd.
4783 (get_build_id_name): New function: Computes the name of the
4784 separate debug info file for a bfd, based upon its build-id.
4785 (check_build_id_file): New function: Checks to see if a separate
4786 debug info file exists at the given location, and that its
4787 build-id matches that of the original bfd.
4788 (bfd_follow_build_id_debuglink): New function: Finds a separate
4789 debug info file for a given bfd by using the build-id method.
4790 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4791 method of locating a separate debug info file before using the
4793 * bfd-in2.h: Regenerate.
4795 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
4798 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4799 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4800 elf_x86_64_eh_frame_plt_got.
4801 (elf_x86_64_size_dynamic_sections): Get unwind info from
4802 elf_x86_64_bnd_arch_bed for the BND PLT.
4804 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
4806 * config.bfd: Add entries for i686-redox and x86_64-redox.
4808 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4810 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
4812 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
4813 .eh_frame section to 4 bytes for x32.
4814 (elf_x86_64_check_relocs): Likewise.
4816 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4819 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
4820 (PLT_GOT_FDE_LENGTH): Likewise.
4821 (elf_i386_plt_layout): Add eh_frame_plt_got and
4822 eh_frame_plt_got_size.
4823 (elf_i386_plt): Updated.
4824 (elf_i386_link_hash_table): Add plt_got_eh_frame.
4825 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
4826 (elf_i386_size_dynamic_sections): Allocate and initialize
4827 .eh_frame section for .plt.got.
4828 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
4830 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
4831 eh_frame_plt_got_size.
4832 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
4833 (PLT_GOT_FDE_LENGTH): Likewise.
4834 (elf_x86_64_backend_data): Add eh_frame_plt_got and
4835 eh_frame_plt_got_size.
4836 (elf_x86_64_arch_bed): Updated.
4837 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
4838 eh_frame_plt_got_size.
4839 (elf_x86_64_nacl_arch_bed): Likewise.
4840 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
4841 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
4842 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4843 .eh_frame section for .plt.got.
4844 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4847 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4849 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
4850 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
4852 2017-01-09 Nick Clifton <nickc@redhat.com>
4854 * dwarf2.c (lookup_address_in_function_table): Return early if
4855 there are no functions in the given comp unit, or if the high
4856 address of the last function in the comp unit is less than the
4859 2017-01-09 Nick Clifton <nickc@redhat.com>
4862 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
4863 message if there are too many symbols to load.
4865 2017-01-04 James Clarke <jrtc27@jrtc27.com>
4867 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
4868 if relocs are cached.
4870 2017-01-03 Rich Felker <bugdal@aerifal.cx>
4873 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
4874 for R_MICROBLAZE_GOTOFF_64.
4876 2017-01-03 Nick Clifton <nickc@redhat.com>
4878 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
4879 warning about using a possibly uninitialised variable.
4881 2017-01-02 Alan Modra <amodra@gmail.com>
4883 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
4884 (allocate_plt_static, allocate_dynrelocs): Use it.
4886 2017-01-02 Alan Modra <amodra@gmail.com>
4888 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
4889 .PARISC.unwind section.
4891 2017-01-02 Alan Modra <amodra@gmail.com>
4894 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
4895 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
4896 indirect to GOT pointer relative code edit.
4898 2017-01-02 Alan Modra <amodra@gmail.com>
4900 Update year range in copyright notice of all files.
4902 For older changes see ChangeLog-2016
4904 Copyright (C) 2017 Free Software Foundation, Inc.
4906 Copying and distribution of this file, with or without modification,
4907 are permitted in any medium without royalty provided the copyright
4908 notice and this notice are preserved.
4914 version-control: never