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