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