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