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