Update PO files
[binutils-gdb.git] / bfd / ChangeLog
1 2017-07-12 Alan Modra <amodra@gmail.com>
2
3 * po/es.po: Update from translationproject.org/latest/bfd/.
4 * po/fi.po: Likewise.
5 * po/fr.po: Likewise.
6 * po/id.po: Likewise.
7 * po/ja.po: Likewise.
8 * po/ro.po: Likewise.
9 * po/ru.po: Likewise.
10 * po/sr.po: Likewise.
11 * po/sv.po: Likewise.
12 * po/tr.po: Likewise.
13 * po/uk.po: Likewise.
14 * po/vi.po: Likewise.
15 * po/zh_CN.po: Likewise.
16 * po/hr.po: New file from translationproject.org.
17 * configure.ac (ALL_LINGUAS): Add hr. Sort.
18 * configure: Regenerate.
19
20 2017-07-12 Nick Clifton <nickc@redhat.com>
21
22 Fix compile time warnings using gcc 7.1.1.
23 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
24 plt_name buffer.
25 (elf_xtensa_get_gotplt_section): Increase length of got_name
26 buffer.
27 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
28 default return of FALSE.
29 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
30 default return of FALSE.
31
32 2017-07-12 Alan Modra <amodra@gmail.com>
33
34 * binary.c (binary_set_section_contents): Don't print filepos in
35 error message.
36 (coff_write_object_contents): Cast size_t for error message.
37 (coff_slurp_line_table): Don't use bfd_vma symndx.
38 (coff_slurp_reloc_table): Remove unneeded cast.
39 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
40 error message.
41 (find_abstract_instance_name): Likewise.
42 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
43 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
44 (elf32_arm_check_relocs): Make r_symndx an int.
45 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
46 format string.
47 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
48 message arg.
49 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
50 error message.
51 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
52 * elf32-s390.c (elf_s390_check_relocs): Likewise.
53 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
54 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
55 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
56 * elf64-s390.c (elf_s390_check_relocs): Likewise.
57 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
58 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
59 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
60 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
61 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
62 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
63 and use %lu for error message.
64 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
65 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
66 error message.
67
68 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
69 in error message.
70 (elf32_arm_final_link_relocate): Likewise.
71 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
72 * coffcode.h (styp_to_sec_flags): Likewise.
73 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
74 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
75 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
76 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
77 (elf32_bfin_merge_private_bfd_data): Likewise.
78 * elf32-cris.c (cris_elf_relocate_section): Likewise.
79 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
80 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
81 (i370_elf_relocate_section): Likewise.
82 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
83 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
84 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
85 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
86 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
87 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
88 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
89 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
90 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
91 * ieee.c (ieee_write_id, read_id): Likewise.
92 * mach-o.c (bfd_mach_o_write_contents): Likewise.
93 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
94 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
95 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
96 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
97 * stabs.c (_bfd_link_section_stabs): Likewise.
98
99 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
100 format.
101 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
102 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
103 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
104 * coff-sh.c (sh_relax_section): Likewise.
105 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
106 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
107 * coffcode.h (coff_slurp_reloc_table): Likewise.
108 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
109 (_bfd_coff_read_string_table): Likewise.
110 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
111 * compress.c (bfd_get_full_section_contents): Likewise.
112 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
113 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
114 * elf.c (bfd_elf_string_from_elf_section): Likewise.
115 * elf32-arc.c (arc_special_overflow_checks): Likewise.
116 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
117 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
118 (elf32_arm_write_section): Likewise.
119 * elf32-bfin.c (bfin_relocate_section): Likewise.
120 (bfinfdpic_relocate_section): Likewise.
121 * elf32-hppa.c (hppa_build_one_stub): Likewise.
122 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
123 * elf32-i386.c (elf_i386_tls_transition): Likewise.
124 (elf_i386_relocate_section): Likewise.
125 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
126 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
127 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
128 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
129 * elf32-metag.c (elf_metag_relocate_section): Likewise.
130 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
131 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
132 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
133 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
134 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
135 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
136 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
137 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
138 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
139 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
140 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
141 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
142 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
143 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
144 * elf32-sh.c (sh_elf_relax_section): Likewise.
145 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
146 (sh_elf_relocate_section): Likewise.
147 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
148 * elf32-spu.c (spu_elf_relocate_section): Likewise.
149 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
150 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
151 * elf32-v850.c (v850_elf_relax_section): Likewise.
152 * elf32-vax.c (elf_vax_check_relocs): Likewise.
153 (elf_vax_relocate_section): Likewise.
154 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
155 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
156 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
157 (do_fix_for_relocatable_link): Likewise.
158 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
159 (elf64_alpha_relax_with_lituse): Likewise.
160 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
161 (elf_hppa_final_link_relocate): Likewise.
162 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
163 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
164 (elf64_vms_link_add_object_symbols): Likewise.
165 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
166 (mmix_final_link_relocate): Likewise.
167 * elf64-s390.c (invalid_tls_insn): Likewise.
168 (elf_s390_relocate_section): Likewise.
169 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
170 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
171 (elf_x86_64_relocate_section): Likewise.
172 * elfcode.h (elf_slurp_symbol_table): Likewise.
173 * elfcore.h (elf_core_file_p): Likewise.
174 * elflink.c (elf_link_read_relocs_from_section): Likewise.
175 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
176 (elfNN_aarch64_relocate_section): Likewise.
177 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
178 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
179 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
180 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
181 (_bfd_mips_elf_relocate_section): Likewise.
182 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
183 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
184 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
185 * ieee.c (ieee_slurp_external_symbols): Likewise.
186 * ihex.c (ihex_write_object_content): Likewise.
187 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
188 * merge.c (_bfd_merged_section_offset): Likewise.
189 * mmo.c (mmo_write_loc_chunk): Likewise.
190 (mmo_write_object_contents): Likewise.
191 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
192 * stabs.c (_bfd_link_section_stabs): Likewise.
193 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
194
195 2017-07-11 Alan Modra <amodra@gmail.com>
196
197 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
198
199 2017-07-11 Alan Modra <amodra@gmail.com>
200
201 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
202 instruction" error using _bfd_error_handler, not einfo.
203
204 2017-07-10 Nick Clifton <nickc@redhat.com>
205
206 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
207 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
208
209 2017-07-07 John Baldwin <jhb@FreeBSD.org>
210
211 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
212
213 2017-07-07 Alan Modra <amodra@gmail.com>
214
215 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
216
217 2017-07-07 Alan Modra <amodra@gmail.com>
218
219 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
220 as long long. Move code replacing "ll" with "I64", and simplify.
221
222 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
223
224 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
225 to 1.
226
227 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
228
229 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
230 xtime.
231 (line_info_add_file_name): Likewise.
232 (decode_line_info): Likewise.
233
234 2017-07-04 Tristan Gingold <gingold@adacore.com>
235
236 * version.m4: Bump version to 2.29.51
237 * configure: Regenerate.
238
239 2017-07-04 Jiong Wang <jiong.wang@arm.com>
240
241 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
242 sanity check at the head of this function.
243
244 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
245
246 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
247 dwarf_line_str_size.
248 (struct attr_abbrev): Add field implicit_const.
249 (dwarf_debug_sections): Add .debug_line_str.
250 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
251 (dwarf_debug_section_assert): Add static assertion.
252 (read_indirect_line_string): New.
253 (read_abbrevs): Support DW_FORM_implicit_const.
254 (is_str_attr): Support DW_FORM_line_strp.
255 (read_attribute_value): Support DW_FORM_line_strp and
256 DW_FORM_implicit_const.
257 (read_attribute): Support DW_FORM_implicit_const.
258 (line_info_add_include_dir, line_info_add_include_dir_stub):
259 (line_info_add_file_name, read_formatted_entries): New.
260 (decode_line_info, parse_comp_unit): Support DWARF 5.
261 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
262
263 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
264
265 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
266 abort statement that was put for symbols that are not dynamic.
267
268 2017-07-03 Tristan Gingold <gingold@adacore.com>
269
270 * po/bfd.pot: Regenerate
271
272 2017-07-03 Alan Modra <amodra@gmail.com>
273
274 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
275 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
276 * elf.c (setup_group): Use "Lx" to print sh_size.
277 (_bfd_elf_setup_sections): Remove unnecessary cast and print
278 unknown section type in hex.
279 (copy_special_section_fields): Style fix.
280 (bfd_section_from_shdr): Correct format for sh_link. Use a
281 common error message for all the variants of unrecognized
282 section types.
283 (assign_file_positions_for_load_sections): Use "Lx" for lma
284 adjust error message.
285 (assign_file_positions_for_non_load_sections): Formatting.
286 (rewrite_elf_program_header): Formatting. Use "Lx" for
287 bfd_vma values in error messages.
288 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
289 ELF_R_SYM value to type expected by format.
290 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
291 in error messages.
292 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
293 (elf_link_input_bfd): Use "Lx" for r_info.
294 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
295
296 2017-07-03 Alan Modra <amodra@gmail.com>
297
298 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
299 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
300 Microsoft C library variant of long long format specifier.
301 (PRINT20): Cast value to bfd_uint64_t not long long.
302 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
303 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
304 long long. Don't cast to bfd_vma.
305 * elf32-score.c (score3_bfd_getl48): Likewise.
306 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
307
308 2017-07-03 Alan Modra <amodra@gmail.com>
309
310 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
311 print d_tag.
312 (bfd_elf_print_symbol): Don't cast symbol->flags.
313 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
314 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
315 _bfd_error_handler argument order.
316 (ppc_elf_merge_private_bfd_data): Don't cast flags.
317
318 2017-07-03 Alan Modra <amodra@gmail.com>
319
320 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
321 AC_TYPE_LONG_DOUBLE.
322 * configure: Regenerate.
323 * config.in: Regenerate.
324
325 2017-06-29 Andrew Waterman <andrew@sifive.com>
326
327 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
328 relocs.
329
330 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
331
332 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
333 unless it is undefined weak.
334 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
335 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
336 relocation.
337 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
338 is not dynamic in PIC, abort.
339
340 2017-06-29 Jiong Wang <jiong.wang@arm.com>
341
342 PR ld/21402
343 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
344 undefined weak symbols into dynamic.
345 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
346 relocation for non-dynamic symbols.
347 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
348
349 2017-06-29 Jiong Wang <jiong.wang@arm.com>
350
351 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
352 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
353 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
354 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
355 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
356 support for them.
357
358 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
359
360 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
361 (elfcore_write_s390_gs_bc): Likewise.
362 * elf.c (elfcore_grok_s390_gs_cb): New function.
363 (elfcore_grok_s390_gs_bc): New function.
364 (elfcore_grok_note): Call them.
365 (elfcore_write_s390_gs_cb): New function.
366 (elfcore_write_s390_gs_bc): New function.
367 (elfcore_write_register_note): Call them.
368
369 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
370
371 * libbfd.c (_bfd_generic_get_section_contents): Don't call
372 bfd_get_file_size. Check archive element size.
373 (_bfd_generic_get_section_contents_in_window): Likewise.
374
375 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
376
377 * bfd-in2.h: Regenerated.
378 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
379 (bfd_get_file_size): Likewise.
380
381 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
382 Matthew Fortune <matthew.fortune@imgtec.com>
383
384 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
385 * cpu-mips.c (I_interaptiv_mr2): New enum value.
386 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
387 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
388 case.
389 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
390 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
391 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
392 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
393 `bfd_mach_mips_interaptiv_mr2' entries.
394 * bfd-in2.h: Regenerate.
395
396 2017-06-27 Nick Clifton <nickc@redhat.com>
397
398 * tekhex.c (pass_over): Revert accidental conversion of a local
399 array to a static array.
400
401 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
402
403 PR ld/13402
404 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
405 reloc addend if necessary. Adjust diff only if
406 shrinked_insn_address < end_address.
407
408 2017-06-27 Alan Modra <amodra@gmail.com>
409
410 PR binutils/21665
411 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
412 (_bfd_generic_get_section_contents_in_window): Likewise.
413
414 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
415
416 * elfnn-riscv.c (perform_relocation): Support the new
417 R_RISCV_32_PCREL relocation.
418 (riscv_elf_relocate_section): Likewise.
419 * elfxx-riscv.c (howto_table): Likewise.
420 (riscv_reloc_map): Likewise.
421 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
422 * libbfd.h: Regenerate.
423
424 2017-06-27 Alan Modra <amodra@gmail.com>
425
426 PR binutils/21665
427 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
428 Use unsigned file pointer type, and remove cast.
429 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
430 Add "count", not "sz".
431
432 2017-06-26 Pedro Alves <palves@redhat.com>
433
434 PR binutils/21665
435 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
436 "sz".
437
438 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
439
440 PR binutils/21665
441 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
442 a missing line.
443
444 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
445
446 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
447 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
448 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
449 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
450 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
451
452 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
453
454 PR binutils/21665
455 * compress.c (bfd_get_full_section_contents): Don't check the
456 file size here.
457 * libbfd.c (_bfd_generic_get_section_contents): Check for and
458 reject a section whose size + offset is greater than the size
459 of the entire file.
460 (_bfd_generic_get_section_contents_in_window): Likewise.
461
462 2017-06-26 Nick Clifton <nickc@redhat.com>
463
464 PR binutils/21670
465 * tekhex.c (getvalue): Check for the source pointer exceeding the
466 end pointer before the first byte is read.
467
468 2017-06-26 Nick Clifton <nickc@redhat.com>
469
470 PR binutils/21665
471 * opncls.c (get_build_id): Check that the section is big enough
472 to contain the whole note.
473 * compress.c (bfd_get_full_section_contents): Check for and reject
474 a section whose size is greater than the size of the entire file.
475 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
476 contain a notes section.
477
478 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
479
480 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
481 pointer checks.
482 (elf_s390_modify_segment_map): Likewise.
483 (bfd_elf_s390_set_options): Lisewise.
484
485 2017-06-26 Alan Modra <amodra@gmail.com>
486
487 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
488 a --just-syms bfd.
489 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
490 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
491 .preinit_array on --just-syms bfds.
492 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
493 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
494 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
495
496 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
497
498 * elf.c (find_link): Bounds check "hint".
499
500 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
501
502 * elf32-arm.c (using_thumb_only): Update list of architectures in
503 BFD_ASSERT for which the logic is valid.
504 (using_thumb2_bl): Likewise.
505 (using_thumb2): Likewise and return true for ARMv8-R.
506 (arch_has_arm_nop): Likewise.
507 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
508 merging logic. Update commentis for value 15 of v8m_baseline,
509 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
510 merging of value 15 of Tag_CPU_arch.
511
512 2017-06-23 Jiong Wang <jiong.wang@arm.com>
513
514 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
515 BFD_RELOC_AARCH64_ADR_GOT_PAGE
516 * bfd-in2.h: Regenerate.
517
518 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
519
520 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
521 the error_alignment label forward. Properly align program
522 property note section.
523
524 2017-06-22 Eric Christopher <echristo@gmail.com>
525
526 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
527 abs to fix a truncation warning.
528
529 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
530
531 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
532 local undefined weak symbol to 0.
533 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
534
535 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
536
537 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
538 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
539 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
540 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
541 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
542 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
543 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
544 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
545
546 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
547
548 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
549 (elf_i386_lazy_ibt_plt_entry): Likewise.
550 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
551 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
552 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
553 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
554 (elf_i386_lazy_plt_layout): Likewise.
555 (elf_i386_non_lazy_plt_layout): Likewise.
556 (elf_i386_link_hash_entry): Add plt_second.
557 (elf_i386_link_hash_table): Add plt_second and
558 plt_second_eh_frame.
559 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
560 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
561 the second PLT. Check the second PLT.
562 (elf_i386_relocate_section): Use the second PLT to resolve
563 PLT reference if needed.
564 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
565 needed.
566 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
567 second PLT. Generate unwind info for the second PLT.
568 (elf_i386_plt_type): Add plt_second.
569 (elf_i386_get_synthetic_symtab): Support the second PLT.
570 (elf_i386_parse_gnu_properties): Support
571 GNU_PROPERTY_X86_FEATURE_1_AND.
572 (elf_i386_merge_gnu_properties): Support
573 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
574 on GNU_PROPERTY_X86_FEATURE_1_IBT
575 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
576 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
577 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
578 is set on all relocatable inputs.
579 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
580 (elf_x32_lazy_ibt_plt_entry): Likewise.
581 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
582 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
583 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
584 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
585 (elf_x86_64_lazy_ibt_plt): Likewise.
586 (elf_x32_lazy_ibt_plt): Likewise.
587 (elf_x86_64_non_lazy_ibt_plt): Likewise.
588 (elf_x32_non_lazy_ibt_plt): Likewise.
589 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
590 (elf_x86_64_parse_gnu_properties): Support
591 GNU_PROPERTY_X86_FEATURE_1_AND.
592 (elf_x86_64_merge_gnu_properties): Support
593 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
594 on GNU_PROPERTY_X86_FEATURE_1_IBT
595 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
596 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
597 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
598 is set on all relocatable inputs.
599
600 2017-06-22 Nick Clifton <nickc@redhat.com>
601
602 PR binutils/21649
603 * som.c (setup_sections): NUL terminate the space_strings buffer.
604 Check that the space.name field does not index beyond the end of
605 the space_strings buffer.
606
607 2017-06-21 Nick Clifton <nickc@redhat.com>
608
609 PR binutils/21646
610 * coff-sh.c (sh_reloc): Check for an out of range reloc.
611
612 2017-06-21 Nick Clifton <nickc@redhat.com>
613
614 PR binutils/21639
615 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
616 type of the size parameter.
617 (_bfd_vms_save_counted_string): Add second parameter - the maximum
618 length of the counted string.
619 * vms.h (_bfd_vms_save_sized_string): Update prototype.
620 (_bfd_vms_save_counted_string): Likewise.
621 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
622 _bfd_vms_save_counted_string.
623 (_bfd_vms_slurp_ehdr): Likewise.
624 (_bfd_vms_slurp_egsd): Likewise.
625 (Parse_module): Likewise.
626
627 2017-06-21 Alan Modra <amodra@gmail.com>
628
629 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
630 calls before tocsave calls.
631 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
632 following nop.
633
634 2017-06-21 Nick Clifton <nickc@redhat.com>
635
636 PR binutils/21645
637 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
638 bfd_get_full_section_contents returns no contents.
639
640 2017-06-21 Nick Clifton <nickc@redhat.com>
641
642 PR binutils/21638
643 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
644 record.
645
646 2017-06-21 Nick Clifton <nickc@redhat.com>
647
648 PR binutils/21637
649 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
650 list.
651 (image_set_ptr): Likewise.
652 (alpha_vms_fix_sec_rel): Likewise.
653 (alpha_vms_slurp_relocs): Likewise.
654
655 2017-06-21 Nick Clifton <nickc@redhat.com>
656
657 PR binutils/21633
658 * ieee.c (ieee_slurp_sections): Check for a NULL return from
659 read_id.
660 (ieee_archive_p): Likewise.
661 (ieee_object_p): Likewise.
662
663 2017-06-21 Nick Clifton <nickc@redhat.com>
664
665 PR binutils/21640
666 * elf.c (setup_group): Zero the group section pointer list after
667 allocation so that loops can be caught. Check for NULL pointers
668 when processing a group list.
669
670 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
671
672 * elf-s390.h: New file.
673 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
674 field.
675 (elf_s390_additional_program_headers): New function.
676 (elf_s390_modify_segment_map): New function.
677 (bfd_elf_s390_set_options): New function.
678 (elf_backend_additional_program_headers)
679 (elf_backend_modify_segment_map): Add macro definitions.
680
681 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
682
683 PR ld/21626
684 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
685 the DYNAMIC bit instead of bfd_count_sections.
686
687 2017-06-19 Nick Clifton <nickc@redhat.com>
688
689 PR binutils/21618
690 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
691 length.
692 (evax_bfd_print_eeom): Likewise.
693 (evax_bfd_print_egsd): Check for an overlarge record length.
694 (evax_bfd_print_etir): Likewise.
695
696 2017-06-19 Nick Clifton <nickc@redhat.com>
697
698 PR binutils/21612
699 * libieee.h (struct common_header_type): Add end_p field.
700 * ieee.c (this_byte_and_next): Do not advance input_p beyond
701 end_p.
702 (read_id): Check for a length that exceeds the remaining bytes in
703 the input buffer.
704 (ieee_seek): Initialise end_p.
705 (ieee_archive_p): Likewise.
706 (ieee_object_p): Likewise.
707
708 2017-06-19 Nick Clifton <nickc@redhat.com>
709
710 PR binutils/21611
711 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
712 before reading the EIHS structure entries.
713
714 2017-06-19 Nick Clifton <nickc@redhat.com>
715
716 PR binutils/21615
717 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
718 gsd_size. Check that there are enough bytes remaining to read the
719 type and size of the next egsd. Check that the size of the egsd
720 does not exceed the size of the record.
721
722 2017-06-19 Alan Modra <amodra@gmail.com>
723
724 * config.bfd: Correct targ_underscore for cris.
725
726 2017-06-18 Alan Modra <amodra@gmail.com>
727
728 * config.bfd: Correct targ_underscore for epiphany, ip2k,
729 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
730
731 2017-06-16 Nick Clifton <nickc@redhat.com>
732
733 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
734 bucketlist is empty because there are no symbols to add to the
735 list.
736
737 2017-06-16 Alan Modra <amodra@gmail.com>
738
739 PR ld/20022
740 PR ld/21557
741 PR ld/21562
742 PR ld/21571
743 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
744 (BFD_JUMP_TABLE_LINK): Likewise.
745 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
746 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
747 (bfd_elf_define_start_stop): New function.
748 * linker.c (bfd_generic_define_start_stop): New function.
749 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
750 new field.
751 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
752 * aout-target.h (MY_bfd_define_start_stop): Define.
753 * aout-tic30.c (MY_bfd_define_start_stop): Define.
754 * binary.c (binary_bfd_define_start_stop): Define.
755 * bout.c (b_out_bfd_define_start_stop): Define.
756 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
757 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
758 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
759 * coffcode.h (coff_bfd_define_start_stop): Define.
760 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
761 * i386msdos.c (msdos_bfd_define_start_stop): Define.
762 * i386os9k.c (os9k_bfd_define_start_stop): Define.
763 * ieee.c (ieee_bfd_define_start_stop): Define.
764 * ihex.c (ihex_bfd_define_start_stop): Define.
765 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
766 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
767 * mmo.c (mmo_bfd_define_start_stop): Define.
768 * nlm-target.h (nlm_bfd_define_start_stop): Define.
769 * oasys.c (oasys_bfd_define_start_stop): Define.
770 * pef.c (bfd_pef_bfd_define_start_stop): Define.
771 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
772 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
773 * som.c (som_bfd_define_start_stop): Define.
774 * srec.c (srec_bfd_define_start_stop): Define.
775 * tekhex.c (tekhex_bfd_define_start_stop): Define.
776 * versados.c (versados_bfd_define_start_stop): Define.
777 * vms-alpha.c (vms_bfd_define_start_stop): Define.
778 (alpha_vms_bfd_define_start_stop): Define.
779 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
780 * bfd-in2.h: Regenerate.
781 * libbfd.h: Regenerate.
782
783 2017-06-16 Jiong Wang <jiong.wang@arm.com>
784
785 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
786 SYMBOL_REFERENCES_LOCAL.
787
788 2017-06-15 Jiong Wang <jiong.wang@arm.com>
789
790 PR ld/21532
791 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
792 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
793 runtime for if there needs copy relocation elimination.
794 (need_copy_relocation_p): New function. Return true for symbol with
795 pc-relative references and if it's against read-only sections.
796 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
797 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
798 that are related with accessing external objects.
799 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
800 in elfNN_aarch64_check_relocs.
801
802 2017-06-15 Nick Clifton <nickc@redhat.com>
803
804 PR binutils/21582
805 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
806 bugs.
807 PR binutils/21581
808 (ieee_archive_p): Likewise.
809
810 2017-06-15 Nick Clifton <nickc@redhat.com>
811
812 PR binutils/21579
813 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
814
815 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
816
817 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
818 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
819 keep both windowed and call0 ABI PLT definitions.
820 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
821 elf_xtensa_*_plt_entry endex.
822 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
823
824 2017-06-14 Nick Clifton <nickc@redhat.com>
825
826 PR binutils/21578
827 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
828 flag value.
829
830 2017-06-14 Nick Clifton <nickc@redhat.com>
831
832 PR binutils/21589
833 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
834 maximum value for the ascic pointer. Check that name processing
835 does not read beyond this value.
836 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
837 end of etir record.
838
839 2017-06-14 Nick Clifton <nickc@redhat.com>
840
841 PR binutils/21591
842 * versados.c (versados_mkobject): Zero the allocated tdata structure.
843 (process_otr): Check for an invalid offset in the otr structure.
844
845 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
846
847 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
848
849 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
850
851 PR ld/20022
852 PR ld/21557
853 PR ld/21562
854 PR ld/21571
855 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
856 vtable field to a union.
857 (_bfd_elf_is_start_stop): Removed.
858 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
859 __start_SECNAME and __stop_SECNAME symbols.
860 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
861 * elflink.c (_bfd_elf_is_start_stop): Removed.
862 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
863 _bfd_elf_is_start_stop.
864 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
865 __stop_SECNAME symbols. Updated.
866 (elf_gc_smash_unused_vtentry_relocs): Likewise.
867 (bfd_elf_gc_record_vtinherit): Likewise.
868 (bfd_elf_gc_record_vtentry): Likewise.
869
870 2017-06-13 Nick Clifton <nickc@redhat.com>
871
872 PR ld/21524
873 * elflink.c (elf_link_adjust_relocs): Generate an error when
874 encountering a reloc against a symbol removed by garbage
875 collection.
876
877 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
878
879 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
880 to merge_gnu_properties.
881 * elf-properties.c (elf_merge_gnu_properties): Add struct
882 bfd_link_info * and pass it to merge_gnu_properties.
883 (elf_merge_gnu_property_list): Add struct bfd_link_info *
884 and pass it to elf_merge_gnu_properties.
885 (_bfd_elf_link_setup_gnu_properties): Pass info to
886 elf_merge_gnu_property_list.
887 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
888 bfd_link_info *.
889 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
890
891 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
892
893 PR 21564
894 * binary.c (binary_set_section_contents): Scale lma by octets
895 per byte to set filepos.
896
897 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
898
899 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
900 dynamic sections.
901
902 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
903
904 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
905 require TEXTREL.
906
907 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
908
909 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
910 patched section contents for TLS IE reloc.
911 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
912
913 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
914
915 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
916 RELOC_FOR_GLOBAL_SYMBOL macro.
917
918 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
919
920 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
921 changes.
922
923 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
924
925 * config/tc-arc.c (md_undefined_symbol): Changed.
926 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
927
928 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
929
930 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
931 symbols.
932
933 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
934
935 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
936 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
937
938 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
939
940 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
941 object is created.
942
943 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
944
945 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
946 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
947 is non-zero. Add clarifying comments.
948
949 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
950
951 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
952 name. Use local IFUNC symbol name string to report unsupported
953 non-PIC call to IFUNC function.
954 (elf_i386_relocate_section): Dump local IFUNC name with minfo
955 when generating R_386_IRELATIVE relocation.
956 (elf_i386_finish_dynamic_symbol): Likewise.
957 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
958 IFUNC symbol name.
959 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
960 when generating R_X86_64_IRELATIVE relocation.
961 (elf_x86_64_finish_dynamic_symbol): Likewise.
962
963 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
964
965 * elf.c (setup_group): Make sure BFD sections are created for all
966 group sections in the input file when processing SHF_GROUP
967 sections.
968 (bfd_section_from_shdr): Avoid duplicating logic already
969 implemented in `setup_group'.
970
971 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
972
973 PR binutils/21546
974 * peXXigen.c (pe_print_idata): Use the address of the first thunk
975 if the hint address is zero.
976
977 2017-06-06 James Clarke <jrtc27@jrtc27.com>
978
979 PR ld/19579
980 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
981 ELF_COMMON_DEF_P for common symbols.
982
983 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
984
985 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
986 SEC_GROUP sections as SEC_EXCLUDE.
987 (bfd_elf_set_group_contents): Replace use of abort with an assert.
988 (assign_section_numbers): Use resolve_section_groups flag instead
989 of relocatable link type.
990 (_bfd_elf_init_private_section_data): Use resolve_section_groups
991 flag instead of checking the final_link flag for part of the
992 checks in here. Fix white space as a result.
993 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
994 instead of relocatable link type.
995 (bfd_elf_final_link): Likewise.
996
997 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
998
999 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
1000 variable `bed'.
1001 * elf32-score.c (score_elf_final_link_relocate): Likewise.
1002 (s3_bfd_score_elf_check_relocs): Likewise.
1003 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1004 (score_elf_final_link_relocate): Likewise.
1005 (s7_bfd_score_elf_check_relocs): Likewise.
1006
1007 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1008
1009 * elflink.c (init_reloc_cookie_rels): Remove unused variable
1010 `bed'.
1011
1012 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
1013
1014 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
1015 from `reloc_count' rather than decrementing it.
1016 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
1017 `reloc_count' by `int_rels_per_ext_rel'.
1018 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
1019 `reloc_count' by `int_rels_per_ext_rel' for last relocation
1020 entry determination.
1021 (s3_bfd_score_elf_check_relocs): Likewise.
1022 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
1023 (s7_bfd_score_elf_relocate_section): Likewise.
1024 (s7_bfd_score_elf_check_relocs): Likewise.
1025 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
1026 prototype and function.
1027 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
1028 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
1029 triple rather than once the sum of REL and RELA relocation entry
1030 counts.
1031 (bfd_elf64_get_reloc_upper_bound): Remove macro.
1032 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
1033 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
1034 storage allocation size determination.
1035 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
1036 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
1037 by `int_rels_per_ext_rel' for last relocation entry
1038 determination.
1039 (bfd_elf_final_link): Do not multiply `reloc_count' by
1040 `int_rels_per_ext_rel' for internal relocation storage
1041 allocation size determination.
1042 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
1043 `int_rels_per_ext_rel' for last relocation entry determination.
1044 (elf_gc_smash_unused_vtentry_relocs): Likewise.
1045 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1046 (_bfd_mips_elf_relocate_section): Likewise.
1047
1048 2017-06-05 Alan Modra <amodra@gmail.com>
1049
1050 PR 21529
1051 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
1052
1053 2017-06-01 John Baldwin <jhb@FreeBSD.org>
1054
1055 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
1056 determine structure sizes.
1057 (elfcore_grok_freebsd_prstatus): Likewise.
1058
1059 2017-06-01 Alan Modra <amodra@gmail.com>
1060
1061 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
1062 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
1063 dynamic objects.
1064 (is_elfv2_localentry0): New function.
1065 (ppc64_elf_tls_setup): Default params->plt_localentry0.
1066 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
1067 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
1068 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
1069 optimized localentry:0 stubs.
1070 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
1071 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
1072 localentry:0 stubs.
1073 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
1074 DT_PPC64_OPT.
1075 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
1076
1077 2017-05-30 Casey Smith <clegg89@gmail.com>
1078
1079 PR ld/21523
1080 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
1081 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
1082
1083 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
1084
1085 * cpu-arc.c (arc_compatible): New function.
1086
1087 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
1088
1089 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
1090
1091 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
1092
1093 PR binutils/21519
1094 * bfdio.c (bfd_get_file_size): New function.
1095 * bfd-in2.h: Regenerated.
1096
1097 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
1098
1099 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
1100 comments.
1101
1102 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
1103
1104 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
1105 dynobj instead of htab->elf.dynobj.
1106
1107 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
1108
1109 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
1110 and function.
1111 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
1112 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
1113 actual number of internal relocations retrieved. Adjust
1114 function description.
1115 (bfd_elf64_canonicalize_reloc): Remove macro.
1116 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
1117
1118 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
1119
1120 * archures.c (bfd_mach_sparc_v9m8): Define.
1121 (bfd_mach_sparc_v8plusm8): Likewise.
1122 (bfd_mach_sparc_v9_p): Adjust to M8.
1123 (bfd_mach_sparc_64bit_p): Likewise.
1124 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
1125 bfd_mach_sparc_v8plusm8.
1126 * bfd-in2.h: Regenerated.
1127 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
1128 sparc:v8plusm8.
1129 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
1130 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
1131 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
1132 SHA3.
1133 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
1134 bfd_mach_sparc_v8plusm8.
1135
1136 2017-05-19 Alan Modra <amodra@gmail.com>
1137
1138 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
1139 debug and special sections when no non-note alloc sections in an
1140 object are kept.
1141
1142 2017-05-18 Alan Modra <amodra@gmail.com>
1143
1144 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
1145 * elf-m10300.c: Likewise.
1146 * elf.c: Likewise.
1147 * elf32-arc.c: Likewise.
1148 * elf32-bfin.c: Likewise.
1149 * elf32-m68k.c: Likewise.
1150 * elf32-nds32.c: Likewise.
1151 * elf32-tilepro.c: Likewise.
1152 * elflink.c: Likewise.
1153 * elfnn-aarch64.c: Likewise.
1154 * elfnn-riscv.c: Likewise.
1155 * elfxx-tilegx.c: Likewise.
1156 * mach-o.c: Likewise.
1157 * peXXigen.c: Likewise.
1158 * vms-alpha.c: Likewise.
1159 * vms-lib.c: Likewise.
1160
1161 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
1162
1163 PR ld/20882
1164 * elflink.c (elf_gc_mark_debug_section): New function.
1165 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
1166 referenced by kept debug sections.
1167
1168 2017-05-16 Alan Modra <amodra@gmail.com>
1169
1170 * elf-m10300.c: Rename occurrences of non_ir_ref.
1171 * elf32-arm.c: Likewise.
1172 * elf32-bfin.c: Likewise.
1173 * elf32-cr16.c: Likewise.
1174 * elf32-cris.c: Likewise.
1175 * elf32-d10v.c: Likewise.
1176 * elf32-dlx.c: Likewise.
1177 * elf32-fr30.c: Likewise.
1178 * elf32-frv.c: Likewise.
1179 * elf32-hppa.c: Likewise.
1180 * elf32-i370.c: Likewise.
1181 * elf32-i386.c: Likewise.
1182 * elf32-iq2000.c: Likewise.
1183 * elf32-lm32.c: Likewise.
1184 * elf32-m32c.c: Likewise.
1185 * elf32-m32r.c: Likewise.
1186 * elf32-m68hc1x.c: Likewise.
1187 * elf32-m68k.c: Likewise.
1188 * elf32-mcore.c: Likewise.
1189 * elf32-metag.c: Likewise.
1190 * elf32-microblaze.c: Likewise.
1191 * elf32-moxie.c: Likewise.
1192 * elf32-msp430.c: Likewise.
1193 * elf32-mt.c: Likewise.
1194 * elf32-nios2.c: Likewise.
1195 * elf32-or1k.c: Likewise.
1196 * elf32-ppc.c: Likewise.
1197 * elf32-rl78.c: Likewise.
1198 * elf32-s390.c: Likewise.
1199 * elf32-score.c: Likewise.
1200 * elf32-score7.c: Likewise.
1201 * elf32-sh.c: Likewise.
1202 * elf32-tic6x.c: Likewise.
1203 * elf32-tilepro.c: Likewise.
1204 * elf32-v850.c: Likewise.
1205 * elf32-vax.c: Likewise.
1206 * elf32-xstormy16.c: Likewise.
1207 * elf32-xtensa.c: Likewise.
1208 * elf64-alpha.c: Likewise.
1209 * elf64-hppa.c: Likewise.
1210 * elf64-ia64-vms.c: Likewise.
1211 * elf64-mmix.c: Likewise.
1212 * elf64-ppc.c: Likewise.
1213 * elf64-s390.c: Likewise.
1214 * elf64-sh64.c: Likewise.
1215 * elf64-x86-64.c: Likewise.
1216 * elflink.c: Likewise.
1217 * elfnn-aarch64.c: Likewise.
1218 * elfnn-ia64.c: Likewise.
1219 * elfnn-riscv.c: Likewise.
1220 * elfxx-mips.c: Likewise.
1221 * elfxx-sparc.c: Likewise.
1222 * elfxx-tilegx.c: Likewise.
1223 * linker.c: Likewise.
1224
1225 2017-05-16 Alan Modra <amodra@gmail.com>
1226
1227 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
1228 * elflink.c (elf_link_add_object_symbols): Update to use
1229 non_ir_ref_dynamic.
1230 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
1231 non_ir_ref.
1232 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
1233
1234 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
1235
1236 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
1237
1238 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
1239
1240 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
1241 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
1242 properties.
1243 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1244
1245 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
1246
1247 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
1248 to plt_second.
1249 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
1250 to plt_second/plt_second_eh_frame.
1251 (elf_x86_64_link_hash_newfunc): Updated.
1252 (elf_x86_64_allocate_dynrelocs): Likewise.
1253 (elf_x86_64_size_dynamic_sections): Likewise.
1254 (elf_x86_64_relocate_section): Likewise.
1255 (elf_x86_64_finish_dynamic_symbol): Likewise.
1256 (elf_x86_64_finish_dynamic_sections): Likewise.
1257 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
1258 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
1259 .plt.sec section.
1260 (elf_backend_setup_gnu_properties): Updated. Create the
1261 .plt.sec section instead of the .plt.sec section.
1262
1263 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
1264
1265 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
1266 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
1267 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
1268
1269 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
1270
1271 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
1272 (bfd_elf64_set_reloc): Define.
1273 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
1274
1275 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
1276
1277 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
1278 (struct bfd_target): New field _bfd_set_reloc.
1279 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
1280 * reloc.c (_bfd_generic_set_reloc): New function.
1281 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
1282 * nlm-target.h (nlm_set_reloc): Likewise.
1283 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
1284 * aout-tic30.c (MY_set_reloc): Likewise.
1285 * aout-target.h (MY_set_reloc): Likewise.
1286 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
1287 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
1288 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
1289 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
1290 * aout-adobe.c (aout_32_set_reloc): Likewise.
1291 * bout.c (b_out_set_reloc): Likewise.
1292 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
1293 * i386os9k.c (aout_32_set_reloc): Likewise.
1294 * ieee.c (ieee_set_reloc): Likewise.
1295 * oasys.c (oasys_set_reloc): Likewise.
1296 * som.c (som_set_reloc): Likewise.
1297 * versados.c (versados_set_reloc): Likewise.
1298 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
1299 _bfd_generic_set_reloc.
1300 (rs6000_xcoff64_aix_vec): LIkewise.
1301 * libbfd.c (_bfd_norelocs_set_reloc): New function.
1302 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
1303 * i386msdos.c (msdos_set_reloc): Define to
1304 _bfd_norelocs_set_reloc.
1305 * elfcode.h (elf_set_reloc): Define.
1306 * bfd-in2.h: Regenerated.
1307
1308 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
1309
1310 PR ld/21481
1311 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
1312 for IFUNC function address.
1313
1314 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
1315
1316 * elf32-arc.c (FEATURE_LIST_NAME): Define.
1317 (CONFLICT_LIST): Likewise.
1318 (opcode/arc-attrs.h): Include.
1319 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
1320 (arc_extract_features): New file.
1321 (arc_stralloc): Likewise.
1322 (arc_elf_merge_attributes): Likewise.
1323 (arc_elf_merge_private_bfd_data): Use object attributes.
1324 (bfd_arc_get_mach_from_attributes): New function.
1325 (arc_elf_object_p): Use object attributes.
1326 (arc_elf_final_write_processing): Likewise.
1327 (elf32_arc_obj_attrs_arg_type): New function.
1328 (elf32_arc_obj_attrs_handle_unknown): Likewise.
1329 (elf32_arc_section_from_shdr): Likewise.
1330 (elf_backend_obj_attrs_vendor): Define.
1331 (elf_backend_obj_attrs_section): Likewise.
1332 (elf_backend_obj_attrs_arg_type): Likewise.
1333 (elf_backend_obj_attrs_section_type): Likewise.
1334 (elf_backend_obj_attrs_handle_unknown): Likewise.
1335 (elf_backend_section_from_shdr): Likewise.
1336
1337 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
1338
1339 PR ld/21458
1340 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
1341 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
1342 and the destination is a Thumb symbol.
1343
1344 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1345
1346 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
1347 initializer to silence GCC 4.2.
1348 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1349
1350 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1351
1352 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
1353 (LAZY_PLT_ENTRY_SIZE): This.
1354 (NON_LAZY_PLT_ENTRY_SIZE): New.
1355 (elf_x86_64_plt0_entry): Renamed to ...
1356 (elf_x86_64_lazy_plt0_entry): This.
1357 (elf_x86_64_plt_entry): Renamed to ...
1358 (elf_x86_64_lazy_plt_entry): This.
1359 (elf_x86_64_bnd_plt0_entry): Renamed to ...
1360 (elf_x86_64_lazy_bnd_plt0_entry): This.
1361 (elf_x86_64_legacy_plt_entry): Removed.
1362 (elf_x86_64_bnd_plt_entry): Renamed to ...
1363 (elf_x86_64_lazy_bnd_plt_entry): This.
1364 (elf_x86_64_legacy_plt2_entry): Renamed to ...
1365 (elf_x86_64_non_lazy_plt_entry): This.
1366 (elf_x86_64_bnd_plt2_entry): Renamed to ...
1367 (elf_x86_64_non_lazy_bnd_plt_entry): This.
1368 (elf_x86_64_eh_frame_plt): Renamed to ...
1369 (elf_x86_64_eh_frame_lazy_plt): This.
1370 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
1371 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
1372 (elf_x86_64_eh_frame_plt_got): Renamed to ...
1373 (elf_x86_64_eh_frame_non_lazy_plt): This.
1374 (elf_x86_64_lazy_plt_layout): New.
1375 (elf_x86_64_non_lazy_plt_layout): Likewise.
1376 (elf_x86_64_plt_layout): Likewise.
1377 (elf_x86_64_backend_data): Remove PLT layout information. Add
1378 os for target system.
1379 (GET_PLT_ENTRY_SIZE): Removed.
1380 (elf_x86_64_lazy_plt): New.
1381 (elf_x86_64_non_lazy_plt): Likewise.
1382 (elf_x86_64_lazy_bnd_plt): Likewise.
1383 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1384 (elf_x86-64_arch_bed): Updated.
1385 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
1386 (elf_x86_64_create_dynamic_sections): Removed.
1387 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
1388 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
1389 (elf_x86-64_adjust_dynamic_symbol): Updated.
1390 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
1391 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
1392 size for PLT0 if there is no PLT0. Get plt_entry_size from
1393 non_lazy_plt for non-lazy PLT entries.
1394 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
1395 from non_lazy_plt for non-lazy PLT entries.
1396 (elf_x86-64_relocate_section): Updated. Properly get PLT index
1397 if there is no PLT0.
1398 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
1399 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
1400 entries with non-lazy PLT layout. Don't fill the second and third
1401 slots in the PLT entry if there is no PLT0.
1402 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
1403 if there is no PLT0. Set sh_entsize on the .plt.got section.
1404 (compare_relocs): New.
1405 (elf_x86_64_plt_type): Likewise.
1406 (elf_x86_64_plt): Likewise.
1407 (elf_x86_64_nacl_plt): New. Forward declaration.
1408 (elf_x86_64_get_plt_sym_val): Removed.
1409 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
1410 against all dynamic relocations.
1411 (elf_x86_64_link_setup_gnu_properties): New function.
1412 (elf_backend_create_dynamic_sections): Updated.
1413 (elf_backend_setup_gnu_properties): New.
1414 (elf_x86_64_nacl_plt): New.
1415 (elf_x86_64_nacl_arch_bed): Updated.
1416
1417 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1418
1419 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
1420 (LAZY_PLT_ENTRY_SIZE): This.
1421 (NON_LAZY_PLT_ENTRY_SIZE): New.
1422 (elf_i386_plt0_entry): Renamed to ...
1423 (elf_i386_lazy_plt0_entry): This.
1424 (elf_i386_plt_entry): Renamed to ...
1425 (elf_i386_lazy_plt_entry): This.
1426 (elf_i386_pic_plt0_entry): Renamed to ...
1427 (elf_i386_pic_lazy_plt0_entry): This.
1428 (elf_i386_pic_plt_entry): Renamed to ...
1429 (elf_i386_pic_lazy_plt_entry): This.
1430 (elf_i386_got_plt_entry): Renamed to ...
1431 (elf_i386_non_lazy_plt_entry): This.
1432 (elf_i386_pic_got_plt_entry): Renamed to ...
1433 (elf_i386_pic_non_lazy_plt_entry): This.
1434 (elf_i386_eh_frame_plt): Renamed to ...
1435 (elf_i386_eh_frame_lazy_plt): This.
1436 (elf_i386_eh_frame_plt_got): Renamed to ...
1437 (elf_i386_eh_frame_non_lazy_plt): This.
1438 (elf_i386_plt_layout): Renamed to ...
1439 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
1440 eh_frame_plt_got_size.
1441 (elf_i386_non_lazy_plt_layout): New.
1442 (elf_i386_plt_layout): Likewise.
1443 (elf_i386_non_lazy_plt): Likewise.
1444 (GET_PLT_ENTRY_SIZE): Removed.
1445 (elf_i386_plt): Renamed to ...
1446 (elf_i386_lazy_plt): This.
1447 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
1448 (elf_i386_arch_bed): Updated.
1449 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
1450 (elf_i386_create_dynamic_sections): Removed.
1451 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
1452 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
1453 (elf_i386_adjust_dynamic_symbol): Updated.
1454 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
1455 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
1456 size for PLT0 if there is no PLT0.
1457 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
1458 output section is discarded only if GOT isn't empty.
1459 (elf_i386_relocate_section): Updated. Properly get PLT index
1460 if there is no PLT0.
1461 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
1462 second and third slots in the PLT entry if there is no PLT0.
1463 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
1464 if there is no PLT0. Set sh_entsize on the .plt.got section.
1465 (elf_i386_nacl_plt): Forward declaration.
1466 (elf_i386_get_plt_sym_val): Removed.
1467 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
1468 against all dynamic relocations.
1469 (elf_i386_link_setup_gnu_properties): New function.
1470 (elf_backend_create_dynamic_sections): Updated.
1471 (elf_backend_setup_gnu_properties): New.
1472 (elf_i386_nacl_plt): Updated.
1473 (elf_i386_nacl_arch_bed): Likewise.
1474 (elf_i386_vxworks_arch_bed): Likewise.
1475
1476 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
1477
1478 * elflink.c (elf_output_implib): Remove executable flag from import
1479 library bfd.
1480 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
1481 library is a relocatable object file.
1482
1483 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
1484
1485 PR ld/21404
1486 * elf32-avr.c (avr_should_move_sym): New function.
1487 (avr_should_reduce_sym_size): Likewise.
1488 (avr_should_increase_sym_size): Likewise.
1489 (elf32_avr_relax_delete_bytes): Adjust symbol values
1490 and sizes by calling new functions.
1491
1492 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
1493
1494 * config.bfd (riscv32-*): Enable rv64.
1495
1496 2017-05-02 Alan Modra <amodra@gmail.com>
1497
1498 PR 21384
1499 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
1500 rather than h->root.type == bfd_link_hash_new.
1501 (bfd_elf_record_link_assignment): Similarly, call
1502 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
1503
1504 2017-04-29 Alan Modra <amodra@gmail.com>
1505
1506 PR 21432
1507 * reloc.c (reloc_offset_in_range): New function.
1508 (bfd_perform_relocation, bfd_install_relocation): Use it.
1509 (_bfd_final_link_relocate): Likewise.
1510
1511 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
1512
1513 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
1514 before using .plt.got.
1515 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
1516
1517 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1518
1519 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
1520 instead of "+=" to update 0.
1521
1522 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1523
1524 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
1525 .plt.got section here.
1526 (elf_i386_check_relocs): Don't create the .plt.got section.
1527 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
1528 the .plt.got and .plt.bnd sections here.
1529 (elf_x86_64_check_relocs): Don't create the .plt.got nor
1530 .plt.bnd sections.
1531
1532 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1533
1534 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
1535 has_bnd_reloc.
1536 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
1537 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
1538 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
1539 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
1540 has_bnd_reloc.
1541
1542 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1543
1544 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
1545 to return bfd *.
1546 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
1547 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
1548 the first relocatable ELF input with GNU properties.
1549
1550 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1551
1552 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
1553 VxWorks for non-PIC.
1554
1555 2017-04-27 Alan Modra <amodra@gmail.com>
1556
1557 * elf-bfd.h (struct elf_backend_data): Make asection param of
1558 elf_backend_eh_frame_address_size const.
1559 (_bfd_elf_eh_frame_address_size): Likewise.
1560 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
1561 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
1562 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
1563 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
1564 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
1565 (next_cie_fde_offset): Constify params.
1566 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
1567
1568 2017-04-27 Alan Modra <amodra@gmail.com>
1569
1570 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
1571 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
1572 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
1573 aug_data_len.
1574 (offset_adjust): New function.
1575 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
1576 (adjust_eh_frame_local_symbols): Likewise.
1577 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
1578 after changing anything. Return true if anything changed.
1579 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
1580 _bfd_elf_adjust_eh_frame_global_symbol for globals.
1581
1582 2017-04-27 Alan Modra <amodra@gmail.com>
1583
1584 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
1585 when force_local.
1586
1587 2017-04-27 Alan Modra <amodra@gmail.com>
1588
1589 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
1590 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
1591 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
1592 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
1593 for undef and undefweak dyn_relocs.
1594 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
1595 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
1596 (allocate_got, allocate_dynrelocs): Likewise.
1597 (ppc64_elf_relocate_section): Likewise.
1598
1599 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
1600
1601 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
1602 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
1603 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
1604 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
1605
1606 2017-04-26 Nick Clifton <nickc@redhat.com>
1607
1608 PR binutils/21434
1609 * reloc.c (bfd_perform_relocation): Check for a negative address
1610 in the reloc.
1611
1612 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
1613
1614 PR ld/21334
1615 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
1616 member.
1617 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
1618 (elf_backend_always_renumber_dynsyms): Define.
1619 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
1620 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
1621 * elflink.c (bfd_elf_size_dynamic_sections): Also call
1622 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
1623 it.
1624 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1625
1626 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
1627
1628 * elflink.c (bfd_elf_size_dynamic_sections): Only call
1629 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
1630 sections have been created.
1631
1632 2017-04-26 Nick Clifton <nickc@redhat.com>
1633
1634 PR binutils/21431
1635 * compress.c (bfd_init_section_compress_status): Check the return
1636 value from bfd_malloc.
1637
1638 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1639
1640 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
1641 no_finish_dynamic_symbol.
1642 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
1643 0.
1644 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
1645 weak symbol, don't make it dynamic.
1646 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
1647 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
1648 relocation for GOT reference.
1649 (elf_x86_64_finish_dynamic_symbol): Abort if
1650 no_finish_dynamic_symbol isn't 0.
1651
1652 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1653
1654 PR ld/21402
1655 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
1656 undefined weak symbol, don't make it dynamic.
1657 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
1658 set no_finish_dynamic_symbol and generate R_386_RELATIVE
1659 relocation for R_386_GOT32.
1660
1661 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1662
1663 PR ld/21425
1664 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
1665
1666 2017-04-23 Alan Modra <amodra@gmail.com>
1667
1668 PR 21414
1669 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
1670 * elf.c (lcomm_sym): New.
1671 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
1672 * bfd-in2.h: Regenerate.
1673
1674 2017-04-23 Alan Modra <amodra@gmail.com>
1675
1676 PR 21412
1677 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
1678 parameters and comment.
1679 (_bfd_elf_get_reloc_section): Delete.
1680 (_bfd_elf_plt_get_reloc_section): Declare.
1681 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
1682 New functions. Don't blindly skip over assumed .rel/.rela prefix.
1683 Extracted from..
1684 (_bfd_elf_get_reloc_section): ..here. Delete.
1685 (assign_section_numbers): Call elf_get_reloc_section.
1686 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
1687 * elfxx-target.h (elf_backend_get_reloc_section): Update.
1688
1689 2017-04-23 Alan Modra <amodra@gmail.com>
1690
1691 PR 21409
1692 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
1693 no symbols.
1694
1695 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
1696
1697 PR ld/21402
1698 * elf32-i386.c (elf_i386_link_hash_entry): Add
1699 no_finish_dynamic_symbol.
1700 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
1701 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
1702 symbol, don't make it dynamic in PIE.
1703 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
1704 set no_finish_dynamic_symbol and generate R_386_RELATIVE
1705 relocation for R_386_GOT32
1706 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
1707 isn't 0.
1708
1709 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
1710
1711 PR ld/19617
1712 PR ld/21086
1713 * elflink.c (elf_link_add_object_symbols): Require
1714 --no-dynamic-linker with -E/--dynamic-list when creating
1715 dynamic sections.
1716
1717 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
1718
1719 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
1720 if forced local.
1721
1722 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
1723
1724 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
1725 dynamic symbol sorting.
1726
1727 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
1728
1729 PR ld/21382
1730 * elflink.c (elf_link_add_object_symbols): Preserve
1731 dynamic_ref_after_ir_def when restoring the symbol table for
1732 unneeded dynamic object.
1733
1734 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
1735
1736 PR ld/21401
1737 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
1738 on on undefined IFUNC symbol in the second PLT.
1739
1740 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
1741
1742 * peXXigen.c (pe_print_reloc): Correct chunk_end.
1743
1744 2017-04-19 Alan Modra <amodra@gmail.com>
1745
1746 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
1747 or make dynamic for info->dynamic_undefined_weak 0 and 1.
1748 * elf32-ppc.c:Formatting.
1749 (ensure_undefweak_dynamic): Don't make dynamic when
1750 info->dynamic_undefined_weak is zero.
1751 (allocate_dynrelocs): Discard undefweak dyn_relocs for
1752 info->dynamic_undefined_weak. Discard undef dyn_relocs when
1753 not default visibility. Discard undef and undefweak
1754 dyn_relocs earlier.
1755 (ppc_elf_relocate_section): Adjust to suit.
1756 * elf64-ppc.c: Formatting.
1757 (ensure_undefweak_dynamic): Don't make dynamic when
1758 info->dynamic_undefined_weak is zero.
1759 (allocate_dynrelocs): Discard undefweak dyn_relocs for
1760 info->dynamic_undefined_weak. Discard them earlier.
1761
1762 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
1763
1764 PR ld/21389
1765 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
1766 before generating the version definition section.
1767
1768 2017-04-17 Alan Modra <amodra@gmail.com>
1769
1770 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
1771 state when a regular object file defines a symbol with
1772 incompatible type to that defined by an earlier shared lib.
1773
1774 2017-04-13 Alan Modra <amodra@gmail.com>
1775
1776 * coffcode.h: Wrap some overly long _bfd_error_handler args.
1777 * elf.c: Likewise.
1778 * elf32-arm.c: Likewise.
1779 * elf32-i386.c: Likewise.
1780 * elf32-mep.c: Likewise.
1781 * elf64-ia64-vms.c: Likewise.
1782 * elf64-x86-64.c: Likewise.
1783 * elflink.c: Likewise.
1784 * elfnn-ia64.c: Likewise.
1785 * elfxx-mips.c: Likewise.
1786
1787 2017-04-13 Alan Modra <amodra@gmail.com>
1788
1789 * aoutx.h: Use %B and %A in error messages throughout file.
1790 * aout-cris.c: Likewise.
1791 * archive.c: Likewise.
1792 * binary.c: Likewise.
1793 * coff-rs6000.c: Likewise.
1794 * coff-tic4x.c: Likewise.
1795 * coffcode.h: Likewise.
1796 * coffgen.c: Likewise.
1797 * cofflink.c: Likewise.
1798 * coffswap.h: Likewise.
1799 * cpu-arm.c: Likewise.
1800 * elf-eh-frame.c: Likewise.
1801 * elf-m10300.c: Likewise.
1802 * elf.c: Likewise.
1803 * elf32-arc.c: Likewise.
1804 * elf32-arm.c: Likewise.
1805 * elf32-bfin.c: Likewise.
1806 * elf32-frv.c: Likewise.
1807 * elf32-iq2000.c: Likewise.
1808 * elf32-m32c.c: Likewise.
1809 * elf32-microblaze.c: Likewise.
1810 * elf32-nds32.c: Likewise.
1811 * elf32-rl78.c: Likewise.
1812 * elf32-rx.c: Likewise.
1813 * elf32-score.c: Likewise.
1814 * elf32-score7.c: Likewise.
1815 * elf32-sh64.c: Likewise.
1816 * elf32-v850.c: Likewise.
1817 * elf32-vax.c: Likewise.
1818 * elf32-visium.c: Likewise.
1819 * elf64-ia64-vms.c: Likewise.
1820 * elf64-mmix.c: Likewise.
1821 * elf64-sh64.c: Likewise.
1822 * elfcode.h: Likewise.
1823 * elfnn-aarch64.c: Likewise.
1824 * elfnn-ia64.c: Likewise.
1825 * elfxx-mips.c: Likewise.
1826 * hpux-core.c: Likewise.
1827 * ieee.c: Likewise.
1828 * ihex.c: Likewise.
1829 * linker.c: Likewise.
1830 * merge.c: Likewise.
1831 * mmo.c: Likewise.
1832 * oasys.c: Likewise.
1833 * pdp11.c: Likewise.
1834 * peXXigen.c: Likewise.
1835 * rs6000-core.c: Likewise.
1836 * vms-alpha.c: Likewise.
1837 * xcofflink.c: Likewise.
1838
1839 2017-04-13 Alan Modra <amodra@gmail.com>
1840
1841 * bfd.c (PRINT_TYPE): Define.
1842 (_doprnt): New function.
1843 (error_handler_internal): Use _doprnt.
1844 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
1845 calls in their natural order, throughout file.
1846 * coff-mcore.c: Likewise.
1847 * coff-ppc.c: Likewise.
1848 * coff-tic80.c: Likewise.
1849 * cofflink.c: Likewise.
1850 * elf-s390-common.c: Likewise.
1851 * elf.c: Likewise.
1852 * elf32-arm.c: Likewise.
1853 * elf32-i386.c: Likewise.
1854 * elf32-m32r.c: Likewise.
1855 * elf32-msp430.c: Likewise.
1856 * elf32-spu.c: Likewise.
1857 * elf64-ia64-vms.c: Likewise.
1858 * elf64-sparc.c: Likewise.
1859 * elf64-x86-64.c: Likewise.
1860 * elflink.c: Likewise.
1861 * elfnn-aarch64.c: Likewise.
1862 * elfnn-ia64.c: Likewise.
1863 * elfxx-mips.c: Likewise.
1864
1865 2017-04-13 Alan Modra <amodra@gmail.com>
1866
1867 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
1868 branch veneers" error. Fix double space and format message.
1869 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
1870 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
1871
1872 2017-04-13 Alan Modra <amodra@gmail.com>
1873
1874 * bfd-in2.h: Regenerate.
1875
1876 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
1877
1878 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
1879 extra `\n' in warning/error messages.
1880 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
1881 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1882
1883 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
1884
1885 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
1886 processor-specific properties with generic ELF target vector.
1887
1888 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
1889
1890 * elf32-sparc.c (elf_backend_fixup_symbol): New.
1891 * elf64-sparc.c (elf_backend_fixup_symbol): New.
1892 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
1893 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
1894 has_non_got_reloc.
1895 (link_hash_newfunc): Initialize has_got_reloc and
1896 has_non_got_reloc.
1897 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
1898 section.
1899 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
1900 has_non_got_reloc.
1901 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
1902 has_non_got_reloc.
1903 (_bfd_sparc_elf_fixup_symbol): New function.
1904 (allocate_dynrelocs): Don't allocate space for dynamic
1905 relocations and discard relocations against resolved undefined
1906 weak symbols in executable. Don't make resolved undefined weak
1907 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
1908 relocation against undefined weak symbols in PIE.
1909 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
1910 relocations against resolved undefined weak symbols in PIE
1911 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
1912 without ynamic PLT/GOT relocations for resolved undefined weak
1913 symbols.
1914 Don't generate dynamic relocation against resolved undefined
1915 weak symbol in executable.
1916 (pie_finish_undefweak_symbol): New function.
1917 (_bfd_sparc_elf_finish_dynamic_sections): Call
1918 pie_finish_undefweak_symbol on all symbols in PIE.
1919 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
1920 (_bfd_sparc_elf_fixup_symbol): New function.
1921
1922 2017-04-10 Nick Clifton <nickc@redhat.com>
1923
1924 * config.bfd: Remove ns32k from obsolete list.
1925
1926 2017-04-10 Alan Modra <amodra@gmail.com>
1927
1928 PR 21287
1929 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
1930 (special_sections_i): Likewise for .init_array.
1931 (special_sections_p): Likewise for .preinit_array.
1932
1933 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
1934
1935 PR ld/19579
1936 PR ld/21306
1937 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
1938 ELF_COMMON_DEF_P for common symbols.
1939 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1940 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1941 * elflink.c (_bfd_elf_merge_symbol): Revert commits
1942 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
1943 07492f668d2173da7a2bda3707ff0985e0f460b6.
1944
1945 2017-04-07 Pedro Alves <palves@redhat.com>
1946
1947 * opncls.c (bfd_get_debug_link_info): Rename to...
1948 (bfd_get_debug_link_info_1): ... this. Change type of second
1949 parameter to void pointer. Adjust.
1950 (bfd_get_debug_link_info): Reimplement on top of
1951 bfd_get_debug_link_info_1.
1952 (separate_debug_file_exists, separate_alt_debug_file_exists):
1953 Change type of second parameter to void pointer. Adjust.
1954 (get_func_type, check_func_type): Change type of second parameter
1955 to void pointer.
1956 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
1957 the callback functions instead of passing the address of a local.
1958 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
1959 find_separate_debug_file.
1960 (get_alt_debug_link_info_shim): Change type of second parameter to
1961 void pointer. Adjust.
1962 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
1963 find_separate_debug_file.
1964 (get_build_id_name, bfd_boolean check_build_id_file): Change type
1965 of second parameter to void pointer. Adjust.
1966 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
1967 pointer local to find_separate_debug_file.
1968
1969 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
1970
1971 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
1972 external symbols with a definition.
1973 (_bfd_coff_gc_mark_extra_sections): Fix typo.
1974
1975 2017-04-07 Alan Modra <amodra@gmail.com>
1976
1977 * po/SRC-POTFILES.in: Regenerate.
1978
1979 2017-04-05 Alan Modra <amodra@gmail.com>
1980
1981 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
1982 reference counting.
1983
1984 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
1985
1986 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
1987 numbers for DataDirectory entry indicies passed to
1988 add_data_entry().
1989
1990 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
1991
1992 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
1993 each GNU_MBIND section and align GNU_MBIND section to page size.
1994 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
1995 segment for each GNU_MBIND section.
1996 (_bfd_elf_init_private_section_data): Copy sh_info from input
1997 for GNU_MBIND section.
1998
1999 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
2000
2001 * elfnn-riscv.c (GP_NAME): Delete.
2002 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
2003 (_bfd_riscv_relax_lui): Likewise.
2004
2005 2017-04-04 Nick Clifton <nickc@redhat.com>
2006
2007 PR binutils/21342
2008 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
2009 dereference.
2010 (bfd_elf_final_link): Only initialize the extended symbol index
2011 section if there are extended symbol tables to list.
2012
2013 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
2014
2015 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
2016 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
2017 * configure.ac (elf): Add elf-properties.lo.
2018 * Makefile.in: Regenerated.
2019 * configure: Likewise.
2020 * elf-bfd.h (elf_property_kind): New.
2021 (elf_property): Likewise.
2022 (elf_property_list): Likewise.
2023 (elf_properties): Likewise.
2024 (_bfd_elf_parse_gnu_properties): Likewise.
2025 (_bfd_elf_get_property): Likewise.
2026 (_bfd_elf_link_setup_gnu_properties): Likewise.
2027 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
2028 and setup_gnu_properties.
2029 (elf_obj_tdata): Add properties.
2030 * elf-properties.c: New file.
2031 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
2032 (elf_i386_merge_gnu_properties): Likewise.
2033 (elf_backend_parse_gnu_properties): Likewise.
2034 (elf_backend_merge_gnu_properties): Likewise.
2035 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2036 (elf_x86_64_merge_gnu_properties): Likewise.
2037 (elf_backend_parse_gnu_properties): Likewise.
2038 (elf_backend_merge_gnu_properties): Likewise.
2039 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
2040 (elf_backend_parse_gnu_properties): Likewise.
2041 (elf_backend_setup_gnu_properties): Likewise.
2042 (elfNN_bed): Add elf_backend_parse_gnu_properties,
2043 elf_backend_merge_gnu_properties and
2044 elf_backend_setup_gnu_properties.
2045
2046 2017-03-30 Pip Cet <pipcet@gmail.com>
2047
2048 * elf32-wasm32.c: Add relocation code, two relocs.
2049 * reloc.c: Add wasm32 relocations.
2050 * libbfd.h: Regenerate.
2051 * bfd-in2.h: Regenerate.
2052 * bfd/po/bfd.pot: Regenerate.
2053
2054 2017-03-29 Nick Clifton <nickc@redhat.com>
2055
2056 PR binutils/18025
2057 * coff-bfd.h (struct coff_section_data): Add new fields:
2058 saved_bias and bias.
2059 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
2060 computed for PE binaries.
2061 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
2062 missing abbrev.
2063
2064 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
2065
2066 PR ld/16044
2067 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
2068 to handle a local symbol with a hash-symbol-entry; without PLT.
2069 Add BFD_ASSERT for an incidental case with GOT entry present.
2070 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
2071 isn't forced-or-set local.
2072
2073 2017-03-27 Pip Cet <pipcet@gmail.com>
2074
2075 * wasm-module.c: New file to support WebAssembly modules.
2076 * wasm-module.h: New file to support WebAssembly modules.
2077 * doc/webassembly.texi: Start documenting wasm-module.c.
2078 * config.bfd: Add wasm_vec.
2079 * targets.c: Likewise.
2080 * configure.ac: Likewise.
2081 * Makefile.am: Add entries for wasm-module.c.
2082 * Makefile.in: Regenerate.
2083 * configure: Regenerate.
2084 * po/SRC-POTFILES.in: Regenerate.
2085
2086 2017-03-27 Pip Cet <pipcet@gmail.com>
2087
2088 * cpu-wasm32.c: New file to support wasm32 architecture.
2089 * elf32-wasm32.c: New file to support wasm32 architecture.
2090 * Makefile.am: Add wasm32 architecture.
2091 * archures.c: Likewise.
2092 * config.bfd: Likewise.
2093 * configure.ac: Likewise.
2094 * targets.c: Likewise.
2095 * Makefile.in: Regenerate.
2096 * bfd-in2.h: Regenerate.
2097 * configure: Regenerate.
2098 * po/SRC-POTFILES.in: Regenerate.
2099
2100 2017-03-20 Alan Modra <amodra@gmail.com>
2101
2102 PR 21266
2103 * elf64-ppc.c (compare_symbols): Stabilize sort.
2104
2105 2017-03-18 Alan Modra <amodra@gmail.com>
2106
2107 * elf64-ppc.c (struct ppc_link_hash_table): Add
2108 local_ifunc_resolver and maybe_local_ifunc_resolver.
2109 (ppc_build_one_stub): Set flags on emitting dynamic
2110 relocation to ifunc.
2111 (ppc64_elf_relocate_section): Likewise.
2112 (ppc64_elf_finish_dynamic_symbol): Likewise.
2113 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
2114 local dynamic relocs to ifuncs.
2115 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
2116 local_ifunc_resolver and maybe_local_ifunc_resolver.
2117 (ppc_elf_relocate_section): Set flag on emitting dynamic
2118 relocation to ifuncs.
2119 (ppc_elf_finish_dynamic_symbol): Likewise.
2120 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
2121 dynamic relocs to ifuncs.
2122
2123 2017-03-13 Nick Clifton <nickc@redhat.com>
2124
2125 PR binutils/21202
2126 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
2127 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
2128 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
2129 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
2130 * bfd-in2.h: Regenerate.
2131 * libbfd.h: Regenerate.
2132 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
2133 names.
2134 (IS_AARCH64_TLSDESC_RELOC): Likewise.
2135 (elfNN_aarch64_howto_table): Likewise.
2136 (aarch64_tls_transition_without_check): Likewise.
2137 (aarch64_reloc_got_type): Likewise.
2138 (elfNN_aarch64_final_link_relocate): Likewise.
2139 (elfNN_aarch64_tls_relax): Likewise.
2140 (elfNN_aarch64_relocate_section): Likewise.
2141 (elfNN_aarch64_gc_sweep_hook): Likewise.
2142 (elfNN_aarch64_check_relocs): Likewise.
2143 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
2144 (_bfd_aarch64_elf_resolve_relocation): Likewise.
2145
2146 2017-03-11 Alan Modra <amodra@gmail.com>
2147
2148 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
2149 parameter is in fact used. Whitespace fixes.
2150 * elf64-ppc.c: Likewise.
2151
2152 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
2153
2154 * rs6000-core.c (CORE_NEW): Simplify macro when
2155 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
2156
2157 2017-03-07 Alan Modra <amodra@gmail.com>
2158
2159 PR 21224
2160 PR 20519
2161 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
2162 dyn_relocs check.
2163
2164 2017-03-05 Alan Modra <amodra@gmail.com>
2165
2166 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
2167 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
2168 (next_cie_fde_offset): New function.
2169 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
2170 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
2171 four bytes. Align CIEs to four or eight bytes depending on
2172 per_encoding_aligned8. Align FDEs according to their encoding.
2173 Pad last FDE to output section alignment.
2174 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
2175 assertion.
2176 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
2177 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
2178 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
2179
2180 2017-03-02 Martin Bickel <binutils@ineranves.de>
2181
2182 PR ld/21212
2183 * elf.c (rewrite_elf_program_header): Do not issue a warning for
2184 empty segments which have a zero filesz, but a non-zero memsz.
2185
2186 2017-03-02 Alan Modra <amodra@gmail.com>
2187
2188 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
2189
2190 2017-02-28 Alan Modra <amodra@gmail.com>
2191
2192 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
2193 (ppc64_elf_relocate_section): Likewise.
2194
2195 2017-02-28 Alan Modra <amodra@gmail.com>
2196
2197 PR 20995
2198 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
2199 rather than elf32_nios2_hash_table or elf_hash_table.
2200 (create_got_section): Likewise.
2201 (nios2_elf32_finish_dynamic_symbol): Likewise.
2202 (nios2_elf32_adjust_dynamic_symbol): Likewise.
2203 (nios2_elf32_size_dynamic_sections): Likewise.
2204 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
2205 vars. Use htab equivalents directly instead. Don't create
2206 all dynamic sections on needing just the GOT. Use a goto
2207 rather than a fall-through with reloc test. Ensure
2208 htab->dynobj is set when making dynamic sreloc section.
2209 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
2210 equivalent directly instead. Don't segfault on looking for
2211 .dynamic when dynamic sections have not been created. Don't
2212 segfault on .got.plt being discarded.
2213 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
2214 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
2215 fixme and another not so relevant comment.
2216 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
2217 already set, set hash table dynobj on creating .sbss.
2218
2219 2017-02-28 Alan Modra <amodra@gmail.com>
2220
2221 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
2222 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
2223 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
2224 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
2225 (ppc64_elf_relocate_section): Likewise.
2226 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
2227 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
2228 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
2229 * libbfd.h: Regenerate.
2230 * bfd-in2.h: Regenerate.
2231
2232 2017-02-28 Alan Modra <amodra@gmail.com>
2233
2234 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
2235 dynamic .data.rel.ro read-only.
2236 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
2237 rather than section flags when deciding where copy reloc goes.
2238 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
2239 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
2240 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
2241 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
2242 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
2243 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
2244 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
2245 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
2246 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2247 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
2248 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
2249 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
2250 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2251 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
2252 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
2253 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
2254 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
2255 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
2256 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
2257
2258 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
2259
2260 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
2261 `jalr $0, $25' instruction encoding.
2262
2263 2017-02-27 Nick Clifton <nickc@redhat.com>
2264
2265 PR ld/21180
2266 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
2267 generating a seg-fault when encountering a symbol that has been
2268 deleted by garbage collection.
2269
2270 2017-02-25 Alan Modra <amodra@gmail.com>
2271
2272 * elf32-arc.c (struct dynamic_sections): Delete.
2273 (enum dyn_section_types): Delete.
2274 (dyn_section_names): Delete.
2275 (arc_create_dynamic_sections): Delete.
2276 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
2277 segfault on discarded .rela.plt section.
2278 (elf_arc_size_dynamic_sections): Formatting. Don't call
2279 arc_create_dynamic_sections. Don't allocate memory for sections
2280 handled by the generic linker. Correct code finding relocs in
2281 read-only sections. Set SEC_EXCLUDE on zero size .got,
2282 .got.plt, and .dynbss sections. Do set .interp for pies.
2283
2284 2017-02-24 Andrew Waterman <andrew@sifive.com>
2285
2286 * elfnn-riscv.c (GP_NAME): New macro.
2287 (riscv_global_pointer_value): Use it.
2288 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
2289 output section, consider only that section's alignment.
2290
2291 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
2292
2293 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
2294 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
2295 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
2296 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
2297
2298 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
2299
2300 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
2301 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
2302 or misaligned.
2303
2304 2017-02-23 Alan Modra <amodra@gmail.com>
2305
2306 PR 20744
2307 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
2308 16D relocations.
2309 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
2310 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
2311 relocs.
2312
2313 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
2314
2315 PR ld/20828
2316 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
2317 processing ahead of the call to `elf_gc_sweep_symbol'.
2318
2319 2017-02-22 Nick Clifton <nickc@redhat.com>
2320
2321 PR binutils/21193
2322 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
2323 created section 4-byte alignment.
2324
2325 2017-02-22 Alan Modra <amodra@gmail.com>
2326
2327 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
2328 on .got or .plt output section being discarded by script.
2329 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
2330 vxworks splt temp.
2331
2332 2017-02-21 Alan Modra <amodra@gmail.com>
2333
2334 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
2335 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
2336
2337 2017-02-20 Alan Modra <amodra@gmail.com>
2338
2339 PR 21181
2340 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
2341 if DT_RELSZ/DT_RELASZ is zero.
2342
2343 2017-02-17 Nick Clifton <nickc@redhat.com>
2344
2345 * compress.c (bfd_get_full_section_contents): Remember to reduce
2346 compressed size by the sizeof the compression header when
2347 decompressing the contents.
2348
2349 2017-02-17 Pedro Alves <palves@redhat.com>
2350
2351 * srec.c (Chunk): Rename to ...
2352 (_bfd_srec_len): ... this.
2353 (S3Forced): Rename to ...
2354 (_bfd_srec_forceS3): ... this.
2355 * objcopy.c: Adjust all references.
2356
2357 2017-02-17 Pedro Alves <palves@redhat.com>
2358
2359 * archive.c (bsd_write_armap): Rename to ...
2360 (_bfd_bsd_write_armap): ... this.
2361 (coff_write_armap): Rename to ...
2362 (_bfd_coff_write_armap): ... this.
2363 * libbfd-in.h (bsd_write_armap): Rename to ...
2364 (_bfd_bsd_write_armap): ... this.
2365 (coff_write_armap): Rename to ...
2366 (_bfd_coff_write_armap): ... this.
2367 * aout-target.h, aout-tic30.c: Adjust all users.
2368 * libbfd.h: Regenerate.
2369
2370 2017-02-17 Pedro Alves <palves@redhat.com>
2371
2372 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
2373 (warn_deprecated): Rename to ...
2374 (_bfd_warn_deprecated): ... this.
2375 * libbfd.c (warn_deprecated): Rename to ...
2376 (_bfd_warn_deprecated): ... this.
2377 * bfd-in2.h: Regenerate.
2378
2379 2017-02-17 Pedro Alves <palves@redhat.com>
2380
2381 * bfdio.c (real_ftell): Rename to ...
2382 (_bfd_real_ftell): ... this.
2383 (real_fseek): Rename to ...
2384 (_bfd_real_fseek): ... this.
2385 (real_fopen): Rename to ...
2386 (_bfd_real_fopen): ... this.
2387 * libbfd-in.h (real_ftell): Rename to ...
2388 (_bfd_real_ftell): ... this.
2389 (real_fseek): Rename to ...
2390 (_bfd_real_fseek): ... this.
2391 (real_fopen): Rename to ...
2392 (_bfd_real_fopen): ... this.
2393 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
2394 * libbfd.h: Regenerate.
2395
2396 2017-02-17 Pedro Alves <palves@redhat.com>
2397
2398 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
2399 * libbfd.c (read_unsigned_leb128): Rename to ...
2400 (_bfd_read_unsigned_leb128): ... this.
2401 (read_signed_leb128): Rename to ...
2402 (_bfd_read_signed_leb128): ... this.
2403 (safe_read_leb128): Rename to ...
2404 (_bfd_safe_read_leb128): ... this.
2405 * libbfd-in.h (read_unsigned_leb128): Rename to ...
2406 (_bfd_read_unsigned_leb128): ... this.
2407 (read_signed_leb128): Rename to ...
2408 (_bfd_read_signed_leb128): ... this.
2409 (safe_read_leb128): Rename to ...
2410 (_bfd_safe_read_leb128): ... this.
2411 * libbfd.h: Renegerate.
2412
2413 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
2414
2415 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
2416 before trying to fine matching file and line information.
2417
2418 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
2419
2420 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
2421 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
2422 not match current bfd, then reload debug information. Record bfd
2423 we're loading debug info for in the stash. If we have debug
2424 informatin in the cache then perform section placement before
2425 returning.
2426
2427 2017-02-16 Alan Modra <amodra@gmail.com>
2428
2429 PR 21000
2430 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
2431 * elfxx-target.h (elf_backend_no_page_alias): Define.
2432 (elfNN_bed): Init new field.
2433 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
2434 ensure PT_LOAD segment starts on a new page.
2435 * elf32-hppa.c (elf_backend_no_page_alias): Define.
2436
2437 2017-02-16 Alan Modra <amodra@gmail.com>
2438
2439 PR 21132
2440 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
2441 if pic.
2442
2443 2017-02-16 Jiong Wang <jiong.wang@arm.com>
2444
2445 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
2446 * bfd-in2.h: Regenerated.
2447
2448 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
2449
2450 PR ld/21168
2451 * elf32-i386.c (elf_i386_relocate_section): Allow
2452 "lea foo@GOT, %reg" in PIC.
2453
2454 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
2455
2456 PR ld/20244
2457 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
2458 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
2459 error against local IFUNC symbol without a base register for
2460 PIC.
2461
2462 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
2463
2464 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
2465 `%P: %H:' with `info->callbacks->einfo'.
2466 (ppc_elf_relocate_section): Likewise.
2467 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
2468 (ppc64_elf_edit_toc): Likewise.
2469 (ppc64_elf_relocate_section): Likewise.
2470
2471 2017-02-14 Alan Modra <amodra@gmail.com>
2472
2473 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
2474 --gc-keep-exported, and test versioned field of sym rather than
2475 looking for @ in name.
2476
2477 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
2478
2479 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
2480 __global_pointer$.
2481
2482 2017-02-13 Nick Clifton <nickc@redhat.com>
2483
2484 PR binutils/21151
2485 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
2486 unit length field.
2487
2488 2017-02-07 Andrew Waterman <andrew@sifive.com>
2489
2490 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
2491 entry size if PLT header is written.
2492
2493 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
2494
2495 Fix sparc64 dynamic relocation processing to use the dynamic
2496 symbol count.
2497 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
2498 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
2499 should be used.
2500
2501 2017-02-03 Nick Clifton <nickc@redhat.com>
2502
2503 PR 21096
2504 * coffcode.h (coff_write_object_contents): Enlarge size of
2505 s_name_buf in order to avoid compile time warning about possible
2506 integer truncation.
2507 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
2508 32-bits of insn value before printing into buffer.
2509
2510 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2511
2512 * elfxx-mips.c (mips_elf_hash_sort_data): Add
2513 `max_local_dynindx'.
2514 (mips_elf_sort_hash_table): Handle it.
2515 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
2516 symbols bump up `max_local_dynindx' rather than
2517 `max_non_got_dynindx'.
2518
2519 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2520
2521 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
2522 `min_got_dynindx', `max_unref_got_dynindx' and
2523 `max_non_got_dynindx' members to the `bfd_size_type' data type.
2524 (mips_elf_sort_hash_table): Adjust accordingly.
2525
2526 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2527
2528 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
2529 to access the hash table.
2530
2531 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2532
2533 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
2534 non-NULL `htab' to the beginning.
2535
2536 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2537
2538 * elflink.c (elf_gc_sweep): Wrap overlong line.
2539
2540 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
2541
2542 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
2543 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
2544 * elfxx-mips.c (mips_elf_link_hash_table): Add
2545 `ignore_branch_isa' member.
2546 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
2547 in branch relocation calculation as an error if
2548 `ignore_branch_isa' has been set.
2549 (_bfd_mips_elf_insn32): Rename to...
2550 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
2551 parameter to `insn32' and add an `ignore_branch_isa' parameter.
2552 Handle the new parameter.
2553
2554 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
2555
2556 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
2557 local variable dynobj.
2558
2559 PR ld/20995
2560 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
2561 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
2562 executable from read-only sections into sdynrelro.
2563 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
2564 dynamic relocs in sdynrelro.
2565 (elf_backend_want_dynrelro): Define.
2566
2567 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2568
2569 * config.bfd (*-*-rtemsaout*): Mark as removed.
2570
2571 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2572
2573 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
2574 (arm-*-rtems*): Move to (arm*-*-eabi*).
2575 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
2576 (m68-*-rtems*): Move to (m68*-*-elf*).
2577
2578 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2579
2580 * config.bfd (*-*-rtemscoff*): Mark as removed.
2581
2582 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
2583
2584 PR ld/20828
2585 * elflink.c (bfd_elf_record_link_assignment): Revert last
2586 change and don't ever clear `forced_local'. Set `mark'
2587 unconditionally.
2588 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
2589 file.
2590 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
2591 (bfd_elf_size_dynamic_sections): ... here.
2592 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
2593 and set `mark' instead in `__tls_get_addr_opt' processing.
2594 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
2595
2596 2017-01-24 Alan Modra <amodra@gmail.com>
2597
2598 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
2599 where dynamic relocs are preferable. Allow ifunc too.
2600 (ensure_undefweak_dynamic): New function.
2601 (allocate_dynrelocs): Use it here. Move plt handling last and
2602 don't make symbols dynamic, simplifying loop. Only make undef
2603 weak symbols with GOT entries dynamic. Correct condition
2604 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
2605 comments. Remove goto.
2606 (ppc_elf_relocate_section): Correct test for using dynamic
2607 symbol on GOT relocs. Rearrange test for emitting GOT relocs
2608 to suit. Set up explicit tls_index entries and implicit GOT
2609 tls_index entries resolvable at link time for
2610 __tls_get_addr_opt. Simplify test to clear mem for prelink.
2611 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
2612 (ensure_undefweak_dynamic): New function.
2613 (allocate_dynrelocs): Use it here. Only make undef weak symbols
2614 with GOT entries dynamic. Remove unnecessary test of
2615 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
2616 (ppc64_elf_relocate_section): Correct test for using dynamic
2617 symbol on GOT relocs. Rearrange test for emitting GOT relocs
2618 to suit. Set up explicit tls_index entries and implicit GOT
2619 tls_index entries resolvable at link time for __tls_get_addr_opt.
2620 Simplify expression to clear mem for prelink.
2621
2622 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
2623
2624 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
2625
2626 2017-01-20 Jiong Wang <jiong.wang@arm.com>
2627
2628 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
2629 (elf_backend_hash_symbol): Define.
2630
2631 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
2632
2633 PR ld/20828
2634 * elflink.c (bfd_elf_record_link_assignment): Clear any
2635 `forced_local' marking for DSO symbols that are not being
2636 provided.
2637
2638 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
2639
2640 * elfnn-riscv.c (riscv_elf_object_p): New function.
2641
2642 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
2643
2644 PR ld/21038
2645 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
2646 plt_bnd_eh_frame.
2647 (elf_x86_64_check_relocs): Create .eh_frame section for the
2648 .plt.bnd section.
2649 (elf_x86_64_size_dynamic_sections): Allocate and initialize
2650 .eh_frame section for the .plt.bnd section.
2651 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
2652 for the .plt.bnd section.
2653
2654 2017-01-12 Nick Clifton <nickc@redhat.com>
2655
2656 PR binutils/20876
2657 * opncls.c (find_separate_debug_file): Add include_dirs
2658 parameter. Only include the directory part of the bfd's filename
2659 in search paths if include_dirs is true. Add a couple of extra
2660 locations for looking for debug files.
2661 ( bfd_follow_gnu_debuglink): Update invocation of
2662 find_separate_debug_file.
2663 (bfd_follow_gnu_debugaltlink): Likewise.
2664 (get_build_id): New function: Finds the build-id of the given bfd.
2665 (get_build_id_name): New function: Computes the name of the
2666 separate debug info file for a bfd, based upon its build-id.
2667 (check_build_id_file): New function: Checks to see if a separate
2668 debug info file exists at the given location, and that its
2669 build-id matches that of the original bfd.
2670 (bfd_follow_build_id_debuglink): New function: Finds a separate
2671 debug info file for a given bfd by using the build-id method.
2672 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
2673 method of locating a separate debug info file before using the
2674 debuglink method.
2675 * bfd-in2.h: Regenerate.
2676
2677 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
2678
2679 PR ld/21038
2680 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
2681 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
2682 elf_x86_64_eh_frame_plt_got.
2683 (elf_x86_64_size_dynamic_sections): Get unwind info from
2684 elf_x86_64_bnd_arch_bed for the BND PLT.
2685
2686 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
2687
2688 * config.bfd: Add entries for i686-redox and x86_64-redox.
2689
2690 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2691
2692 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
2693 to 4 bytes.
2694 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
2695 .eh_frame section to 4 bytes for x32.
2696 (elf_x86_64_check_relocs): Likewise.
2697
2698 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2699
2700 PR ld/20830
2701 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
2702 (PLT_GOT_FDE_LENGTH): Likewise.
2703 (elf_i386_plt_layout): Add eh_frame_plt_got and
2704 eh_frame_plt_got_size.
2705 (elf_i386_plt): Updated.
2706 (elf_i386_link_hash_table): Add plt_got_eh_frame.
2707 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
2708 (elf_i386_size_dynamic_sections): Allocate and initialize
2709 .eh_frame section for .plt.got.
2710 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
2711 .plt.got.
2712 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
2713 eh_frame_plt_got_size.
2714 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
2715 (PLT_GOT_FDE_LENGTH): Likewise.
2716 (elf_x86_64_backend_data): Add eh_frame_plt_got and
2717 eh_frame_plt_got_size.
2718 (elf_x86_64_arch_bed): Updated.
2719 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
2720 eh_frame_plt_got_size.
2721 (elf_x86_64_nacl_arch_bed): Likewise.
2722 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
2723 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
2724 (elf_x86_64_size_dynamic_sections): Allocate and initialize
2725 .eh_frame section for .plt.got.
2726 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
2727 for .plt.got.
2728
2729 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2730
2731 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
2732 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
2733
2734 2017-01-09 Nick Clifton <nickc@redhat.com>
2735
2736 * dwarf2.c (lookup_address_in_function_table): Return early if
2737 there are no functions in the given comp unit, or if the high
2738 address of the last function in the comp unit is less than the
2739 desired address.
2740
2741 2017-01-09 Nick Clifton <nickc@redhat.com>
2742
2743 PR binutils/21013
2744 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
2745 message if there are too many symbols to load.
2746
2747 2017-01-04 James Clarke <jrtc27@jrtc27.com>
2748
2749 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
2750 if relocs are cached.
2751
2752 2017-01-03 Rich Felker <bugdal@aerifal.cx>
2753
2754 PR ld/21017
2755 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
2756 for R_MICROBLAZE_GOTOFF_64.
2757
2758 2017-01-03 Nick Clifton <nickc@redhat.com>
2759
2760 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
2761 warning about using a possibly uninitialised variable.
2762
2763 2017-01-02 Alan Modra <amodra@gmail.com>
2764
2765 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
2766 (allocate_plt_static, allocate_dynrelocs): Use it.
2767
2768 2017-01-02 Alan Modra <amodra@gmail.com>
2769
2770 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
2771 .PARISC.unwind section.
2772
2773 2017-01-02 Alan Modra <amodra@gmail.com>
2774
2775 PR ld/20989
2776 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
2777 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
2778 indirect to GOT pointer relative code edit.
2779
2780 2017-01-02 Alan Modra <amodra@gmail.com>
2781
2782 Update year range in copyright notice of all files.
2783
2784 For older changes see ChangeLog-2016
2785 \f
2786 Copyright (C) 2017 Free Software Foundation, Inc.
2787
2788 Copying and distribution of this file, with or without modification,
2789 are permitted in any medium without royalty provided the copyright
2790 notice and this notice are preserved.
2791
2792 Local Variables:
2793 mode: change-log
2794 left-margin: 8
2795 fill-column: 74
2796 version-control: never
2797 End: