x86: Create dynamic sections in create_dynamic_sections
[external/binutils.git] / bfd / ChangeLog
1 2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
2
3         * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
4         .plt.got section here.
5         (elf_i386_check_relocs): Don't create the .plt.got section.
6         * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
7         the .plt.got and .plt.bnd sections here.
8         (elf_x86_64_check_relocs): Don't create the .plt.got nor
9         .plt.bnd sections.
10
11 2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
12
13         * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
14         has_bnd_reloc.
15         (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
16         (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
17         (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
18         (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
19         has_bnd_reloc.
20
21 2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
22
23         * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
24         to return bfd *.
25         (_bfd_elf_link_setup_gnu_properties): Return bfd *.
26         * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
27         the first relocatable ELF input with GNU properties.
28
29 2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
30
31         * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
32         VxWorks for non-PIC.
33
34 2017-04-27  Alan Modra  <amodra@gmail.com>
35
36         * elf-bfd.h (struct elf_backend_data): Make asection param of
37         elf_backend_eh_frame_address_size const.
38         (_bfd_elf_eh_frame_address_size): Likewise.
39         * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
40         * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
41         * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
42         * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
43         * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
44         (next_cie_fde_offset): Constify params.
45         (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
46
47 2017-04-27  Alan Modra  <amodra@gmail.com>
48
49         * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
50         (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
51         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
52         aug_data_len.
53         (offset_adjust): New function.
54         (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
55         (adjust_eh_frame_local_symbols): Likewise.
56         (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
57         after changing anything.  Return true if anything changed.
58         * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
59         _bfd_elf_adjust_eh_frame_global_symbol for globals.
60
61 2017-04-27  Alan Modra  <amodra@gmail.com>
62
63         * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
64         when force_local.
65
66 2017-04-27  Alan Modra  <amodra@gmail.com>
67
68         * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
69         (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
70         (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
71         (ppc_elf_relocate_section): Likewise.  Delete silly optimisation
72         for undef and undefweak dyn_relocs.
73         * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
74         (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
75         (allocate_got, allocate_dynrelocs): Likewise.
76         (ppc64_elf_relocate_section): Likewise.
77
78 2017-04-26  H.J. Lu  <hongjiu.lu@intel.com>
79
80         * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
81         DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
82         * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
83         add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
84
85 2017-04-26  Nick Clifton  <nickc@redhat.com>
86
87         PR binutils/21434
88         * reloc.c (bfd_perform_relocation): Check for a negative address
89         in the reloc.
90
91 2017-04-26  Maciej W. Rozycki  <macro@imgtec.com>
92
93         PR ld/21334
94         * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
95         member.
96         * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
97         (elf_backend_always_renumber_dynsyms): Define.
98         (elfNN_bed): Initialize `always_renumber_dynsyms' member.
99         * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
100         * elflink.c (bfd_elf_size_dynamic_sections): Also call
101         `_bfd_elf_link_renumber_dynsyms' if the backend has requested
102         it.
103         (bfd_elf_size_dynsym_hash_dynstr): Likewise.
104
105 2017-04-26  Maciej W. Rozycki  <macro@imgtec.com>
106
107         * elflink.c (bfd_elf_size_dynamic_sections): Only call
108         `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
109         sections have been created.
110
111 2017-04-26  Nick Clifton  <nickc@redhat.com>
112
113         PR binutils/21431
114         * compress.c (bfd_init_section_compress_status): Check the return
115         value from bfd_malloc.
116
117 2017-04-24  H.J. Lu  <hongjiu.lu@intel.com>
118
119         * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
120         no_finish_dynamic_symbol.
121         (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
122         0.
123         (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
124         weak symbol, don't make it dynamic.
125         (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
126         set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
127         relocation for GOT reference.
128         (elf_x86_64_finish_dynamic_symbol): Abort if
129         no_finish_dynamic_symbol isn't 0.
130
131 2017-04-24  H.J. Lu  <hongjiu.lu@intel.com>
132
133         PR ld/21402
134         * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
135         undefined weak symbol, don't make it dynamic.
136         (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
137         set no_finish_dynamic_symbol and generate R_386_RELATIVE
138         relocation for R_386_GOT32.
139
140 2017-04-24  H.J. Lu  <hongjiu.lu@intel.com>
141
142         PR ld/21425
143         * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
144
145 2017-04-23  Alan Modra  <amodra@gmail.com>
146
147         PR 21414
148         * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
149         * elf.c (lcomm_sym): New.
150         (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
151         * bfd-in2.h: Regenerate.
152
153 2017-04-23  Alan Modra  <amodra@gmail.com>
154
155         PR 21412
156         * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
157         parameters and comment.
158         (_bfd_elf_get_reloc_section): Delete.
159         (_bfd_elf_plt_get_reloc_section): Declare.
160         * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
161         New functions.  Don't blindly skip over assumed .rel/.rela prefix.
162         Extracted from..
163         (_bfd_elf_get_reloc_section): ..here.  Delete.
164         (assign_section_numbers): Call elf_get_reloc_section.
165         * elf64-ppc.c (elf_backend_get_reloc_section): Define.
166         * elfxx-target.h (elf_backend_get_reloc_section): Update.
167
168 2017-04-23  Alan Modra  <amodra@gmail.com>
169
170         PR 21409
171         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
172         no symbols.
173
174 2017-04-21  H.J. Lu  <hongjiu.lu@intel.com>
175
176         PR ld/21402
177         * elf32-i386.c (elf_i386_link_hash_entry): Add
178         no_finish_dynamic_symbol.
179         (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
180         (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
181         symbol, don't make it dynamic in PIE.
182         (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
183         set no_finish_dynamic_symbol and generate R_386_RELATIVE
184         relocation for R_386_GOT32
185         (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
186         isn't 0.
187
188 2017-04-21  H.J. Lu  <hongjiu.lu@intel.com>
189
190         PR ld/19617
191         PR ld/21086
192         * elflink.c (elf_link_add_object_symbols): Require
193         --no-dynamic-linker with -E/--dynamic-list when creating
194         dynamic sections.
195
196 2017-04-20  Maciej W. Rozycki  <macro@imgtec.com>
197
198         * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
199         if forced local.
200
201 2017-04-20  Maciej W. Rozycki  <macro@imgtec.com>
202
203         * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
204         dynamic symbol sorting.
205
206 2017-04-20  H.J. Lu  <hongjiu.lu@intel.com>
207
208         PR ld/21382
209         * elflink.c (elf_link_add_object_symbols): Preserve
210         dynamic_ref_after_ir_def when restoring the symbol table for
211         unneeded dynamic object.
212
213 2017-04-19  H.J. Lu  <hongjiu.lu@intel.com>
214
215         PR ld/21401
216         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
217         on on undefined IFUNC symbol in the second PLT.
218
219 2017-04-19  Wedson Almeida Filho  <wedsonaf@gmail.com>
220
221         * peXXigen.c (pe_print_reloc): Correct chunk_end.
222
223 2017-04-19  Alan Modra  <amodra@gmail.com>
224
225         * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
226         or make dynamic for info->dynamic_undefined_weak 0 and 1.
227         * elf32-ppc.c:Formatting.
228         (ensure_undefweak_dynamic): Don't make dynamic when
229         info->dynamic_undefined_weak is zero.
230         (allocate_dynrelocs): Discard undefweak dyn_relocs for
231         info->dynamic_undefined_weak.  Discard undef dyn_relocs when
232         not default visibility.  Discard undef and undefweak
233         dyn_relocs earlier.
234         (ppc_elf_relocate_section): Adjust to suit.
235         * elf64-ppc.c: Formatting.
236         (ensure_undefweak_dynamic): Don't make dynamic when
237         info->dynamic_undefined_weak is zero.
238         (allocate_dynrelocs): Discard undefweak dyn_relocs for
239         info->dynamic_undefined_weak.  Discard them earlier.
240
241 2017-04-17  H.J. Lu  <hongjiu.lu@intel.com>
242
243         PR ld/21389
244         * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
245         before generating the version definition section.
246
247 2017-04-17  Alan Modra  <amodra@gmail.com>
248
249         * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
250         state when a regular object file defines a symbol with
251         incompatible type to that defined by an earlier shared lib.
252
253 2017-04-13  Alan Modra  <amodra@gmail.com>
254
255         * coffcode.h: Wrap some overly long _bfd_error_handler args.
256         * elf.c: Likewise.
257         * elf32-arm.c: Likewise.
258         * elf32-i386.c: Likewise.
259         * elf32-mep.c: Likewise.
260         * elf64-ia64-vms.c: Likewise.
261         * elf64-x86-64.c: Likewise.
262         * elflink.c: Likewise.
263         * elfnn-ia64.c: Likewise.
264         * elfxx-mips.c: Likewise.
265
266 2017-04-13  Alan Modra  <amodra@gmail.com>
267
268         * aoutx.h: Use %B and %A in error messages throughout file.
269         * aout-cris.c: Likewise.
270         * archive.c: Likewise.
271         * binary.c: Likewise.
272         * coff-rs6000.c: Likewise.
273         * coff-tic4x.c: Likewise.
274         * coffcode.h: Likewise.
275         * coffgen.c: Likewise.
276         * cofflink.c: Likewise.
277         * coffswap.h: Likewise.
278         * cpu-arm.c: Likewise.
279         * elf-eh-frame.c: Likewise.
280         * elf-m10300.c: Likewise.
281         * elf.c: Likewise.
282         * elf32-arc.c: Likewise.
283         * elf32-arm.c: Likewise.
284         * elf32-bfin.c: Likewise.
285         * elf32-frv.c: Likewise.
286         * elf32-iq2000.c: Likewise.
287         * elf32-m32c.c: Likewise.
288         * elf32-microblaze.c: Likewise.
289         * elf32-nds32.c: Likewise.
290         * elf32-rl78.c: Likewise.
291         * elf32-rx.c: Likewise.
292         * elf32-score.c: Likewise.
293         * elf32-score7.c: Likewise.
294         * elf32-sh64.c: Likewise.
295         * elf32-v850.c: Likewise.
296         * elf32-vax.c: Likewise.
297         * elf32-visium.c: Likewise.
298         * elf64-ia64-vms.c: Likewise.
299         * elf64-mmix.c: Likewise.
300         * elf64-sh64.c: Likewise.
301         * elfcode.h: Likewise.
302         * elfnn-aarch64.c: Likewise.
303         * elfnn-ia64.c: Likewise.
304         * elfxx-mips.c: Likewise.
305         * hpux-core.c: Likewise.
306         * ieee.c: Likewise.
307         * ihex.c: Likewise.
308         * linker.c: Likewise.
309         * merge.c: Likewise.
310         * mmo.c: Likewise.
311         * oasys.c: Likewise.
312         * pdp11.c: Likewise.
313         * peXXigen.c: Likewise.
314         * rs6000-core.c: Likewise.
315         * vms-alpha.c: Likewise.
316         * xcofflink.c: Likewise.
317
318 2017-04-13  Alan Modra  <amodra@gmail.com>
319
320         * bfd.c (PRINT_TYPE): Define.
321         (_doprnt): New function.
322         (error_handler_internal): Use _doprnt.
323         * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
324         calls in their natural order, throughout file.
325         * coff-mcore.c: Likewise.
326         * coff-ppc.c: Likewise.
327         * coff-tic80.c: Likewise.
328         * cofflink.c: Likewise.
329         * elf-s390-common.c: Likewise.
330         * elf.c: Likewise.
331         * elf32-arm.c: Likewise.
332         * elf32-i386.c: Likewise.
333         * elf32-m32r.c: Likewise.
334         * elf32-msp430.c: Likewise.
335         * elf32-spu.c: Likewise.
336         * elf64-ia64-vms.c: Likewise.
337         * elf64-sparc.c: Likewise.
338         * elf64-x86-64.c: Likewise.
339         * elflink.c: Likewise.
340         * elfnn-aarch64.c: Likewise.
341         * elfnn-ia64.c: Likewise.
342         * elfxx-mips.c: Likewise.
343
344 2017-04-13  Alan Modra  <amodra@gmail.com>
345
346         * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
347         branch veneers" error.  Fix double space and format message.
348         * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
349         * elf64-ppc.c (tocsave_find): Supply missing %B arg.
350
351 2017-04-13  Alan Modra  <amodra@gmail.com>
352
353         * bfd-in2.h: Regenerate.
354
355 2017-04-11  H.J. Lu  <hongjiu.lu@intel.com>
356
357         * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
358         extra `\n' in warning/error messages.
359         * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
360         * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
361
362 2017-04-11  H.J. Lu  <hongjiu.lu@intel.com>
363
364         * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
365         processor-specific properties with generic ELF target vector.
366
367 2017-04-10  Qing Zhao  <qing.zhao@oracle.com>
368
369         * elf32-sparc.c (elf_backend_fixup_symbol): New.
370         * elf64-sparc.c (elf_backend_fixup_symbol): New.
371         * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
372         (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
373         has_non_got_reloc.
374         (link_hash_newfunc): Initialize has_got_reloc and
375         has_non_got_reloc.
376         (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
377         section.
378         (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
379         has_non_got_reloc.
380         (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
381         has_non_got_reloc.
382         (_bfd_sparc_elf_fixup_symbol): New function.
383         (allocate_dynrelocs): Don't allocate space for dynamic
384         relocations and discard relocations against resolved undefined
385         weak symbols in executable.  Don't make resolved undefined weak
386         symbols in executable dynamic.  Keep dynamic non-GOT/non-PLT
387         relocation against undefined weak symbols in PIE.
388         (_bfd_sparc_elf_relocate_section): Don't generate dynamic
389         relocations against resolved undefined weak symbols in PIE
390         (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
391         without ynamic PLT/GOT relocations for resolved undefined weak
392         symbols.
393         Don't generate dynamic relocation against resolved undefined
394         weak symbol in executable.
395         (pie_finish_undefweak_symbol): New function.
396         (_bfd_sparc_elf_finish_dynamic_sections): Call
397         pie_finish_undefweak_symbol on all symbols in PIE.
398         * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
399         (_bfd_sparc_elf_fixup_symbol): New function.
400
401 2017-04-10  Nick Clifton  <nickc@redhat.com>
402
403         * config.bfd: Remove ns32k from obsolete list.
404
405 2017-04-10  Alan Modra  <amodra@gmail.com>
406
407         PR 21287
408         * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
409         (special_sections_i): Likewise for .init_array.
410         (special_sections_p): Likewise for .preinit_array.
411
412 2017-04-07  H.J. Lu  <hongjiu.lu@intel.com>
413
414         PR ld/19579
415         PR ld/21306
416         * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
417         ELF_COMMON_DEF_P for common symbols.
418         * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
419         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
420         * elflink.c (_bfd_elf_merge_symbol): Revert commits
421         202ac193bbbecc96a4978d1ac3d17148253f9b01 and
422         07492f668d2173da7a2bda3707ff0985e0f460b6.
423
424 2017-04-07  Pedro Alves  <palves@redhat.com>
425
426         * opncls.c (bfd_get_debug_link_info): Rename to...
427         (bfd_get_debug_link_info_1): ... this.  Change type of second
428         parameter to void pointer.  Adjust.
429         (bfd_get_debug_link_info): Reimplement on top of
430         bfd_get_debug_link_info_1.
431         (separate_debug_file_exists, separate_alt_debug_file_exists):
432         Change type of second parameter to void pointer.  Adjust.
433         (get_func_type, check_func_type): Change type of second parameter
434         to void pointer.
435         (find_separate_debug_file): Add 'func_data' parameter.  Pass it to
436         the callback functions instead of passing the address of a local.
437         (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
438         find_separate_debug_file.
439         (get_alt_debug_link_info_shim): Change type of second parameter to
440         void pointer.  Adjust.
441         (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
442         find_separate_debug_file.
443         (get_build_id_name, bfd_boolean check_build_id_file): Change type
444         of second parameter to void pointer.  Adjust.
445         (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
446         pointer local to find_separate_debug_file.
447
448 2017-04-07  Tristan Gingold  <gingold@gingold-Precision-7510>
449
450         * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
451         external symbols with a definition.
452         (_bfd_coff_gc_mark_extra_sections): Fix typo.
453
454 2017-04-07  Alan Modra  <amodra@gmail.com>
455
456         * po/SRC-POTFILES.in: Regenerate.
457
458 2017-04-05  Alan Modra  <amodra@gmail.com>
459
460         * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
461         reference counting.
462
463 2017-04-02  Jon Turney  <jon.turney@dronecode.org.uk>
464
465         (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
466         numbers for DataDirectory entry indicies passed to
467         add_data_entry().
468
469 2017-04-04  H.J. Lu  <hongjiu.lu@intel.com>
470
471         * elf.c (get_program_header_size): Add a GNU_MBIND segment for
472         each GNU_MBIND section and align GNU_MBIND section to page size.
473         (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
474         segment for each GNU_MBIND section.
475         (_bfd_elf_init_private_section_data): Copy sh_info from input
476         for GNU_MBIND section.
477
478 2017-04-03  Palmer Dabbelt  <palmer@dabbelt.com>
479
480         * elfnn-riscv.c (GP_NAME): Delete.
481         (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
482         (_bfd_riscv_relax_lui): Likewise.
483
484 2017-04-04  Nick Clifton  <nickc@redhat.com>
485
486         PR binutils/21342
487         * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
488         dereference.
489         (bfd_elf_final_link): Only initialize the extended symbol index
490         section if there are extended symbol tables to list.
491
492 2017-04-03  H.J. Lu  <hongjiu.lu@intel.com>
493
494         * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
495         (BFD32_BACKENDS_CFILES): Add elf-properties.c.
496         * configure.ac (elf): Add elf-properties.lo.
497         * Makefile.in: Regenerated.
498         * configure: Likewise.
499         * elf-bfd.h (elf_property_kind): New.
500         (elf_property): Likewise.
501         (elf_property_list): Likewise.
502         (elf_properties): Likewise.
503         (_bfd_elf_parse_gnu_properties): Likewise.
504         (_bfd_elf_get_property): Likewise.
505         (_bfd_elf_link_setup_gnu_properties): Likewise.
506         (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
507         and setup_gnu_properties.
508         (elf_obj_tdata): Add properties.
509         * elf-properties.c: New file.
510         * elf32-i386.c (elf_i386_parse_gnu_properties): New.
511         (elf_i386_merge_gnu_properties): Likewise.
512         (elf_backend_parse_gnu_properties): Likewise.
513         (elf_backend_merge_gnu_properties): Likewise.
514         * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
515         (elf_x86_64_merge_gnu_properties): Likewise.
516         (elf_backend_parse_gnu_properties): Likewise.
517         (elf_backend_merge_gnu_properties): Likewise.
518         * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
519         (elf_backend_parse_gnu_properties): Likewise.
520         (elf_backend_setup_gnu_properties): Likewise.
521         (elfNN_bed): Add elf_backend_parse_gnu_properties,
522         elf_backend_merge_gnu_properties and
523         elf_backend_setup_gnu_properties.
524
525 2017-03-30  Pip Cet  <pipcet@gmail.com>
526
527         * elf32-wasm32.c: Add relocation code, two relocs.
528         * reloc.c: Add wasm32 relocations.
529         * libbfd.h: Regenerate.
530         * bfd-in2.h: Regenerate.
531         * bfd/po/bfd.pot: Regenerate.
532
533 2017-03-29  Nick Clifton  <nickc@redhat.com>
534
535         PR binutils/18025
536         * coff-bfd.h (struct coff_section_data): Add new fields:
537         saved_bias and bias.
538         * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
539         computed for PE binaries.
540         * dwarf2.c (scan_unit_for_symbols): Only warn once about each
541         missing abbrev.
542
543 2017-03-28  Hans-Peter Nilsson  <hp@axis.com>
544
545         PR ld/16044
546         * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
547         to handle a local symbol with a hash-symbol-entry; without PLT.
548         Add BFD_ASSERT for an incidental case with GOT entry present.
549         (cris_elf_check_relocs): Increment PLT refcount only if the symbol
550         isn't forced-or-set local.
551
552 2017-03-27  Pip Cet  <pipcet@gmail.com>
553
554         * wasm-module.c: New file to support WebAssembly modules.
555         * wasm-module.h: New file to support WebAssembly modules.
556         * doc/webassembly.texi: Start documenting wasm-module.c.
557         * config.bfd: Add wasm_vec.
558         * targets.c: Likewise.
559         * configure.ac: Likewise.
560         * Makefile.am: Add entries for wasm-module.c.
561         * Makefile.in: Regenerate.
562         * configure: Regenerate.
563         * po/SRC-POTFILES.in: Regenerate.
564
565 2017-03-27  Pip Cet  <pipcet@gmail.com>
566
567         * cpu-wasm32.c: New file to support wasm32 architecture.
568         * elf32-wasm32.c: New file to support wasm32 architecture.
569         * Makefile.am: Add wasm32 architecture.
570         * archures.c: Likewise.
571         * config.bfd: Likewise.
572         * configure.ac: Likewise.
573         * targets.c: Likewise.
574         * Makefile.in: Regenerate.
575         * bfd-in2.h: Regenerate.
576         * configure: Regenerate.
577         * po/SRC-POTFILES.in: Regenerate.
578
579 2017-03-20  Alan Modra  <amodra@gmail.com>
580
581         PR 21266
582         * elf64-ppc.c (compare_symbols): Stabilize sort.
583
584 2017-03-18  Alan Modra  <amodra@gmail.com>
585
586         * elf64-ppc.c (struct ppc_link_hash_table): Add
587         local_ifunc_resolver and maybe_local_ifunc_resolver.
588         (ppc_build_one_stub): Set flags on emitting dynamic
589         relocation to ifunc.
590         (ppc64_elf_relocate_section): Likewise.
591         (ppc64_elf_finish_dynamic_symbol): Likewise.
592         (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
593         local dynamic relocs to ifuncs.
594         * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
595         local_ifunc_resolver and maybe_local_ifunc_resolver.
596         (ppc_elf_relocate_section): Set flag on emitting dynamic
597         relocation to ifuncs.
598         (ppc_elf_finish_dynamic_symbol): Likewise.
599         (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
600         dynamic relocs to ifuncs.
601
602 2017-03-13  Nick Clifton  <nickc@redhat.com>
603
604         PR binutils/21202
605         * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
606         BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
607         (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
608         BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
609         * bfd-in2.h: Regenerate.
610         * libbfd.h: Regenerate.
611         * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
612         names.
613         (IS_AARCH64_TLSDESC_RELOC): Likewise.
614         (elfNN_aarch64_howto_table): Likewise.
615         (aarch64_tls_transition_without_check): Likewise.
616         (aarch64_reloc_got_type): Likewise.
617         (elfNN_aarch64_final_link_relocate): Likewise.
618         (elfNN_aarch64_tls_relax): Likewise.
619         (elfNN_aarch64_relocate_section): Likewise.
620         (elfNN_aarch64_gc_sweep_hook): Likewise.
621         (elfNN_aarch64_check_relocs): Likewise.
622         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
623         (_bfd_aarch64_elf_resolve_relocation): Likewise.
624
625 2017-03-11  Alan Modra  <amodra@gmail.com>
626
627         * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
628         parameter is in fact used.  Whitespace fixes.
629         * elf64-ppc.c: Likewise.
630
631 2017-03-09  Sam Thursfield  <sam.thursfield@codethink.co.uk>
632
633         * rs6000-core.c (CORE_NEW): Simplify macro when
634         AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
635
636 2017-03-07  Alan Modra  <amodra@gmail.com>
637
638         PR 21224
639         PR 20519
640         * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
641         dyn_relocs check.
642
643 2017-03-05  Alan Modra  <amodra@gmail.com>
644
645         * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
646         * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
647         (next_cie_fde_offset): New function.
648         (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
649         (_bfd_elf_discard_section_eh_frame): Align zero terminator to
650         four bytes.  Align CIEs to four or eight bytes depending on
651         per_encoding_aligned8.  Align FDEs according to their encoding.
652         Pad last FDE to output section alignment.
653         (_bfd_elf_write_section_eh_frame): Adjust to suit.  Remove
654         assertion.
655         * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
656         (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
657         (ppc64_elf_finish_dynamic_sections): Adjust to suit.
658
659 2017-03-02  Martin Bickel  <binutils@ineranves.de>
660
661         PR ld/21212
662         * elf.c (rewrite_elf_program_header): Do not issue a warning for
663         empty segments which have a zero filesz, but a non-zero memsz.
664
665 2017-03-02  Alan Modra  <amodra@gmail.com>
666
667         * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
668
669 2017-02-28  Alan Modra  <amodra@gmail.com>
670
671         * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
672         (ppc64_elf_relocate_section): Likewise.
673
674 2017-02-28  Alan Modra  <amodra@gmail.com>
675
676         PR 20995
677         * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
678         rather than elf32_nios2_hash_table or elf_hash_table.
679         (create_got_section): Likewise.
680         (nios2_elf32_finish_dynamic_symbol): Likewise.
681         (nios2_elf32_adjust_dynamic_symbol): Likewise.
682         (nios2_elf32_size_dynamic_sections): Likewise.
683         (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
684         vars.  Use htab equivalents directly instead.  Don't create
685         all dynamic sections on needing just the GOT.  Use a goto
686         rather than a fall-through with reloc test.  Ensure
687         htab->dynobj is set when making dynamic sreloc section.
688         (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
689         equivalent directly instead.  Don't segfault on looking for
690         .dynamic when dynamic sections have not been created.  Don't
691         segfault on .got.plt being discarded.
692         (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
693         Don't set "relocs" on .rela.plt.  Do handle .sbss.  Delete
694         fixme and another not so relevant comment.
695         (nios2_elf_add_symbol_hook): Delete dynobj var.  If not
696         already set, set hash table dynobj on creating .sbss.
697
698 2017-02-28  Alan Modra  <amodra@gmail.com>
699
700         * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
701         * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
702         (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
703         (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
704         (ppc64_elf_relocate_section): Likewise.
705         * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
706         (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
707         (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
708         * libbfd.h: Regenerate.
709         * bfd-in2.h: Regenerate.
710
711 2017-02-28  Alan Modra  <amodra@gmail.com>
712
713         * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
714         dynamic .data.rel.ro read-only.
715         * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
716         rather than section flags when deciding where copy reloc goes.
717         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
718         * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
719         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
720         * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
721         * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
722         * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
723         * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
724         * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
725         * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
726         * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
727         * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
728         * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
729         * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
730         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
731         * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
732         * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
733         * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
734         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
735         * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
736
737 2017-02-28  Maciej W. Rozycki  <macro@imgtec.com>
738
739         * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
740         `jalr $0, $25' instruction encoding.
741
742 2017-02-27  Nick Clifton  <nickc@redhat.com>
743
744         PR ld/21180
745         * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
746         generating a seg-fault when encountering a symbol that has been
747         deleted by garbage collection.
748
749 2017-02-25  Alan Modra  <amodra@gmail.com>
750
751         * elf32-arc.c (struct dynamic_sections): Delete.
752         (enum dyn_section_types): Delete.
753         (dyn_section_names): Delete.
754         (arc_create_dynamic_sections): Delete.
755         (elf_arc_finish_dynamic_sections): Don't call the above.  Don't
756         segfault on discarded .rela.plt section.
757         (elf_arc_size_dynamic_sections): Formatting.  Don't call
758         arc_create_dynamic_sections.  Don't allocate memory for sections
759         handled by the generic linker.  Correct code finding relocs in
760         read-only sections.  Set SEC_EXCLUDE on zero size .got,
761         .got.plt, and .dynbss sections.  Do set .interp for pies.
762
763 2017-02-24  Andrew Waterman  <andrew@sifive.com>
764
765         * elfnn-riscv.c (GP_NAME): New macro.
766         (riscv_global_pointer_value): Use it.
767         (_bfd_riscv_relax_lui): If symbol and global pointer are in same
768         output section, consider only that section's alignment.
769
770 2017-02-23  Maciej W. Rozycki  <macro@imgtec.com>
771
772         * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
773         * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
774         * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
775         * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
776
777 2017-02-23  Maciej W. Rozycki  <macro@imgtec.com>
778
779         * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
780         <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
781         or misaligned.
782
783 2017-02-23  Alan Modra  <amodra@gmail.com>
784
785         PR 20744
786         * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
787         16D relocations.
788         (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
789         (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
790         relocs.
791
792 2017-02-22  Maciej W. Rozycki  <macro@imgtec.com>
793
794         PR ld/20828
795         * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
796         processing ahead of the call to `elf_gc_sweep_symbol'.
797
798 2017-02-22  Nick Clifton  <nickc@redhat.com>
799
800         PR binutils/21193
801         * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
802         created section 4-byte alignment.
803
804 2017-02-22  Alan Modra  <amodra@gmail.com>
805
806         * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
807         on .got or .plt output section being discarded by script.
808         * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise.  Move
809         vxworks splt temp.
810
811 2017-02-21  Alan Modra  <amodra@gmail.com>
812
813         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
814         DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
815
816 2017-02-20  Alan Modra  <amodra@gmail.com>
817
818         PR 21181
819         * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
820         if DT_RELSZ/DT_RELASZ is zero.
821
822 2017-02-17  Nick Clifton  <nickc@redhat.com>
823
824         * compress.c (bfd_get_full_section_contents): Remember to reduce
825         compressed size by the sizeof the compression header when
826         decompressing the contents.
827
828 2017-02-17  Pedro Alves  <palves@redhat.com>
829
830         * srec.c (Chunk): Rename to ...
831         (_bfd_srec_len): ... this.
832         (S3Forced): Rename to ...
833         (_bfd_srec_forceS3): ... this.
834         * objcopy.c: Adjust all references.
835
836 2017-02-17  Pedro Alves  <palves@redhat.com>
837
838         * archive.c (bsd_write_armap): Rename to ...
839         (_bfd_bsd_write_armap): ... this.
840         (coff_write_armap): Rename to ...
841         (_bfd_coff_write_armap): ... this.
842         * libbfd-in.h (bsd_write_armap): Rename to ...
843         (_bfd_bsd_write_armap): ... this.
844         (coff_write_armap): Rename to ...
845         (_bfd_coff_write_armap): ... this.
846         * aout-target.h, aout-tic30.c: Adjust all users.
847         * libbfd.h: Regenerate.
848
849 2017-02-17  Pedro Alves  <palves@redhat.com>
850
851         * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
852         (warn_deprecated): Rename to ...
853         (_bfd_warn_deprecated): ... this.
854         * libbfd.c (warn_deprecated): Rename to ...
855         (_bfd_warn_deprecated): ... this.
856         * bfd-in2.h: Regenerate.
857
858 2017-02-17  Pedro Alves  <palves@redhat.com>
859
860         * bfdio.c (real_ftell): Rename to ...
861         (_bfd_real_ftell): ... this.
862         (real_fseek): Rename to ...
863         (_bfd_real_fseek): ... this.
864         (real_fopen): Rename to ...
865         (_bfd_real_fopen): ... this.
866         * libbfd-in.h (real_ftell): Rename to ...
867         (_bfd_real_ftell): ... this.
868         (real_fseek): Rename to ...
869         (_bfd_real_fseek): ... this.
870         (real_fopen): Rename to ...
871         (_bfd_real_fopen): ... this.
872         * cache.c, dwarf2.c, opncls.c: Adjust all callers.
873         * libbfd.h: Regenerate.
874
875 2017-02-17  Pedro Alves  <palves@redhat.com>
876
877         * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
878         * libbfd.c (read_unsigned_leb128): Rename to ...
879         (_bfd_read_unsigned_leb128): ... this.
880         (read_signed_leb128): Rename to ...
881         (_bfd_read_signed_leb128): ... this.
882         (safe_read_leb128): Rename to ...
883         (_bfd_safe_read_leb128): ... this.
884         * libbfd-in.h (read_unsigned_leb128): Rename to ...
885         (_bfd_read_unsigned_leb128): ... this.
886         (read_signed_leb128): Rename to ...
887         (_bfd_read_signed_leb128): ... this.
888         (safe_read_leb128): Rename to ...
889         (_bfd_safe_read_leb128): ... this.
890         * libbfd.h: Renegerate.
891
892 2017-02-16  Andrew Burgess  <andrew.burgess@embecosm.com>
893
894         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
895         before trying to fine matching file and line information.
896
897 2017-02-16  Andrew Burgess  <andrew.burgess@embecosm.com>
898
899         * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
900         (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
901         not match current bfd, then reload debug information.  Record bfd
902         we're loading debug info for in the stash.  If we have debug
903         informatin in the cache then perform section placement before
904         returning.
905
906 2017-02-16  Alan Modra  <amodra@gmail.com>
907
908         PR 21000
909         * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
910         * elfxx-target.h (elf_backend_no_page_alias): Define.
911         (elfNN_bed): Init new field.
912         * elf.c (assign_file_positions_for_load_sections): If no_page_alias
913         ensure PT_LOAD segment starts on a new page.
914         * elf32-hppa.c (elf_backend_no_page_alias): Define.
915
916 2017-02-16  Alan Modra  <amodra@gmail.com>
917
918         PR 21132
919         * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
920         if pic.
921
922 2017-02-16  Jiong Wang <jiong.wang@arm.com>
923
924         * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
925         * bfd-in2.h: Regenerated.
926
927 2017-02-15  H.J. Lu  <hongjiu.lu@intel.com>
928
929         PR ld/21168
930         * elf32-i386.c (elf_i386_relocate_section): Allow
931         "lea foo@GOT, %reg" in PIC.
932
933 2017-02-15  H.J. Lu  <hongjiu.lu@intel.com>
934
935         PR ld/20244
936         * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
937         symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
938         error against local IFUNC symbol without a base register for
939         PIC.
940
941 2017-02-15  Maciej W. Rozycki  <macro@imgtec.com>
942
943         * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
944         `%P: %H:' with `info->callbacks->einfo'.
945         (ppc_elf_relocate_section): Likewise.
946         * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
947         (ppc64_elf_edit_toc): Likewise.
948         (ppc64_elf_relocate_section): Likewise.
949
950 2017-02-14  Alan Modra  <amodra@gmail.com>
951
952         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
953         --gc-keep-exported, and test versioned field of sym rather than
954         looking for @ in name.
955
956 2017-02-13  Palmer Dabbelt  <palmer@dabbelt.com>
957
958         * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
959         __global_pointer$.
960
961 2017-02-13  Nick Clifton  <nickc@redhat.com>
962
963         PR binutils/21151
964         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
965         unit length field.
966
967 2017-02-07  Andrew Waterman  <andrew@sifive.com>
968
969         * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
970         entry size if PLT header is written.
971
972 2017-02-06  Sheldon Lobo  <sheldon.lobo@oracle.com>
973
974         Fix sparc64 dynamic relocation processing to use the dynamic
975         symbol count.
976         * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
977         to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
978         should be used.
979
980 2017-02-03  Nick Clifton  <nickc@redhat.com>
981
982         PR 21096
983         * coffcode.h (coff_write_object_contents): Enlarge size of
984         s_name_buf in order to avoid compile time warning about possible
985         integer truncation.
986         * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
987         32-bits of insn value before printing into buffer.
988
989 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
990
991         * elfxx-mips.c (mips_elf_hash_sort_data): Add
992         `max_local_dynindx'.
993         (mips_elf_sort_hash_table): Handle it.
994         (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
995         symbols bump up `max_local_dynindx' rather than
996         `max_non_got_dynindx'.
997
998 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
999
1000         * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
1001         `min_got_dynindx', `max_unref_got_dynindx' and
1002         `max_non_got_dynindx' members to the `bfd_size_type' data type.
1003         (mips_elf_sort_hash_table): Adjust accordingly.
1004
1005 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
1006
1007         * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
1008         to access the hash table.
1009
1010 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
1011
1012         * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
1013         non-NULL `htab' to the beginning.
1014
1015 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
1016
1017         * elflink.c (elf_gc_sweep): Wrap overlong line.
1018
1019 2017-01-30  Maciej W. Rozycki  <macro@imgtec.com>
1020
1021         * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
1022         (_bfd_mips_elf_linker_flags): ... this.  Add another parameter.
1023         * elfxx-mips.c (mips_elf_link_hash_table): Add
1024         `ignore_branch_isa' member.
1025         (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
1026         in branch relocation calculation as an error if
1027         `ignore_branch_isa' has been set.
1028         (_bfd_mips_elf_insn32): Rename to...
1029         (_bfd_mips_elf_linker_flags): ... this.  Rename the `on'
1030         parameter to `insn32' and add an `ignore_branch_isa' parameter.
1031         Handle the new parameter.
1032
1033 2017-01-27  Hans-Peter Nilsson  <hp@axis.com>
1034
1035         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
1036         local variable dynobj.
1037
1038         PR ld/20995
1039         * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
1040         (elf_cris_adjust_dynamic_symbol): Place variables copied into the
1041         executable from read-only sections into sdynrelro.
1042         (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
1043         dynamic relocs in sdynrelro.
1044         (elf_backend_want_dynrelro): Define.
1045
1046 2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>
1047
1048         * config.bfd (*-*-rtemsaout*): Mark as removed.
1049
1050 2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>
1051
1052         * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
1053         (arm-*-rtems*): Move to (arm*-*-eabi*).
1054         (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
1055         (m68-*-rtems*): Move to (m68*-*-elf*).
1056
1057 2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>
1058
1059         * config.bfd (*-*-rtemscoff*): Mark as removed.
1060
1061 2017-01-24  Maciej W. Rozycki  <macro@imgtec.com>
1062
1063         PR ld/20828
1064         * elflink.c (bfd_elf_record_link_assignment): Revert last
1065         change and don't ever clear `forced_local'.  Set `mark'
1066         unconditionally.
1067         (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
1068         file.
1069         (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
1070         (bfd_elf_size_dynamic_sections): ... here.
1071         * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
1072         and set `mark' instead in `__tls_get_addr_opt' processing.
1073         * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
1074
1075 2017-01-24  Alan Modra  <amodra@gmail.com>
1076
1077         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
1078         where dynamic relocs are preferable.  Allow ifunc too.
1079         (ensure_undefweak_dynamic): New function.
1080         (allocate_dynrelocs): Use it here.  Move plt handling last and
1081         don't make symbols dynamic, simplifying loop.  Only make undef
1082         weak symbols with GOT entries dynamic.  Correct condition
1083         for GOT relocs.  Handle dynamic relocs on ifuncs.  Correct
1084         comments.  Remove goto.
1085         (ppc_elf_relocate_section): Correct test for using dynamic
1086         symbol on GOT relocs.  Rearrange test for emitting GOT relocs
1087         to suit.  Set up explicit tls_index entries and implicit GOT
1088         tls_index entries resolvable at link time for
1089         __tls_get_addr_opt.  Simplify test to clear mem for prelink.
1090         * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
1091         (ensure_undefweak_dynamic): New function.
1092         (allocate_dynrelocs): Use it here.  Only make undef weak symbols
1093         with GOT entries dynamic.  Remove unnecessary test of
1094         WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
1095         (ppc64_elf_relocate_section): Correct test for using dynamic
1096         symbol on GOT relocs.  Rearrange test for emitting GOT relocs
1097         to suit.  Set up explicit tls_index entries and implicit GOT
1098         tls_index entries resolvable at link time for __tls_get_addr_opt.
1099         Simplify expression to clear mem for prelink.
1100
1101 2017-01-23  Yury Norov  <ynorov@caviumnetworks.com>
1102
1103         * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
1104
1105 2017-01-20  Jiong Wang <jiong.wang@arm.com>
1106
1107         * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
1108         (elf_backend_hash_symbol): Define.
1109
1110 2017-01-18  Maciej W. Rozycki  <macro@imgtec.com>
1111
1112         PR ld/20828
1113         * elflink.c (bfd_elf_record_link_assignment): Clear any
1114         `forced_local' marking for DSO symbols that are not being
1115         provided.
1116
1117 2017-01-17  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
1118
1119         * elfnn-riscv.c (riscv_elf_object_p): New function.
1120
1121 2017-01-12  H.J. Lu  <hongjiu.lu@intel.com>
1122
1123         PR ld/21038
1124         * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
1125         plt_bnd_eh_frame.
1126         (elf_x86_64_check_relocs): Create .eh_frame section for the
1127         .plt.bnd section.
1128         (elf_x86_64_size_dynamic_sections): Allocate and initialize
1129         .eh_frame section for the .plt.bnd section.
1130         (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
1131         for the .plt.bnd section.
1132
1133 2017-01-12  Nick Clifton  <nickc@redhat.com>
1134
1135         PR binutils/20876
1136         * opncls.c (find_separate_debug_file): Add include_dirs
1137         parameter.  Only include the directory part of the bfd's filename
1138         in search paths if include_dirs is true.  Add a couple of extra
1139         locations for looking for debug files.
1140         ( bfd_follow_gnu_debuglink): Update invocation of
1141         find_separate_debug_file.
1142         (bfd_follow_gnu_debugaltlink): Likewise.
1143         (get_build_id): New function: Finds the build-id of the given bfd.
1144         (get_build_id_name): New function: Computes the name of the
1145         separate debug info file for a bfd, based upon its build-id.
1146         (check_build_id_file): New function: Checks to see if a separate
1147         debug info file exists at the given location, and that its
1148         build-id matches that of the original bfd.
1149         (bfd_follow_build_id_debuglink): New function: Finds a separate
1150         debug info file for a given bfd by using the build-id method.
1151         * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
1152         method of locating a separate debug info file before using the
1153         debuglink method.
1154         * bfd-in2.h: Regenerate.
1155
1156 2017-01-11  H.J. Lu  <hongjiu.lu@intel.com>
1157
1158         PR ld/21038
1159         * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
1160         (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
1161         elf_x86_64_eh_frame_plt_got.
1162         (elf_x86_64_size_dynamic_sections): Get unwind info from
1163         elf_x86_64_bnd_arch_bed for the BND PLT.
1164
1165 2017-01-11  Jeremy Soller  <jackpot51@gmail.com>
1166
1167         * config.bfd: Add entries for i686-redox and x86_64-redox.
1168
1169 2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>
1170
1171         * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
1172         to 4 bytes.
1173         * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
1174         .eh_frame section to 4 bytes for x32.
1175         (elf_x86_64_check_relocs): Likewise.
1176
1177 2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>
1178
1179         PR ld/20830
1180         * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
1181         (PLT_GOT_FDE_LENGTH): Likewise.
1182         (elf_i386_plt_layout): Add eh_frame_plt_got and
1183         eh_frame_plt_got_size.
1184         (elf_i386_plt): Updated.
1185         (elf_i386_link_hash_table): Add plt_got_eh_frame.
1186         (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
1187         (elf_i386_size_dynamic_sections): Allocate and initialize
1188         .eh_frame section for .plt.got.
1189         (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
1190         .plt.got.
1191         (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
1192         eh_frame_plt_got_size.
1193         * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
1194         (PLT_GOT_FDE_LENGTH): Likewise.
1195         (elf_x86_64_backend_data): Add eh_frame_plt_got and
1196         eh_frame_plt_got_size.
1197         (elf_x86_64_arch_bed): Updated.
1198         (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
1199         eh_frame_plt_got_size.
1200         (elf_x86_64_nacl_arch_bed): Likewise.
1201         (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
1202         (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
1203         (elf_x86_64_size_dynamic_sections): Allocate and initialize
1204         .eh_frame section for .plt.got.
1205         (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
1206         for .plt.got.
1207
1208 2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>
1209
1210         * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1211         plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
1212
1213 2017-01-09  Nick Clifton  <nickc@redhat.com>
1214
1215         * dwarf2.c (lookup_address_in_function_table): Return early if
1216         there are no functions in the given comp unit, or if the high
1217         address of the last function in the comp unit is less than the
1218         desired address.
1219
1220 2017-01-09  Nick Clifton  <nickc@redhat.com>
1221
1222         PR binutils/21013
1223         * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
1224         message if there are too many symbols to load.
1225
1226 2017-01-04  James Clarke  <jrtc27@jrtc27.com>
1227
1228         * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
1229         if relocs are cached.
1230
1231 2017-01-03  Rich Felker  <bugdal@aerifal.cx>
1232
1233         PR ld/21017
1234         * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
1235         for R_MICROBLAZE_GOTOFF_64.
1236
1237 2017-01-03  Nick Clifton  <nickc@redhat.com>
1238
1239         * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
1240         warning about using a possibly uninitialised variable.
1241
1242 2017-01-02  Alan Modra  <amodra@gmail.com>
1243
1244         * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
1245         (allocate_plt_static, allocate_dynrelocs): Use it.
1246
1247 2017-01-02  Alan Modra  <amodra@gmail.com>
1248
1249         * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
1250         .PARISC.unwind section.
1251
1252 2017-01-02  Alan Modra  <amodra@gmail.com>
1253
1254         PR ld/20989
1255         * elfxx-sparc.c (gdop_relative_offset_ok): New function.
1256         (_bfd_sparc_elf_relocate_section): Use it to validate GOT
1257         indirect to GOT pointer relative code edit.
1258
1259 2017-01-02  Alan Modra  <amodra@gmail.com>
1260
1261         Update year range in copyright notice of all files.
1262
1263 For older changes see ChangeLog-2016
1264 \f
1265 Copyright (C) 2017 Free Software Foundation, Inc.
1266
1267 Copying and distribution of this file, with or without modification,
1268 are permitted in any medium without royalty provided the copyright
1269 notice and this notice are preserved.
1270
1271 Local Variables:
1272 mode: change-log
1273 left-margin: 8
1274 fill-column: 74
1275 version-control: never
1276 End: