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