fbdd0c25b60f60db25bda6dc77fed6a23e3d1aab
[external/binutils.git] / bfd / ChangeLog
1 2018-12-31  Alan Modra  <amodra@gmail.com>
2
3         * elf64-ppc.c (ppc64_elf_relocate_section <tls_ldgd_opt>): When
4         editing an old-style __tls_get_addr call, replace a toc restore
5         insn with a nop.
6
7 2018-12-28  Alan Modra  <amodra@gmail.com>
8
9         PR 24015
10         * elf.c (bfd_elf_get_default_section_type): Make common sections
11         SHT_NOBITS.
12         * linker.c (bfd_generic_define_common_symbol): Clear
13         SEC_HAS_CONTENTS.
14
15 2018-12-28  Alan Modra  <amodra@gmail.com>
16
17         PR 23966
18         * libbfd.c (SSIZE_MAX): Define.
19         (bfd_malloc, bfd_realloc): Don't cast size to long to check for
20         "negative" values, compare against SSIZE_MAX instead.
21
22 2018-12-23  H.J. Lu  <hongjiu.lu@intel.com>
23
24         * elf32-i386.c (elf_i386_rtype_to_howto): Remove the unused bfd
25         pointer argument.
26         (elf_i386_info_to_howto_rel): Updated.
27         (elf_i386_tls_transition): Likewise.
28         (elf_i386_relocate_section): Likewise.
29
30 2018-12-20  H.J. Lu  <hongjiu.lu@intel.com>
31
32         * elf32-i386.c (elf_i386_relocate_section): Call
33         elf_i386_rtype_to_howto to get reloc_howto_type pointer.
34         * elf64-x86-64.c (elf_x86_64_relocate_section): Call
35         elf_x86_64_rtype_to_howto to get reloc_howto_type pointer.
36
37 2018-12-18  Alan Modra  <amodra@gmail.com>
38
39         * Makefile.am (bfdinclude_HEADERS): Add bfd_stdint.h.
40         (BFD_H_DEPS): Add include/diagnostics.h.
41         (LOCAL_H_DEPS): Add bfd_stdint.h.
42         * bfd-in.h: Include bfd_stdint.h.
43         * arc-plt.h: Don't include stdint.h.
44         * coff-rs6000.c: Likewise.
45         * coff64-rs6000.c: Likewise.
46         * elfxx-riscv.c: Likewise.
47         * cache.c: Don't include bfd_stdint.h.
48         * elf32-arm.c: Likewise.
49         * elf32-avr.c: Likewise.
50         * elf32-nds32.c: Likewise.
51         * elf32-rl78.c: Likewise.
52         * elf32-rx.c: Likewise.
53         * elf32-wasm32.c: Likewise.
54         * elf64-nfp.c: Likewise.
55         * elflink.c: Likewise.
56         * elfnn-aarch64.c: Likewise.
57         * elfnn-ia64.c: Likewise.
58         * elfxx-ia64.c: Likewise.
59         * elfxx-x86.h: Likewise.
60         * wasm-module.c: Likewise, and don't include sysdep.h twice.
61         * elf-nacl.h: Don't include bfd.h.
62         * mach-o.h: Likewise.
63         * elfxx-aarch64.c: Include bfd.h and elf-bfd.h.
64         * elfxx-aarch64.h: Don't include bfd.h, elf-bfd.h or stdint.h.
65         * mach-o-aarch64.c: Include mach-o.h later.
66         * mach-o-arm.c: Likewise.
67         * mach-o-i386.c: Likewise.
68         * mach-o-x86-64.c: Likewise.
69         * mach-o.c: Likewise.
70         * sysdep.h: Don't include ansidecl.h or sys/stat.h.
71         * Makefile.in: Regenerate.
72         * bfd-in2.h: Regenerate.
73
74 2018-12-18  Alan Modra  <amodra@gmail.com>
75
76         PR 23980
77         * elf32-i386.c (elf_i386_relocate_section): Exit with wrong format
78         error rather than asserting input file is as expected.
79         * elf32-s390.c (elf_s390_relocate_section): Likewise.
80         * elf32-sh.c (sh_elf_relocate_section): Likewise.
81         * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
82         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
83         * elf64-s390.c (elf_s390_relocate_section): Likewise.
84         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
85         * elf32-ppc.c (ppc_elf_relocate_section): Exit with wrong format
86         error if input file is not ppc32 ELF.
87
88 2018-12-18  Alan Modra  <amodra@gmail.com>
89
90         PR 23980
91         * elf64-ppc.c (ppc64_elf_hide_symbol): Check hash table type
92         before referencing ppc64-only fields of hash entries.
93
94 2018-12-17  Alan Modra  <amodra@gmail.com>
95
96         PR 23994
97         * aoutx.h: Include limits.h.
98         (get_reloc_upper_bound): Detect long overflow and return a file
99         too big error if it occurs.
100         * elf.c: Include limits.h.
101         (_bfd_elf_get_symtab_upper_bound): Detect long overflow and return
102         a file too big error if it occurs.
103         (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
104         (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
105
106 2018-12-14  H.J. Lu  <hongjiu.lu@intel.com>
107
108         PR ld/23900
109         * elf.c (get_program_header_size): Add a PT_GNU_PROPERTY
110         segment for NOTE_GNU_PROPERTY_SECTION_NAME.
111         (_bfd_elf_map_sections_to_segments): Create a PT_GNU_PROPERTY
112         segment for NOTE_GNU_PROPERTY_SECTION_NAME.
113         * elfxx-x86.c (_bfd_elf_link_setup_gnu_properties): Don't set
114         GNU_PROPERTY_X86_UINT32_VALID.
115
116 2018-12-11  Max Filippov  <jcmvbkbc@gmail.com>
117
118         * elf32-xtensa.c (elf_xtensa_do_reloc): Limit const16 opcode
119         immediate field to 16 least significant bits.
120
121 2018-12-11  H.J. Lu  <hongjiu.lu@intel.com>
122
123         * elf32-xc16x.c (elf32_xc16x_rtype_to_howto): New function.
124         (elf32_xc16x_relocate_section): Call elf32_xc16x_rtype_to_howto
125         instead of xc16x_reloc_type_lookup to get reloc_howto_type.
126
127 2018-12-07  H.J. Lu  <hongjiu.lu@intel.com>
128
129         PR ld/23958
130         * elflink.c (_bfd_elf_add_default_symbol): Override the previous
131         definition from IR object.
132
133 2018-12-08  Stafford Horne  <shorne@gmail.com>
134
135         * elf32-or1k.c (or1k_grok_prstatus): New function.
136         (or1k_grok_psinfo): Likewise.
137
138 2018-12-07  H.J. Lu  <hongjiu.lu@intel.com>
139
140         * elf-properties.c (elf_find_and_remove_property): Add a
141         bfd_boolean argument to indicate if the property should be
142         removed.
143         (elf_merge_gnu_property_list): Updated.  Report
144         property change in linker map file.
145         (elf_get_gnu_property_section_size): Skip property_remove
146         properties.
147         (elf_write_gnu_properties): Likewise.
148         (_bfd_elf_link_setup_gnu_properties): Report property merge
149         in linker map file.  Pass abfd to elf_merge_gnu_property_list.
150
151 2018-12-07  Alan Modra  <amodra@gmail.com>
152
153         PR 23952
154         * syms.c (_bfd_generic_read_minisymbols): Free syms before
155         returning with zero symcount.
156
157 2018-12-06  Alan Modra  <amodra@gmail.com>
158
159         * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_VLE_ADDR20>): Correct
160         mask and shift value.
161         (ppc_elf_vle_split16): Use E_OPCODE_MASK.  Handle e_li
162         specially.
163
164 2018-12-05  Sam Tebbs  <sam.tebbs@arm.com>
165
166         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Add check for 'B'.
167
168 2018-12-04  H.J. Lu  <hongjiu.lu@intel.com>
169
170         PR ld/23372
171         * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Don't remove
172         empty properties for GNU_PROPERTY_X86_COMPAT_ISA_1_USED and
173         GNU_PROPERTY_X86_UINT32_OR_AND.
174         (_bfd_x86_elf_link_fixup_gnu_properties): Likewise.
175
176 2018-12-03  Kito Cheng  <kito@andestech.com>
177
178         * elfxx-riscv.h (RISCV_DONT_CARE_VERSION): New macro.
179         (struct riscv_subset_t): New structure.
180         (riscv_subset_t): New typedef.
181         (riscv_subset_list_t): New structure.
182         (riscv_release_subset_list): New prototype.
183         (riscv_add_subset): Likewise.
184         (riscv_lookup_subset): Likewise.
185         (riscv_lookup_subset_version): Likewise.
186         (riscv_release_subset_list): Likewise.
187         * elfxx-riscv.c: Include safe-ctype.h.
188         (riscv_parsing_subset_version): New function.
189         (riscv_supported_std_ext): Likewise.
190         (riscv_parse_std_ext): Likewise.
191         (riscv_parse_sv_or_non_std_ext): Likewise.
192         (riscv_parse_subset): Likewise.
193         (riscv_add_subset): Likewise.
194         (riscv_lookup_subset): Likewise.
195         (riscv_lookup_subset_version): Likewise.
196         (riscv_release_subset_list): Likewise.
197
198 2018-12-01  H.J. Lu  <hongjiu.lu@intel.com>
199
200         PR ld/23930
201         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Update
202         the iplt section alignment if it is non-empty.
203         (_bfd_x86_elf_link_setup_gnu_properties): Set plt.iplt_alignment
204         and delay setting the iplt section alignment.
205         * elfxx-x86.h (elf_x86_plt_layout): Add iplt_alignment.
206
207 2018-11-30  Nick Clifton  <nickc@redhat.com>
208
209         PR 23942
210         * elfcode.h (elf_object_p): Check for corrupt input files with
211         more program headers than can actually fit in the file.
212
213 2018-11-30  Nick Clifton  <nickc@redhat.com>
214
215         PR 23932
216         * elf.c (IS_CONTAINED_BY_LMA): Add a check for a negative section
217         size.
218         (rewrite_elf_program_header): If no sections are mapped into a
219         segment return an error.
220
221 2018-11-30  Alan Modra  <amodra@gmail.com>
222
223         PR 23937
224         * elf64-ppc.c (write_plt_relocs_for_local_syms): Don't add local
225         entry offset for ifuncs.
226
227 2018-11-29  H.J. Lu  <hongjiu.lu@intel.com>
228
229         PR ld/23929
230         * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Don't
231         merge .note.gnu.property section in IR inputs.
232
233 2018-11-27  Thomas Preud'homme  <thomas.preudhomme@linaro.org>
234
235         * cpu-arm.c (processors): Add processors known to GAS but missing here
236         and reindent.
237         (bfd_arm_update_notes): Add comment explaining why the list of
238         architectures in the switch should not be updated.
239         (architectures): Likewise.
240
241 2018-11-27  Maciej W. Rozycki  <macro@linux-mips.org>
242
243         * elfxx-mips.c (_bfd_mips_elf_check_relocs) <R_MIPS16_HI16>
244         <R_MIPS_HI16, R_MIPS_HIGHER, R_MIPS_HIGHEST, R_MICROMIPS_HI16>
245         <R_MICROMIPS_HIGHER, R_MICROMIPS_HIGHEST>: Also accept an
246         absolute symbol in PIC code.
247
248 2018-11-27  Maciej W. Rozycki  <macro@linux-mips.org>
249
250         * elfxx-mips.c (_bfd_mips_elf_check_relocs) <R_MIPS16_26>
251         <R_MIPS_26, R_MICROMIPS_26_S1>: Use `info->callbacks->einfo'
252         rather than `_bfd_error_handler' to report refused relocations
253         in PIC code and continue processing.  Fix error message: `can
254         not' -> `cannot'.
255
256 2018-11-27  H.J. Lu  <hongjiu.lu@intel.com>
257
258         PR binutils/23919
259         * compress.c (bfd_is_section_compressed_with_header): Initialize
260         *uncompressed_align_pow_p to 0.
261
262 2018-11-27  Tamar Christina  <tamar.christina@arm.com>
263
264         PR ld/23904
265         * elfnn-aarch64.c (_bfd_aarch64_adrp_p): Use existing constants.
266         (_bfd_aarch64_erratum_843419_branch_to_stub): Use _bfd_aarch64_adrp_p.
267         (struct erratum_835769_branch_to_stub_clear_data): New.
268         (_bfd_aarch64_erratum_843419_clear_stub): New.
269         (clear_erratum_843419_entry): New.
270         (elfNN_aarch64_tls_relax): Use it.
271         (elfNN_aarch64_relocate_section): Pass input_section.
272         (aarch64_map_one_stub): Handle branch type none as valid.
273
274 2018-11-27  Mark Wielaard  <mark@klomp.org>
275
276         PR binutils/23919
277         * bfd.c (bfd_update_compression_header): Explicitly set alignment.
278         (bfd_check_compression_header): Add uncompressed_alignment_power
279         argument. Check ch_addralign is a power of 2.
280         * bfd-in2.h: Regenerated.
281         * compress.c (bfd_compress_section_contents): Get and set
282         orig_uncompressed_alignment_pow if section is decompressed.
283         (bfd_is_section_compressed_with_header): Add and get
284         uncompressed_align_pow_p argument.
285         (bfd_is_section_compressed): Add uncompressed_align_power argument
286         to bfd_is_section_compressed_with_header call.
287         (bfd_init_section_decompress_status): Get and set
288         uncompressed_alignment_power.
289         * elf.c (_bfd_elf_make_section_from_shdr): Add
290         uncompressed_align_power argument to
291         bfd_is_section_compressed_with_header call.
292
293 2018-11-21  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
294
295         * elf32-msp430.c (elf32_msp430_merge_mspabi_attributes): Do not
296         error when .MSP430.attributes section is missing from objects
297         created by LTO.
298
299 2018-11-13  Jim Wilson  <jimw@sifive.com>
300
301         * elfnn-riscv.c (riscv_float_abi_string): New.
302         (_bfd_riscv_elf_merge_private_bfd_data): Use it for error message.
303
304 2018-11-09  Bernhard M. Wiedemann  <bwiedemann@suse.de>
305
306         * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Correct comment
307         concerning timestamp insertion.
308
309 2018-11-09  Cupertino Miranda  <cmiranda@synopsys.com>
310
311         * arc-got.h (arc_got_entry_type_for_reloc): Changed to
312         correct static TLS relocs.
313         * elf32-arc.c (elf_arc_check_relocs): Introduced warning to
314         TLS relocs which require -fPIC.
315         (arc_create_forced_local_got_entries_for_tls): Created.
316         Traverses list of GOT entries to be resolved statically
317         when needed.
318         (elf_arc_finish_dynamic_sections): Changed. Calls
319         arc_create_forced_local_got_entries_for_tls for each known
320         possibly GOT symbol.
321
322 2018-11-09  rhn  <sowaac.rhn@porcupinefactory.org>
323
324         PR 23699
325         * ihex.c (ihex_write_object_contents): Check for sign extended
326         addresses that cannot be supported in the ihex format.
327
328 2018-11-09  Claudiu Zissulescu  <claziss@synopsys.com>
329
330         * arc-got.h (arc_get_local_got_ents): Revamp it; use
331         elf_local_got_ents to store the local got list.
332         (get_got_entry_list_for_symbo): Restructure it.
333         * elf32-arc.c (elf_arc_relocate_section): Correct the call to
334         get_got_entry_list_for_symbol.
335
336 2018-11-07  Nick Clifton  <nickc@redhat.com>
337
338         * po/fr.po: Updated French translation.
339         * po/pt.po: Updated Portuguese translation.
340
341 2018-11-06  Roman Bolshakov <r.bolshakov@yadro.com>
342             Saagar Jha  <saagar@saagarjha.com>
343
344         * mach-o.h: Add new enums for BFD_MACH_O_PLATFORM_MACOS,
345         BFD_MACH_O_PLATFORM_IOS, BFD_MACH_O_PLATFORM_TVOS,
346         BFD_MACH_O_PLATFORM_WATCHOS, BFD_MACH_O_PLATFORM_BRIDGEOS,
347         BFD_MACH_O_TOOL_CLANG, BFD_MACH_O_TOOL_SWIFT, BFD_MACH_O_TOOL_LD.
348         (struct bfd_mach_o_note_command): New.
349         (struct bfd_mach_o_build_version_tool): New.
350         (struct bfd_mach_o_build_version_command): New.
351         (bfd_mach_o_read_version_min): Don't split version into
352         a few fields. Rename reserved to sdk.
353         * mach-o.c (bfd_mach_o_read_version_min): Don't split version into a
354         few fields. Rename reserved to sdk.
355         (bfd_mach_o_read_command): Handle LC_VERSION_MIN_TVOS, LC_NOTE,
356         LC_BUILD_VERSION.
357         (bfd_mach_o_read_note): New.
358         (bfd_mach_o_read_build_version): New.
359
360 2018-11-07  Yoshinori Sato  <ysato@users.sourceforge.jp>
361
362         * config.bfd: Add rx-*-linux.
363         * congigure.ac: Likewise.
364         * elf32-rx.c (rx_linux_object_p): New function.
365         (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME)
366         (elf_backend_object_p, elf32_bed): Define rx-*-linux.
367         * targets.c: Add rx_elf32_linux_le_vec.
368         * configure: Regenerate.
369
370 2018-11-06  Romain Margheriti  <lilrom13@gmail.com>
371
372         PR 23742
373         * mach-o.c (bfd_mach_o_read_command): Accept and ignore
374         BFD_MACH_O_LC_LINKER_OPTIONS and BFD_MACH_O_LC_BUILD_VERSION
375         commands.
376
377 2018-11-02  Alan Modra  <amodra@gmail.com>
378
379         PR 23850
380         * elf.c (bfd_section_from_shdr): Treat SHF_ALLOC SHT_REL* sections
381         in an executable or shared library as normal sections.
382
383 2018-10-31  Renlin Li  <renlin.li@arm.com>
384
385         * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Don't create got
386         section for Local Exec TLS model.
387
388 2018-10-24  H.J. Lu  <hongjiu.lu@intel.com>
389
390         PR ld/23818
391         * elflink.c (_bfd_elf_link_assign_sym_version): Hide symbols
392         defined in discarded input sections.
393
394 2018-10-24  Alan Modra  <amodra@gmail.com>
395
396         * elf32-arm.c (elf32_arm_size_stubs): Ignore as-needed libs that
397         were not needed.
398
399 2018-10-23  Alan Modra  <amodra@gmail.com>
400
401         PR 23806
402         * merge.c (_bfd_add_merge_section): Don't attempt to merge
403         sections with ridiculously large alignments.
404
405 2018-10-23  Alan Modra  <amodra@gmail.com>
406
407         PR 23805
408         * elflink.c (elf_link_input_bfd): Don't segfault on finding
409         STT_TLS symbols without any TLS sections.  Instead, change the
410         symbol type to STT_NOTYPE.
411
412 2018-10-23  Alan Modra  <amodra@gmail.com>
413
414         PR 23804
415         * merge.c (_bfd_add_merge_section): Don't attempt to merge
416         sections where size is not a multiple of entsize.
417
418 2018-10-20  Alan Modra  <amodra@gmail.com>
419
420         PR 23788
421         * elf.c (section_match): Don't require a size match for SHT_SYMTAB
422         or SHT_STRTAB.
423
424 2018-10-17  Alan Modra  <amodra@gmail.com>
425
426         PR 23653
427         * elflink.c (_bfd_elf_link_create_dynstrtab): Match elf_object_id
428         too when choosing dynobj.
429
430 2018-10-16  Alan Modra  <amodra@gmail.com>
431
432         * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Simplify
433         PE_DEBUG_DATA size checks.
434
435 2018-10-16  Alan Modra  <amodra@gmail.com>
436
437         PR 23781
438         * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Free data
439         before returning.
440
441 2018-10-16  Alan Modra  <amodra@gmail.com>
442
443         PR 23534
444         * init.c (bfd_init): Return an unsigned int.
445         bfd-in2.h: Regenerate.
446
447 2018-10-15  Alan Modra  <amodra@gmail.com>
448
449         PR 23534
450         * init.c (BFD_INIT_MAGIC): Define.
451         (bfd_init): Return BFD_INIT_MAGIC.
452         bfd-in2.h: Regenerate.
453
454 2018-10-13  Alan Modra  <amodra@gmail.com>
455
456         PR 23770
457         PR 23425
458         * reloc.c (_bfd_clear_contents): Replace "location" param with
459         "buf" and "off".  Bounds check "off".  Return status.
460         * cofflink.c (_bfd_coff_generic_relocate_section): Update
461         _bfd_clear_contents call.
462         * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Likewise.
463         * elf32-arc.c (elf_arc_relocate_section): Likewise.
464         * elf32-i386.c (elf_i386_relocate_section): Likewise.
465         * elf32-metag.c (metag_final_link_relocate): Likewise.
466         * elf32-nds32.c (nds32_elf_get_relocated_section_contents): Likewise.
467         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
468         * elf32-visium.c (visium_elf_relocate_section): Likewise.
469         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
470         * elf64-x86-64.c *(elf_x86_64_relocate_section): Likewise.
471         * libbfd-in.h (_bfd_clear_contents): Update prototype.
472         * libbfd.h: Regenerate.
473
474 2018-10-09  Egeyar Bagcioglu  <egeyar.bagcioglu@oracle.com>
475
476         * elflink.c (elf_link_output_extsym): Do not place symbols into a
477         discarded .dynsym.
478
479 2018-10-08  H.J. Lu  <hongjiu.lu@intel.com>
480
481         PR ld/23428
482         * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Don't
483         add GNU_PROPERTY_X86_FEATURE_2_NEEDED to force program header
484         in non-code PT_LOAD segment.
485
486 2018-10-08  Alan Modra  <amodra@gmail.com>
487
488         * elf-nacl.c (nacl_modify_segment_map): Cope with header PT_LOAD
489         lacking sections.
490         * elf.c (_bfd_elf_map_sections_to_segments): Assume file and
491         program headers are required when info->load_phdrs.  Reorganize
492         code handling program headers.  Generate a mapping without
493         sections just for file and program headers when -z separate-code
494         would indicate they should be on a different page to the first
495         section.
496
497 2018-10-08  Alan Modra  <amodra@gmail.com>
498
499         * elf.c (assign_file_positions_for_load_sections): Set p_vaddr
500         from m->p_vaddr_offset for segments without sections.  Invert
501         sign of p_vaddr_offset.
502         (rewrite_elf_program_header, copy_elf_program_header): Save
503         old segment p_vaddr to p_vaddr_offset.  Invert sign of
504         p_vaddr_offset.
505
506 2018-10-08  Alan Modra  <amodra@gmail.com>
507
508         * elf.c (get_program_header_size): Don't count PT_INTERP if
509         .interp is empty.
510         (_bfd_elf_map_sections_to_segments): Don't create PT_INTERP if
511         .interp is empty.
512
513 2018-10-08  Alan Modra  <amodra@gmail.com>
514
515         * elf32-spu.c (spu_elf_modify_segment_map): Don't insert
516         overlays before segment containing headers.
517
518 2018-10-08  Alan Modra  <amodra@gmail.com>
519
520         * elf.c (make_mapping): Cope with zero size array at end of
521         struct elf_segment_map.
522         (_bfd_elf_map_sections_to_segments): Likewise.
523         (rewrite_elf_program_header, copy_elf_program_header): Likewise.
524         (_bfd_elf_map_sections_to_segments): Rename phdr_index to hdr_index.
525
526 2018-10-05  Alan Modra  <amodra@gmail.com>
527
528         * elf32-spu.c (spu_elf_create_sections): Make .note.spu_name
529         SHT_NOTE.
530
531 2018-10-05  Richard Henderson  <rth@twiddle.net>
532
533         * bfd-in2.h: Regenerated.
534         * elf32-or1k.c: (or1k_elf_howto_table): Fix formatting for
535         R_OR1K_PLT26, Add R_OR1K_PCREL_PG21, R_OR1K_GOT_PG21,
536         R_OR1K_TLS_GD_PG21, R_OR1K_TLS_LDM_PG21, R_OR1K_TLS_IE_PG21,
537         R_OR1K_LO13, R_OR1K_GOT_LO13, R_OR1K_TLS_GD_LO13, R_OR1K_TLS_LDM_LO13,
538         R_OR1K_TLS_IE_LO13, R_OR1K_SLO13, R_OR1K_PLTA26.
539         (or1k_reloc_map): Add BFD_RELOC_OR1K_PCREL_PG21,
540         BFD_RELOC_OR1K_GOT_PG21, BFD_RELOC_OR1K_TLS_GD_PG21,
541         BFD_RELOC_OR1K_TLS_LDM_PG21, BFD_RELOC_OR1K_TLS_IE_PG21,
542         BFD_RELOC_OR1K_LO13, BFD_RELOC_OR1K_GOT_LO13,
543         BFD_RELOC_OR1K_TLS_GD_LO13, BFD_RELOC_OR1K_TLS_GD_LO13,
544         BFD_RELOC_OR1K_TLS_LDM_LO13, BFD_RELOC_OR1K_TLS_IE_LO13,
545         BFD_RELOC_OR1K_SLO13, BFD_RELOC_OR1K_PLTA26.
546         (elf_or1k_link_hash_table): Add field saw_plta.
547         (or1k_final_link_relocate): Add value calculations for new relocations.
548         (or1k_elf_relocate_section): Add section relocations for new
549         relocations.
550         (or1k_write_plt_entry): New function.
551         (or1k_elf_finish_dynamic_sections): Add support for PLTA relocations
552         using new l.adrp instruction.  Cleanup PLT relocation code generation.
553         * libbfd.h: Regenerated.
554         * reloc.c: Add BFD_RELOC_OR1K_PCREL_PG21, BFD_RELOC_OR1K_LO13,
555         BFD_RELOC_OR1K_SLO13, BFD_RELOC_OR1K_GOT_PG21, BFD_RELOC_OR1K_GOT_LO13,
556         BFD_RELOC_OR1K_PLTA26, BFD_RELOC_OR1K_TLS_GD_PG21,
557         BFD_RELOC_OR1K_TLS_GD_LO13, BFD_RELOC_OR1K_TLS_LDM_PG21,
558         BFD_RELOC_OR1K_TLS_LDM_LO13, BFD_RELOC_OR1K_TLS_IE_PG21,
559         BFD_RELOC_OR1K_TLS_IE_LO13.
560
561 2018-10-05  Richard Henderson  <rth@twiddle.net>
562
563         * elf32-or1k.c (or1k_elf_relocate_section): Add error for unknown
564         relocations.  Add error for non zero addend with plt and got
565         relocations.  Add error for got and plt references against dynamic, non
566         local, symbols.  Add error when linking non shared liraries with
567         flag_pic.
568
569 2018-10-05  Richard Henderson  <rth@twiddle.net>
570             Stafford Horne  <shorne@gmail.com>
571
572         * bfd-in2.h: Regenerated.
573         * elf32-or1k.c (N_ONES): New macro.
574         (or1k_elf_howto_table): Fix R_OR1K_PLT26 to complain on overflow.
575         Add definitions for R_OR1K_TLS_TPOFF, R_OR1K_TLS_DTPOFF,
576         R_OR1K_TLS_DTPMOD, R_OR1K_AHI16, R_OR1K_GOTOFF_AHI16,
577         R_OR1K_TLS_IE_AHI16, R_OR1K_TLS_LE_AHI16, R_OR1K_SLO16,
578         R_OR1K_GOTOFF_SLO16, R_OR1K_TLS_LE_SLO16.
579         (or1k_reloc_map): Add entries for BFD_RELOC_HI16_S,
580         BFD_RELOC_LO16_GOTOFF, BFD_RELOC_HI16_GOTOFF, BFD_RELOC_HI16_S_GOTOFF,
581         BFD_RELOC_OR1K_TLS_IE_AHI16, BFD_RELOC_OR1K_TLS_LE_AHI16,
582         BFD_RELOC_OR1K_SLO16, BFD_RELOC_OR1K_GOTOFF_SLO16,
583         BFD_RELOC_OR1K_TLS_LE_SLO16.
584         (or1k_reloc_type_lookup): Change search loop to start ad index 0 and
585         also check results before returning.
586         (or1k_reloc_name_lookup): Simplify loop to use R_OR1K_max as index
587         limit.
588         (or1k_final_link_relocate): New function.
589         (or1k_elf_relocate_section): Add support for new AHI and SLO
590         relocations.  Use or1k_final_link_relocate instead of generic
591         _bfd_final_link_relocate.
592         (or1k_elf_check_relocs): Add support for new AHI and SLO relocations.
593         * reloc.c: Add new enums for BFD_RELOC_OR1K_SLO16,
594         BFD_RELOC_OR1K_GOTOFF_SLO16, BFD_RELOC_OR1K_TLS_IE_AHI16,
595         BFD_RELOC_OR1K_TLS_IE_AHI16, BFD_RELOC_OR1K_TLS_LE_AHI16,
596         BFD_RELOC_OR1K_TLS_LE_SLO16.  Remove unused BFD_RELOC_OR1K_GOTOFF_HI16
597         and BFD_RELOC_OR1K_GOTOFF_LO16.
598         * libbfd.h: Regenerated.
599
600 2018-10-04  Jim Wilson  <jimw@sifive.com>
601
602         * elfnn-riscv.c (riscv_elf_size_dynamic_sections): In dynobj->sections
603         loop, handle htab->sdyntdata section.
604
605 2018-10-04  Jose E. Marchesi  <jose.marchesi@oracle.com>
606
607         * elf64-sparc.c (elf64_sparc_output_arch_syms): Do notcorrect the
608         impact of STT_REGISTER symbols in the dynsym sh_info here...
609         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_sections): ...but
610         do it here.
611
612 2018-10-03  H.J. Lu  <hongjiu.lu@intel.com>
613
614         PR ld/23658
615         * elf.c (get_program_header_size): Put all adjacent SHT_NOTE
616         sections with the same section alignment into a single PT_NOTE
617         segment.  Check SHT_NOTE section type instead of section name.
618         (_bfd_elf_map_sections_to_segments): Likewise.
619
620 2018-10-03  Millan Wolff  <mail@milianw.de>
621
622         PR 23715
623         * dwarf2.c (find_abstract_instance): Allow recursive invocations
624         of find_abstract_instance to override the name variable.
625
626 2018-10-03  Nick Clifton  <nickc@redhat.com>
627
628         * po/pt.po: Updated Portuguese translation.
629
630 2018-10-01  Cupertino Miranda <cmiranda@synopsys.com>
631
632         * arc-got.h (relocate_fix_got_relocs_for_got_info): Changed. Take TLS
633         section alignment in consideration for this relocation. Fixed TCB_SIZE
634         offset size to include section alignment.
635         (get_got_entry_list_for_symbol): Changed.
636         * elf32-arc.c (FINAL_SECTSTART): Added this formula macro.
637         (ARC_TLS_DTPOFF) Updated reloc to use new created macro instead.
638         (arc_special_overflow_checks): Fixed TCB_SIZE offsize to include
639         section alignment.
640         (elf_arc_check_relocs): Changed.
641         (elf_arc_finish_dynamic_symbol) Return FALSE in case arc_htab is NULL.
642         (struct elf_arc_link_hash_entry): Moved and changed.
643         (elf_arc_link_hash_newfunc): Changed.
644         (arc_elf_link_hash_table_create): Removed old initializations.
645         (elf_arc_relocate_section, elf_arc_finish_dynamic_symbol): Changed.
646
647 2018-09-28  H.J. Lu  <hongjiu.lu@intel.com>
648
649         * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Use
650         elfclass instead of bed->s->elfclass.
651
652 2018-09-27  Jim Wilson  <jimw@sifive.com>
653
654         * elfnn-riscv.c (riscv_init_pcgp_relocs): Add explanatory comment.
655         (riscv_free_pcgp_relocs, riscv_record_pcgp_reloc): Likewise.
656         (riscv_find_pcgp_hi_reloc, riscv_reocrd_pcgp_lo_reloc): Likewise.
657         (riscv_find_pcgp_lo_reloc): Likewise.
658         (riscv_delete_pcgp_hi_reloc, riscv_use_pcgp_hi_reloc): Delete.
659         (riscv_delete_pcgp_lo_reloc): Likewise.
660         (_bfd_riscv_relax_pc): Don't call riscv_use_pcgp_hi_reloc. Replace
661         calls to riscv_delete_pcgp_lo_reloc and riscv_delete_pcgp_hi_reloc
662         with TRUE.  Mark abfd arg as ATTRIBUTE_UNUSED.
663
664 2018-09-25  Jim Wilson  <jimw@sifive.com>
665
666         * elfnn-riscv.c (riscv_make_plt_header): New arg output_bfd.  Change
667         return type to bfd_boolean.  If EF_RISCV_RVE call _bfd_error_handler
668         and return FALSE.  Return TRUE at end.
669         (riscv_make_plt_entry): Likewise.
670         (riscv_elf_finish_dynamic_symbol): Update call to riscv_make_plt_entry.
671         (riscv_elf_finish_dynamic_sections): Update call to
672         riscv_make_plt_header.
673
674 2018-09-24  Jim Wilson  <jimw@sifive.com>
675
676         * elfnn-riscv.c (_bfd_riscv_relax_pc) <R_RISCV_PCREL_LO12_I>: New local
677         hi_sec_off which is symbol address with addend subtracted.  Use in
678         riscv_find_pcgp_hi_reloc and riscv_record_pcgp_lo_reloc calls.
679
680         * elfnn-riscv.c (riscv_resolve_pcrel_lo_relocs): Add check for reloc
681         overflow with addend.  Use reloc_dangerous instead of reloc_overflow.
682         Add strings for the two errors handled here.
683         (riscv_elf_relocate_section) In case R_RISCV_PCREL_LO12_I, rewrite
684         comment.  Only give error with addend when used with section symbol.
685         In case bfd_reloc_dangerous, update error string.
686
687 2018-09-24  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
688
689         PR gdb/20948
690         * elf.c (_bfd_elf_write_object_contents): Return from function
691         early if abfd->direction == both_direction.
692
693 2018-09-21  Simon Marchi  <simon.marchi@ericsson.com>
694
695         * configure.ac: Check for fls.
696         * elf32-nds32.c (fls): Only define if !HAVE_FLS.
697         * config.in: Re-generate.
698         * configure: Re-generate.
699
700 2018-09-20  Maciej W. Rozycki  <macro@linux-mips.org>
701
702         * config.bfd <rs6000-*-aix5.[01], rs6000-*-aix[5-9]*>: Remove
703         duplicate `case' selectors.
704
705 2018-09-20  Nelson Chu <nelson.chu1990@gmail.com>
706
707         * elf32-nds32.c (nds32_elf_relax_loadstore):
708         Remove the unused target features.
709         (bfd_elf32_nds32_set_target_option): Remove the unused parameters.
710         (nds32_elf_relax_piclo12, nds32_elf_relax_letlslo12,
711         nds32_elf_relax_letlsadd, nds32_elf_relax_letlsls,
712         nds32_elf_relax_pltgot_suff, nds32_elf_relax_got_suff
713         nds32_elf_relax_gotoff_suff, calculate_plt_memory_address,
714         calculate_plt_offset, calculate_got_memory_address,
715         nds32_elf_check_dup_relocs): Removed.
716         All callers changed.
717         * elf32-nds32.h: Remove the unused macros and defines.
718         (elf_nds32_link_hash_table): Remove the unused variable.
719         (bfd_elf32_nds32_set_target_option): Update prototype.
720         (nds32_elf_ex9_init): Removed.
721         * elf32-nds32.c (nds32_convert_32_to_16): Updated.
722         * elf32-nds32.c (HOWTO2, HOWTO3): Define new HOWTO macros
723         to initialize array nds32_elf_howto_table in any order
724         without lots of EMPTY_HOWTO.
725         (nds32_reloc_map): Updated.
726         * reloc.c: Add BFD_RELOC_NDS32_LSI.
727         * bfd-in2.h: Regenerated.
728         * bfd/libbfd.h: Regenerated.
729         * elf32-nds32.c (nds32_elf_relax_howto_table): Add R_NDS32_LSI.
730         (nds32_reloc_map): Likewise.
731         (nds32_elf_relax_flsi): New function.
732         (nds32_elf_relax_section): Support floating load/store relaxation.
733         * elf32-nds32.c (NDS32_GUARD_SEC_P, elf32_nds32_local_gp_offset):
734         New macro.
735         (struct elf_nds32_link_hash_entry): New `offset_to_gp' field.
736         (struct elf_nds32_obj_tdata): New `offset_to_gp' and `hdr_size' fields.
737         (elf32_nds32_allocate_local_sym_info, nds32_elf_relax_guard,
738         nds32_elf_is_target_special_symbol, nds32_elf_maybe_function_sym):
739         New functions.
740         (nds32_info_to_howto_rel): Add BFD_ASSERT.
741         (bfd_elf32_bfd_reloc_type_table_lookup, nds32_elf_link_hash_newfunc,
742         nds32_elf_link_hash_table_create, nds32_elf_relocate_section,
743         nds32_elf_relax_loadstore, nds32_elf_relax_lo12, nds32_relax_adjust_label,
744         bfd_elf32_nds32_set_target_option, nds32_fag_mark_relax): Updated.
745         (nds32_elf_final_sda_base): Improve it to find the better gp value.
746         (insert_nds32_elf_blank): Must consider `len' when inserting blanks.
747         * elf32-nds32.h (bfd_elf32_nds32_set_target_option): Update prototype.
748         (struct elf_nds32_link_hash_table): Add new variable `hyper_relax'.
749         * elf32-nds32.c (elf32_nds32_allocate_dynrelocs): New function.
750         (create_got_section): Likewise.
751         (allocate_dynrelocs, nds32_elf_size_dynamic_sections,
752         nds32_elf_relocate_section, nds32_elf_finish_dynamic_symbol): Updated.
753         (nds32_elf_check_relocs): Fix the issue that the shared library may
754         has TEXTREL entry in the dynamic section.
755         (nds32_elf_create_dynamic_sections): Enable to call readonly_dynrelocs
756         since the TEXTREL issue is fixed in the nds32_elf_check_relocs.
757         (nds32_elf_finish_dynamic_sections): Update and add DT_RELASZ
758         dynamic entry.
759         (calculate_offset): Remove the unused parameter `pic_ext_target' and
760         related codes.
761         All callers changed.
762         (elf_backend_dtrel_excludes_plt): Disable it temporarily since it
763         will cause some errors for our test cases.
764         * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Allow to link the
765         generic object.
766         * reloc.c: Add TLS relocations.
767         * libbfd.h: Regenerated.
768         * bfd-in2.h: Regenerated.
769         * elf32-nds32.h (struct section_id_list_t): New.
770         (elf32_nds32_lookup_section_id, elf32_nds32_check_relax_group,
771         elf32_nds32_unify_relax_group, nds32_elf_unify_tls_model):
772         New prototypes.
773         (elf32_nds32_compute_jump_table_size, elf32_nds32_local_tlsdesc_gotent):
774         New macro.
775         (nds32_insertion_sort, bfd_elf32_nds32_set_target_option,
776         elf_nds32_link_hash_table): Updated.
777         * elf32-nds32.c (enum elf_nds32_tls_type): New.
778         (struct elf32_nds32_relax_group_t, struct relax_group_list_t): New.
779         (elf32_nds32_add_dynreloc, patch_tls_desc_to_ie, get_tls_type,
780         fls, ones32, list_insert, list_insert_sibling, dump_chain,
781         elf32_nds32_check_relax_group, elf32_nds32_lookup_section_id,
782         elf32_nds32_unify_relax_group, nds32_elf_unify_tls_model): New functions.
783         (elf_nds32_obj_tdata): Add new fields.
784         (elf32_nds32_relax_group_ptr, nds32_elf_local_tlsdesc_gotent): New macros.
785         (nds32_elf_howto_table): Add TLS relocations.
786         (nds32_reloc_map): Likewise.
787         (nds32_elf_copy_indirect_symbol, nds32_elf_size_dynamic_sections,
788         nds32_elf_finish_dynamic_symbol, elf32_nds32_allocate_local_sym_info,
789         nds32_elf_relocate_section, bfd_elf32_nds32_set_target_option,
790         nds32_elf_check_relocs, allocate_dynrelocs): Updated.
791         (nds32_elf_relax_section): Call nds32_elf_unify_tls_model.
792         (dtpoff_base): Rename it to `gottpof' and then update it.
793
794 2018-09-20  Alan Modra  <amodra@gmail.com>
795
796         PR 23685
797         * peXXigen.c (pe_print_edata): Correct export address table
798         overflow checks.  Check dataoff against section size too.
799
800 2018-09-20  Alan Modra  <amodra@gmail.com>
801
802         PR 23686
803         * dwarf2.c (read_section): Error when attempting to malloc
804         "(bfd_size_type) -1".
805         * syms.c (_bfd_stab_section_find_nearest_line): Bounds check
806         function_name.  Bounds check reloc address.  Formatting.  Ensure
807         .stabstr zero terminated.
808
809 2018-09-18  Nick Clifton  <nickc@redhat.com>
810
811         PR 23657
812         * elfcode.h (elf_swap_shdr_in): Generate a warning message if an
813         ELF section has contents and size larger than the file size.
814
815 2018-09-14  Maciej W. Rozycki  <macro@mips.com>
816
817         PR ld/21375
818         * elfxx-mips.h (_bfd_mips_elf_hide_symbol): New prototype.
819         (_bfd_mips_elf_linker_flags): Update prototype.
820         * elf32-mips.c (elf_backend_hide_symbol): New macro.
821         * elf64-mips.c (elf_backend_hide_symbol): Likewise.
822         * elfn32-mips.c (elf_backend_hide_symbol): Likewise.
823         * elfxx-mips.c (mips_elf_link_hash_table): Add
824         `use_absolute_zero' and `gnu_target' members.
825         (mips_elf_record_global_got_symbol): Call
826         `_bfd_mips_elf_hide_symbol' rather than
827         `_bfd_elf_link_hash_hide_symbol'.
828         (mips_use_local_got_p): Return FALSE if the symbol is absolute.
829         (mips_elf_obtain_contents): Reorder function.
830         (mips_elf_nullify_got_load): New function.
831         (mips_elf_calculate_relocation): Add `contents' parameter.
832         Nullify GOT loads or if it is not possible, then redirect GOT
833         relocations to the `__gnu_absolute_zero' symbol, for references
834         that are supposed to resolve to zero.
835         (mips_elf_define_absolute_zero): New function.
836         (_bfd_mips_elf_check_relocs): Prepare for arrangements made in
837         `mips_elf_calculate_relocation' for references made via the GOT
838         that are supposed to resolve to zero.
839         (_bfd_mips_elf_hide_symbol): New function.
840         (_bfd_mips_elf_linker_flags): Add the `gnu_target' parameter,
841         set the `gnu_target' member of the MIPS hash table.
842         (MIPS_LIBC_ABI_ABSOLUTE): New enumeration constant.
843         (_bfd_mips_post_process_headers): Use it.
844
845 2018-09-14  Maciej W. Rozycki  <macro@mips.com>
846
847         * elfxx-mips.c (mips_elf_store_contents): New function...
848         (mips_elf_perform_relocation): ... factored out from here.
849
850 2018-09-14  Lifang Xia <lifang_xia@c-sky.com>
851
852         * elf32-csky.c (csky_elf_howto_table): Fill special_function of
853         R_CKCORE_PCREL32.
854         (csky_elf_relocate_section): Add R_CKCORE_PCREL32 process.
855
856 2018-09-14  Alan Modra  <amodra@gmail.com>
857
858         PR 23425
859         * reloc.c (bfd_generic_get_relocated_section_contents): Zero reloc
860         fields in debug sections when reloc is against an undefined symbol
861         and called from bfd_simple_get_relocated_section_contents or
862         similar.
863         * dwarf2.c (find_abstract_instance): Return true for zero offset
864         DW_FORM_ref_addr without returning values.
865
866 2018-09-06  Alan Modra  <amodra@gmail.com>
867
868         PR 23570
869         * elf32-avr.c (elf_avr_special_sections): New.
870         (elf_backend_special_sections): Define.
871
872 2018-09-04  Jose E. Marchesi  <jose.marchesi@oracle.com>
873
874         * elfxx-sparc.c (_bfd_sparc_elf_info_to_howto): Do not issue an
875         error when an invalid relocation is passed;  this is already done
876         by `_bfd_sparc_elf_info_to_howto_ptr'.
877
878 2018-09-04  Jose E. Marchesi  <jose.marchesi@oracle.com>
879
880         * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Issue an
881         error when an invalid symbol index is retrieved in ELF64_R_SYM of
882         a relocation seen in an input file.
883
884 2018-09-03  Jozef Lawrynowicz <jozef.l@mittosystems.com>
885             Alan Modra  <amodra@gmail.com>
886
887         PR 23595
888         elf.c (copy_elf_program_header): When first segment contains
889         only the headers and SHT_NOBITS sections, use segment p_filesz
890         to calculate header and padding size.  Use filepos of the first
891         section otherwise.
892
893 2018-08-31  H.J. Lu  <hongjiu.lu@intel.com>
894
895         PR ld/23600
896         * archures.c (bfd_arch_get_compatible): Allow an IR object with
897         unknown architecture.
898
899 2018-08-31  Alan Modra  <amodra@gmail.com>
900
901         * elf64-ppc.c (num_relocs_for_offset): New function.
902         (emit_relocs_for_offset): New function.
903         (use_global_in_relocs): New function, split out from..
904         (ppc_build_one_stub): ..here.  Output relocations for notoc stubs.
905         (ppc_size_one_stub): Calculate reloc count for notoc stubs.
906         (ppc64_elf_size_stubs): Don't count undefined syms in stub_globals.
907
908 2018-08-31  Alan Modra  <amodra@gmail.com>
909
910         * reloc.c (BFD_RELOC_PPC64_REL16_HIGH, BFD_RELOC_PPC64_REL16_HIGHA),
911         (BFD_RELOC_PPC64_REL16_HIGHER, BFD_RELOC_PPC64_REL16_HIGHERA),
912         (BFD_RELOC_PPC64_REL16_HIGHEST, BFD_RELOC_PPC64_REL16_HIGHESTA):
913         Define.
914         * elf64-ppc.c (ppc64_elf_howto_raw): Add new REL16 howtos.
915         (ppc64_elf_reloc_type_lookup): Translate new REL16 relocs.
916         (ppc64_elf_check_relocs, ppc64_elf_relocate_section): Handle them.
917         * bfd-in2.h: Regenerate.
918         * libbfd.h: Regenerate.
919
920 2018-08-31  Alan Modra  <amodra@gmail.com>
921
922         * elf64-ppc.c: Correct _notoc stub comments.
923         (ppc_build_one_stub): Simplify output of branch for notoc
924         long branch stub.  Don't include label offset of 8 bytes in
925         "off" calculation for notoc plt stub.  Don't emit insns to get pc.
926         (build_offset): Emit insns to get pc here instead.
927         (size_offset): Add 4 extra insns.
928         (plt_stub_size): Adjust for "off" and size_offset changes.
929         (ppc_size_one_stub): Rearrange code into a switch, duplicating
930         some to better match ppc_build_one_stub.
931
932 2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
933
934         * archures.c (bfd_architecture): New machine
935         bfd_mach_mips_gs264e.
936         * bfd-in2.h (bfd_architecture): Likewise.
937         * cpu-mips.c (enum I_xxx): Likewise.
938         (arch_info_struct): Likewise.
939         * elfxx-mips.c (_bfd_elf_mips_mach): Handle
940         E_MIPS_MACH_GS264E.
941         (mips_set_isa_flags): Likewise.
942         (mips_mach_extensions): Map bfd_mach_mips_gs264e to
943         bfd_mach_mips_gs464e extension.
944
945 2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
946
947         * archures.c (bfd_architecture): New machine
948         bfd_mach_mips_gs464e.
949         * bfd-in2.h (bfd_architecture): Likewise.
950         * cpu-mips.c (enum I_xxx): Likewise.
951         (arch_info_struct): Likewise.
952         * elfxx-mips.c (_bfd_elf_mips_mach): Handle
953         E_MIPS_MACH_GS464E.
954         (mips_set_isa_flags): Likewise.
955         (mips_mach_extensions): Map bfd_mach_mips_gs464e to
956         bfd_mach_mips_gs464 extension.
957
958 2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
959
960         * archures.c (bfd_architecture): Rename
961         bfd_mach_mips_loongson_3a to bfd_mach_mips_gs464.
962         * bfd-in2.h (bfd_architecture): Likewise.
963         * cpu-mips.c (enum I_xxx): Likewise.
964         (arch_info_struct): Likewise.
965         * elfxx-mips.c (_bfd_elf_mips_mach): Likewise.
966         (mips_set_isa_flags): Likewise.
967         (mips_mach_extensions): Likewise.
968         (bfd_mips_isa_ext_mach): Likewise.
969         (bfd_mips_isa_ext): Likewise.
970         (print_mips_isa_ext): Delete AFL_EXT_LOONGSON_3A.
971
972 2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
973
974         * elfxx-mips.c (print_mips_ases): Add Loongson EXT2 extension.
975
976 2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
977
978          * elfxx-mips.c (infer_mips_abiflags): Use ases instead of
979          isa_ext for infer ABI flags.
980          (print_mips_ases): Add Loongson EXT extension.
981
982 2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
983
984         * elfxx-mips.c (print_mips_ases): Add CAM extension.
985
986 2018-08-27  H.J. Lu  <hongjiu.lu@intel.com>
987
988         * elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Don't mask
989         out the GNU_PROPERTY_X86_UINT32_VALID bit.
990
991 2018-08-25  H.J. Lu  <hongjiu.lu@intel.com>
992
993         PR ld/23499
994         * elf.c (_bfd_elf_get_symbol_version_string): Return
995         _("<corrupt>") for corrupt symbol version info.
996
997 2018-08-24  H.J. Lu  <hongjiu.lu@intel.com>
998
999         * elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Handle
1000         X86_COMPAT_ISA_1_USED, X86_COMPAT_ISA_1_NEEDED,
1001         X86_UINT32_AND_LO, X86_UINT32_AND_HI, X86_UINT32_OR_LO,
1002         X86_UINT32_OR_HI, X86_UINT32_OR_AND_LO and X86_UINT32_OR_AND_HI
1003         instead of X86_ISA_1_USED, X86_ISA_1_NEEDED and X86_FEATURE_1_AND.
1004         (_bfd_x86_elf_merge_gnu_properties): Likewise.
1005         (_bfd_x86_elf_link_setup_gnu_properties): Add X86_FEATURE_2_NEEDED
1006         instead of X86_ISA_1_NEEDED.
1007         (_bfd_x86_elf_link_fixup_gnu_properties): Handle
1008         X86_COMPAT_ISA_1_USED, X86_COMPAT_ISA_1_NEEDED, X86_UINT32_AND_LO,
1009         X86_UINT32_AND_HI, X86_UINT32_OR_LO, X86_UINT32_OR_HI,
1010         X86_UINT32_OR_AND_LO and X86_UINT32_OR_AND_HI instead of
1011         X86_ISA_1_USED, X86_ISA_1_NEEDED and X86_FEATURE_1_AND.
1012
1013 2018-08-24  H.J. Lu  <hongjiu.lu@intel.com>
1014
1015         * elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Mask out the
1016         GNU_PROPERTY_X86_UINT32_VALID bit.
1017         (_bfd_x86_elf_link_fixup_gnu_properties): Set the
1018         GNU_PROPERTY_X86_UINT32_VALID bit for non-relocatable output.
1019
1020 2018-08-23  Zenith423  <zenith432@users.sourceforge.net>
1021
1022         PR 23460
1023         * plugin.c (struct plugin_list_entry): New structure.
1024         (plugin_list): New variable.
1025         (try_load_plugin): Place opened plugins on a list.  Ensure that
1026         the refcount in the dynamic loader is kept at 1.
1027
1028 2018-08-23  Alan Modra  <amodra@gmail.com>
1029
1030         * elf64-ppc.c (ppc64_elf_relocate_section): Revise "call lacks
1031         nop" error message.
1032
1033 2018-08-23  Nick Clifton  <nickc@redhat.com>
1034
1035         * elf64-hppa.c (elf_hppa_final_link_relocate): Replace unworkable
1036         code with an assertion.
1037
1038 2018-08-23  Nick Clifton  <nickc@redhat.com>
1039
1040         PR 23061
1041         * coffgen.c (coff_pointerize_aux): Add table_end parameter.  Use
1042         it to prevent walking off the end of the table.
1043         (coff_get_normalized_symtab): Pass internal_end pointer to
1044         coff_pointerize_aux.
1045
1046 2018-08-23  Alan Modra  <amodra@gmail.com>
1047
1048         * elf64-ppc.c (ppc64_elf_relocate_section): Don't miss clearing
1049         unresolved_reloc on ppc_stub_plt_call_notoc.
1050
1051 2018-08-22  H.J. Lu  <hongjiu.lu@intel.com>
1052
1053         PR ld/23536
1054         * development.sh (experimental): New.
1055
1056 2018-08-22  Helge Deller  <deller@gmx.de>
1057         Nick Clifton  <nickc@redhat.com>
1058
1059         * elf-hppa.h (elf_hppa_fake_sections): Use SHT_PARISC_UNWIND as
1060         the section type of the .PARISC.unwind section on 64-bit binaries
1061         and SHT_PROGBITS for 32-bit binaries.  Add a comment about it.
1062         Add comment about the sh_entsize value.
1063
1064 2018-08-22  Rafeal Auler  <rafaelauler@gmail.com>
1065
1066         PR 23560
1067         * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Always update the
1068         stub's target, since it may have been changed after the layout.
1069
1070 2018-08-21  John Darington  <john@darrington.wattle.id.au>
1071
1072         * elf32-s12z.c (opru18_reloc): New function.
1073         (elf_s12z_howto_table): Adjust Howto according to new knowledge.
1074
1075 2018-08-21  mephi42  <mephi42@gmail.com>
1076
1077         PR binutils/23315
1078         * mach-o.c (bfd_mach_o_mangle_symbols): Update n_type even if
1079         data is already considered filled.
1080
1081 2018-08-21  Alan Modra  <amodra@gmail.com>
1082
1083         * elf64-ppc.c (HOW): Define.
1084         (ONES): Delete.
1085         (ppc64_elf_howto_raw): Use HOW to initialize entries.
1086         * elf32-ppc.c (HOW): Define.
1087         (ppc_elf_howto_raw): Use HOW to initialize entries, updating
1088         R_PPC_VLE_REL15 and R_PPC_VLE_REL24 to use bitpos=0.
1089
1090 2018-08-21  Alan Modra  <amodra@gmail.com>
1091
1092         * reloc.c (reloc_howto_type): Typedef.
1093         (bfd_symbol): Delete forward declaration.
1094         (struct reloc_howto_struct): Add "negate" field.  Make "size",
1095         "bitsize", "rightshift", "bitpos", "complain_on_overflow",
1096         "pc_relative", "partial_inplace", and "pcrel_offset" bitfields.
1097         Rearrange for better packing.  Revise comments.
1098         (HOWTO): Map to rearranged reloc_howto_struct.
1099         (bfd_get_reloc_size): Delete now unused cases.
1100         (read_reloc, write_reloc): Likewise.
1101         (apply_reloc, _bfd_relocate_contents): Test howto->negate
1102         rather than howto->size < 0 for negated relocation values.
1103         * coff-rs6000.c (xcoff_complain_overflow_bitfield_func): Avoid
1104         signed/unsigned warning.
1105         (xcoff_ppc_relocate_section): Delete "condition is always false"
1106         code.
1107         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise.
1108         * cpu-ns32k.c (do_ns32k_reloc): Adjust to suit reloc_howto_struct
1109         changes.
1110         * vms-alpha.c (_bfd_vms_write_etir, alpha_vms_slurp_relocs): Use
1111         size 16 for ALPHA_R_LINKAGE.
1112         (alpha_howto_table <ALPHA_R_LINKAGE>): Set encoded size and
1113         bitsize to zero.
1114         * bfd-in.h (reloc_howto_type): Delete.
1115         * bfd-in2.h: Regenerate.
1116
1117 2018-08-21  Alan Modra  <amodra@gmail.com>
1118
1119         * reloc.c (HOWTO): Revise comment.
1120         (NEWHOWTO, HOWTO_PREPARE): Delete.
1121         * coff-arm.c (coff_arm_reloc_type_lookup): Replace const struc
1122         reloc_howto_struct with reloc_howto_type.
1123         * ns32knetbsd.c (MY_bfd_reloc_type_lookup): Likewise.
1124         * vms-alpha.c (alpha_vms_bfd_reloc_type_lookup): Likewise.
1125         * elf-hppa.h (HOW): Define.
1126         (elf_hppa_howto_table): Use it to simplify this table, correcting
1127         name of R_PARISC_LTOFF16WF, R_PARISC_LTOFF_FPTR64, and
1128         R_PARISC_LTOFF_FPTR16DF.
1129         * elf32-mep.c (MEPREL): Use HOWTO.
1130         * bfd-in2.h: Regenerate.
1131
1132 2018-08-20  Alan Modra  <amodra@gmail.com>
1133
1134         * mmo.c (valid_mmo_symbol_character_set): Initialize and make
1135         array const.
1136         (mmo_init): Don't init valid_mmo_symbol_character_set.
1137
1138 2018-08-20  Alan Modra  <amodra@gmail.com>
1139
1140         * rs6000-core.c (CORE_COMMONSZ): Balance parentheses in expression.
1141
1142 2018-08-17  H.J. Lu  <hongjiu.lu@intel.com>
1143
1144         PR ld/23515
1145         * elf-bfd.h (elf_backend_data): Add fixup_gnu_properties.
1146         * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Call
1147         backend fixup_gnu_properties if it isn't NULL.  Discard
1148         .note.gnu.property section if all properties have been removed.
1149         * elfxx-target.h (elf_backend_fixup_gnu_properties): New.
1150         (elfNN_bed): Initialize fixup_gnu_properties.
1151         * elfxx-x86.c (_bfd_x86_elf_link_fixup_gnu_properties): New
1152         function.
1153         * elfxx-x86.h (_bfd_x86_elf_link_fixup_gnu_properties): New
1154         prototype.
1155         (elf_backend_fixup_gnu_properties): New.
1156
1157 2018-08-16  Alan Modra  <amodra@gmail.com>
1158
1159         * elf64-ppc.c: Correct ppc_stub_long_branch_notoc example.
1160         Formatting.
1161
1162 2018-08-12  H.J. Lu  <hongjiu.lu@intel.com>
1163
1164         PR binutils/23494
1165         * Makefile.am (BFD32_LIBS): Add elf-properties.lo.
1166         (BFD32_LIBS_CFILES): Add elf-properties.c.
1167         (BFD32_BACKENDS): Remove elf-properties.lo.
1168         (BFD32_BACKENDS_CFILES): Remove elf-properties.c.
1169         * configure.ac (elf): Remove elf-properties.lo.
1170         * Makefile.in: Regenerated.
1171         * configure: Likewise.
1172
1173 2018-08-11  H.J. Lu  <hongjiu.lu@intel.com>
1174
1175         PR ld/23428
1176         * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Don't
1177         add X86_ISA_1_NEEDED property only if existing properties won't
1178         be removed.
1179
1180 2018-08-11  Alan Modra  <amodra@gmail.com>
1181
1182         * reloc.c (bfd_get_reloc_size): Sort switch.
1183         (read_reloc, write_reloc, apply_reloc): New functions.
1184         (bfd_perform_relocation, bfd_install_relocation): Use apply_reloc.
1185         (_bfd_relocate_contents): Use read_reloc and write_reloc.
1186         (_bfd_clear_contents): Likewise.
1187
1188 2018-08-11  John Darrington  <john@darrington.wattle.id.au>
1189
1190         * reloc.c (_bfd_relocate_contents): Handle 3 byte relocs.
1191         (_bfd_clear_contents): Likewise.
1192         (bfd_perform_relocation): Likewise.
1193         (bfd_install_relocation): Likewise.
1194
1195 2018-08-10  H.J. Lu  <hongjiu.lu@intel.com>
1196
1197         PR ld/23499
1198         * elflink.c (bfd_elf_record_link_assignment): Always clear
1199         h->verinfo.verdef when overriding a dynamic definition.
1200
1201 2018-08-10  H.J. Lu  <hongjiu.lu@intel.com>
1202
1203         PR binutils/23494
1204         * elf-properties.c (elf_get_gnu_property_section_size): Always
1205         use align_size as pr_datasz for GNU_PROPERTY_STACK_SIZE.
1206         (elf_write_gnu_properties): Likewise.
1207
1208 2018-08-08  H.J. Lu  <hongjiu.lu@intel.com>
1209
1210         PR binutils/23494
1211         * bfd.c (bfd_convert_section_size): Check BFD_DECOMPRESS after
1212         calling _bfd_elf_convert_gnu_property_size to convert
1213         .note.gnu.property section size.
1214         (bfd_convert_section_contents): Check BFD_DECOMPRESS after
1215         calling _bfd_elf_convert_gnu_properties to convert
1216         .note.gnu.property section.
1217         * elf-bfd.h (_bfd_elf_convert_gnu_property_size): New prototype.
1218         (_bfd_elf_convert_gnu_properties): Likewise.
1219         * elf-properties.c (elf_get_gnu_property_section_size): New
1220         function.
1221         (elf_write_gnu_properties): Likewise.
1222         (_bfd_elf_convert_gnu_property_size): Likewise.
1223         (_bfd_elf_convert_gnu_properties): Likewise.
1224         (_bfd_elf_link_setup_gnu_properties): Use
1225         elf_get_gnu_property_section_size and elf_write_gnu_properties.
1226
1227 2018-08-08  H.J. Lu  <hongjiu.lu@intel.com>
1228
1229         PR ld/23486
1230         * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove
1231         GNU_PROPERTY_X86_ISA_1_USED if an input file doesn't have it.
1232         (_bfd_x86_elf_link_setup_gnu_properties): Adding the
1233         GNU_PROPERTY_X86_ISA_1_NEEDED, instead of
1234         GNU_PROPERTY_X86_ISA_1_USED, property.
1235
1236 2018-08-07  Alan Modra  <amodra@gmail.com>
1237
1238         * elf64-ppc.c (struct map_stub): Delete tls_get_addr_opt_bctrl.
1239         Add lr_restore, eh_size and eh_base.
1240         (eh_advance, eh_advance_size): New functions.
1241         (build_tls_get_addr_stub): Emit EH info for stub.
1242         (ppc_build_one_stub): Likewise for _notoc stubs.
1243         (ppc_size_one_stub): Size EH info for stub.
1244         (group_sections): Init new map_stub fields.
1245         (stub_eh_frame_size): Delete.
1246         (ppc64_elf_size_stubs): Size EH info for stubs.  Set up dummy EH
1247         program for stubs.
1248         (ppc64_elf_build_stubs): Reinit new map_stub fields.  Set FDE
1249         offset to stub section here..
1250         (ppc64_elf_finish_dynamic_sections): ..rather than here.
1251
1252 2018-08-07  Alan Modra  <amodra@gmail.com>
1253
1254         * elf64-ppc.c (ppc64_elf_relocate_section): Don't skip first
1255         instruction of __tls_get_addr_opt stub.
1256         (plt_stub_size): Omit ALWAYS_EMIT_R2SAVE condition when
1257         dealing with __tls_get_addr_opt stub.
1258         (build_tls_get_addr_stub, ppc_size_one_stub): Likewise.
1259
1260 2018-08-06  Claudiu Zissulescu  <claziss@synopsys.com>
1261
1262         * elf32-arc.c (arc_elf_merge_private_bfd_data): Complain about
1263         efalgs only when in/out exists.
1264         (elf32_arc_section_from_shdr): Don't complain about 0x0c
1265         section type.  It is mwdt compiler specific.
1266
1267 2018-08-06  Claudiu Zissulescu  <claziss@synopsys.com>
1268
1269         * elf32-arc.c (arc_elf_merge_attributes): Fix merge attributes.
1270
1271 2018-08-06  Claudiu Zissulescu  <claziss@synopsys.com>
1272
1273         * elf32-arc.c (arc_elf_merge_attributes): Handle
1274         Tag_ARC_ATR_version.
1275
1276 2018-08-05  Alan Modra  <amodra@gmail.com>
1277
1278         * elf64-ppc.c (ADDI_R12_R11, ADDI_R12_R12, LIS_R12),
1279         (ADDIS_R12_R11, ORIS_R12_R12_0, ORI_R12_R12_0),
1280         (SLDI_R12_R12_32, LDX_R12_R11_R12, ADD_R12_R11_R12): Define.
1281         (ppc64_elf_howto_raw): Add R_PPC64_REL24_NOTOC entry.
1282         (ppc64_elf_reloc_type_lookup): Support R_PPC64_REL24_NOTOC.
1283         (ppc_stub_type): Add ppc_stub_long_branch_notoc,
1284         ppc_stub_long_branch_both, ppc_stub_plt_branch_notoc,
1285         ppc_stub_plt_branch_both, ppc_stub_plt_call_notoc, and
1286         ppc_stub_plt_call_both.
1287         (is_branch_reloc): Add R_PPC64_REL24_NOTOC.
1288         (build_offset, size_offset): New functions.
1289         (plt_stub_size): Support plt_call_notoc and plt_call_both.
1290         (ppc_build_one_stub, ppc_size_one_stub): Support new stubs.
1291         (toc_adjusting_stub_needed): Handle R_PPC64_REL24_NOTOC.
1292         (ppc64_elf_size_stubs): Likewise, and new stubs.
1293         (ppc64_elf_build_stubs, ppc64_elf_relocate_section): Likewise.
1294         * reloc.c: Add BFD_RELOC_PPC64_REL24_NOTOC.
1295         * bfd-in2.h: Regenerate.
1296         * libbfd.h: Regenerate.
1297
1298 2018-08-05  Alan Modra  <amodra@gmail.com>
1299
1300         * elf64-ppc.c (ppc_build_one_stub): Lose "_r2off" in stub symbols.
1301
1302 2018-08-02  Jim Wilson  <jimw@sifive.com>
1303
1304         * elfnn-riscv.c (riscv_elf_create_dynamic_sections): For .tdata.dyn,
1305         add SEC_LINKER_CREATED flag.
1306
1307 2018-08-01  Nick Clifton  <nickc@redhat.com>
1308
1309         * coff-rs6000.c (_bfd_xcoff_put_ldsymbol_name): Suppress warnings
1310         about potentially truncated strncpy operations.
1311         (_bfd_xcoff_put_symbol_name): Likewise.
1312
1313         * elf32-avr.c (avr_stub_name): Check for a NULL return from
1314         bfd_malloc.
1315
1316 2018-08-01  Zenith  <zenith432@users.sourceforge.net>
1317
1318         PR 23460
1319         * plugin.c (bfd_plugin_open_input): Close file descriptor if the
1320         call to fstat fails.
1321         (try_claim): Always close the file descriptor at the end of the
1322         function.
1323         (try_load_plugin): If a plugin has already been registered, then
1324         skip the dlopen and onload steps and go straight to claiming the
1325         file.  If these is an error, close the plugin.
1326
1327 2018-08-01  Alan Modra  <amodra@gmail.com>
1328
1329         * elf64-ppc.c (plt_stub_pad): Delay plt_stub_size call until needed.
1330         (ppc_build_one_stub): Don't set stub_offset, instead assert that
1331         it is sane.  Don't adjust stub_offset for alignment.  Adjust size
1332         calculation.  Use "targ" temp when calculating offsets.
1333         (ppc_size_one_stub): Set stub_offset here.  Use "targ" temp when
1334         calculating offsets.  Adjust for alignment before setting
1335         tls_get_addr_opt_bctrl.
1336
1337 2018-08-01  Alan Modra  <amodra@gmail.com>
1338
1339         * po/SRC-POTFILES.in: Regenerate.
1340
1341 2018-07-30  Nick Clifton  <nickc@redhat.com>
1342
1343         PR 22706
1344         * elf32-sh.c (sh_elf_relocate_section): When processing
1345         translation relocs, fail if the relocation offset is too small.
1346         Replace BFD_ASSERTs with more helpful error messages.
1347
1348 2018-07-30  Andrew Jenner  <andrew@codesourcery.com>
1349
1350         * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES): Add C-SKY.
1351         (BFD32_BACKENDS, BFD_BACKENDS_CFILES): Likewise.
1352         * Makefile.in: Regenerated.
1353         * archures.c (enum bfd_architecture): Add bfd_arch_csky and
1354         related bfd_mach defines.
1355         (bfd_csky_arch): Declare.
1356         (bfd_archures_list): Add C-SKY.
1357         * bfd-in.h (elf32_csky_build_stubs): Declare.
1358         (elf32_csky_size_stubs): Declare.
1359         (elf32_csky_next_input_section: Declare.
1360         (elf32_csky_setup_section_lists): Declare.
1361         * bfd-in2.h: Regenerated.
1362         * config.bfd: Add C-SKY.
1363         * configure.ac: Likewise.
1364         * configure: Regenerated.
1365         * cpu-csky.c: New file.
1366         * elf-bfd.h (enum elf_target_id): Add C-SKY.
1367         * elf32-csky.c: New file.
1368         * libbfd.h: Regenerated.
1369         * reloc.c: Add C-SKY relocations.
1370         * targets.c (csky_elf32_be_vec, csky_elf32_le_vec): Declare.
1371         (_bfd_target_vector): Add C-SKY target vector entries.
1372
1373 2018-07-27  John Darrington  <john@darrington.wattle.id.au>
1374
1375         * elf32-s12z.c (ELF_TARGET_ID): Don't define.
1376
1377 2018-07-27  John Darrington  <john@darrington.wattle.id.au>
1378
1379         * libbfd.c (bfd_getb24, bfd_getl24): New functions.
1380         (bfd_get_24, bfd_put_24): New macros.
1381         * bfd-in2.h: Regenerate.
1382
1383 2018-07-27  John Darrington  <john@darrington.wattle.id.au>
1384
1385         * elf32-s12z.c (s12z_elf_set_mach_from_flags): Remove comment.
1386
1387 2018-07-26  Alan Modra  <amodra@gmail.com>
1388
1389         * elf64-ppc.c (ppc64_elf_size_stubs): Use a ppc_stub_long_branch_r2off
1390         for calls to symbols with STO_PPC64_LOCAL_MASK bits set to 1.
1391
1392 2018-07-25  Alan Modra  <amodra@gmail.com>
1393
1394         * elf32-ppc.c (ppc_elf_relax_section): Ignore common or undef locals.
1395         Avoid trashing toff with added when used as a symbol index.
1396         Ignore R_PPC_PLTREL24 addends in unused example code.  Avoid
1397         creating unnecessary fixups when relocatable.
1398
1399 2018-07-25  Alan Modra  <amodra@gmail.com>
1400
1401         * elf32-arm.c (elf32_arm_nabi_write_core_note): Disable
1402         -Wstringop-truncation warning for gcc-8.0 too.
1403         * elf32-ppc.c (ppc_elf_write_core_note): Likewise.
1404         * elf64-ppc.c (ppc64_elf_write_core_note): Likewise.
1405         * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewise.
1406         * elf32-s390.c (elf_s390_write_core_note): Comment fix.
1407         * elf64-s390.c (elf_s390_write_core_note): Likewise.
1408
1409 2018-07-24  Alan Modra  <amodra@gmail.com>
1410
1411         PR 23430
1412         * dwarf2.c (dwarf_debug_section_enum): Fix comment typo.
1413         * elf.c (bfd_section_from_shdr, elf_sort_sections): Likewise.
1414
1415 2018-07-23  Max Filippov  <jcmvbkbc@gmail.com>
1416
1417         * elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Move
1418         relocation sections consistency check to always check both
1419         .rela.dyn and .rela.plt when they exist. Rearrange variable
1420         definition and assignment places.
1421
1422 2018-07-23  Max Filippov  <jcmvbkbc@gmail.com>
1423
1424         * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
1425         relocations section for dynamic undefined weak symbols when
1426         linking a shared object.
1427
1428 2018-07-23  Tom Tromey  <tom@tromey.com>
1429
1430         * elf.c (bfd_get_elf_phdrs): Don't call memcpy with size 0.
1431
1432 2018-07-21  Eric Botcazou  <ebotcazou@adacore.com>
1433
1434         * elf32-arm.c (elf32_arm_final_link_relocate) <R_ARM_GOT32>: Small
1435         cleanup for the case of a global symbol that binds locally.  Also
1436         install a value in the GOT slot in the case of a local symbol in
1437         a non-PIC link.
1438
1439 2018-07-20  H.J. Lu  <hongjiu.lu@intel.com>
1440
1441         PR ld/23428
1442         * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): If the
1443         separate code program header is needed, make sure that the first
1444         read-only PT_LOAD segment has no code by adding a
1445         GNU_PROPERTY_X86_ISA_1_USED note.
1446
1447 2018-07-20  Chenghua Xu  <paul.hua.gm@gmail.com>
1448             Maciej W. Rozycki  <macro@mips.com>
1449
1450         * elfxx-mips.c (print_mips_ases): Add MMI extension.
1451
1452 2018-07-20  Maciej W. Rozycki  <macro@mips.com>
1453
1454         * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Do not
1455         create DT_REL, DT_RELSZ or DT_RELENT dynamic entries if the
1456         dynamic relocation section will be discarded from output.
1457         (_bfd_mips_elf_finish_dynamic_sections) <DT_RELSZ>: Assert that
1458         the dynamic relocation section will be retained in output.
1459
1460 2018-07-18  Maciej W. Rozycki  <macro@mips.com>
1461
1462         * xcofflink.c (xcoff_write_global_symbol): Fix symbol type
1463         checks for defined weak symbols.
1464
1465 2018-07-17  Maciej W. Rozycki  <macro@mips.com>
1466
1467         * elf32-nds32.c (nds32_elf_relax_loadstore): Use
1468         `bfd_is_abs_symbol' rather than `bfd_is_abs_section' in checking
1469         whether the symbol is absolute.
1470         (nds32_elf_relax_lo12): Likewise.
1471         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1472         (elfNN_aarch64_check_relocs): Likewise.
1473         * xcofflink.c (xcoff_need_ldrel_p): Likewise.
1474         (bfd_xcoff_import_symbol): Likewise.
1475         (xcoff_write_global_symbol): Likewise.
1476
1477 2018-07-17  Maciej W. Rozycki  <macro@mips.com>
1478
1479         * linker.c (bfd_is_abs_symbol): New macro.
1480         * bfd-in2.h: Regenerate.
1481
1482 2018-07-16  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
1483
1484         * elf-bfd.h (elfcore_write_ppc_tar): Add prototype.
1485         (elfcore_write_ppc_ppr): Likewise.
1486         (elfcore_write_ppc_dscr): Likewise.
1487         (elfcore_write_ppc_ebb): Likewise.
1488         (elfcore_write_ppc_pmu): Likewise.
1489         (elfcore_write_ppc_tm_cgpr): Likewise.
1490         (elfcore_write_ppc_tm_cfpr): Likewise.
1491         (elfcore_write_ppc_tm_cvmx): Likewise.
1492         (elfcore_write_ppc_tm_cvsx): Likewise.
1493         (elfcore_write_ppc_tm_spr): Likewise.
1494         (elfcore_write_ppc_tm_ctar): Likewise.
1495         (elfcore_write_ppc_tm_cppr): Likewise.
1496         (elfcore_write_ppc_tm_cdscr): Likewise.
1497         * elf.c (elfcore_write_ppc_tar): New function.
1498         (elfcore_write_ppc_ppr): Likewise.
1499         (elfcore_write_ppc_dscr): Likewise.
1500         (elfcore_write_ppc_ebb): Likewise.
1501         (elfcore_write_ppc_pmu): Likewise.
1502         (elfcore_write_ppc_tm_cgpr): Likewise.
1503         (elfcore_write_ppc_tm_cfpr): Likewise.
1504         (elfcore_write_ppc_tm_cvmx): Likewise.
1505         (elfcore_write_ppc_tm_cvsx): Likewise.
1506         (elfcore_write_ppc_tm_spr): Likewise.
1507         (elfcore_write_ppc_tm_ctar): Likewise.
1508         (elfcore_write_ppc_tm_cppr): Likewise.
1509         (elfcore_write_ppc_tm_cdscr): Likewise.
1510         (elfcore_write_register_note): Call them.
1511         (elfcore_grok_ppc_tar): New function.
1512         (elfcore_grok_ppc_ppr): Likewise.
1513         (elfcore_grok_ppc_dscr): Likewise.
1514         (elfcore_grok_ppc_ebb): Likewise.
1515         (elfcore_grok_ppc_pmu): Likewise.
1516         (elfcore_grok_ppc_tm_cgpr): Likewise.
1517         (elfcore_grok_ppc_tm_cfpr): Likewise.
1518         (elfcore_grok_ppc_tm_cvmx): Likewise.
1519         (elfcore_grok_ppc_tm_cvsx): Likewise.
1520         (elfcore_grok_ppc_tm_spr): Likewise.
1521         (elfcore_grok_ppc_tm_ctar): Likewise.
1522         (elfcore_grok_ppc_tm_cppr): Likewise.
1523         (elfcore_grok_ppc_tm_cdscr): Likewise.
1524         (elfcore_grok_note): Call them.
1525
1526 2018-07-11  Maciej W. Rozycki  <macro@mips.com>
1527
1528         * elfxx-mips.c (mips_tls_got_relocs): Use `bfd_link_dll' rather
1529         than `!bfd_link_pic' in determining the dynamic symbol index.
1530         Avoid the index of -1.
1531         (mips_elf_initialize_tls_slots): Likewise.  Flatten code by
1532         moving `dyn' to the beginning of the function block.
1533
1534 2018-07-11  Maciej W. Rozycki  <macro@mips.com>
1535             Rich Felker  <bugdal@aerifal.cx>
1536
1537         PR ld/22570
1538         * elfxx-mips.c (mips_tls_got_relocs): Use `bfd_link_dll' rather
1539         than `bfd_link_pic' to determine whether dynamic relocations are
1540         to be produced.
1541         (mips_elf_initialize_tls_slots): Likewise.
1542
1543 2018-07-10  Maciej W. Rozycki  <macro@mips.com>
1544
1545         * elflink.c (bfd_elf_final_link): Rename `remove' local variable
1546         to `remove_section'.
1547
1548 2018-07-10  Alan Modra  <amodra@gmail.com>
1549
1550         * elf32-xgate.h: Delete.
1551         * elf32-xgate.c: Delete unnecessary forward declarations, add two
1552         that are now needed.
1553         (xgate_elf_bfd_link_hash_table_create)
1554         (xgate_elf_bfd_link_hash_table_free)
1555         (xgate_elf_set_mach_from_flags, struct xgate_scan_param)
1556         (stub_hash_newfunc, elf32_xgate_add_symbol_hook)
1557         (elf32_xgate_setup_section_lists, elf32_xgate_size_stubs)
1558         (elf32_xgate_build_stubs, elf32_xgate_check_relocs)
1559         (elf32_xgate_relocate_section, _bfd_xgate_elf_set_private_flags)
1560         (elf32_xgate_post_process_headers): Delete.
1561         (elf32_xgate_backend_symbol_processing): New function.
1562         (xgate_elf_ignore_reloc, xgate_elf_special_reloc)
1563         (_bfd_xgate_elf_print_private_bfd_data): Make static.
1564         (ELF_TARGET_ID, elf_info_to_howto, elf_backend_check_relocs)
1565         (elf_backend_relocate_section, elf_backend_object_p)
1566         (elf_backend_final_write_processing, elf_backend_can_gc_sections)
1567         (elf_backend_post_process_headers, elf_backend_add_symbol_hook)
1568         (bfd_elf32_bfd_link_hash_table_create)
1569         (bfd_elf32_bfd_set_private_flags)
1570         (xgate_stub_hash_lookup): Don't define.
1571         (elf_backend_symbol_processing): Define.
1572         * elf-bfd.h (elf_target_id): Delete XGATE_ELF_DATA.
1573
1574 2018-07-09  Maciej W. Rozycki  <macro@mips.com>
1575
1576         * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Don't set
1577         `->needs_lazy_stub' if the stubs output section is the absolute
1578         section.
1579
1580 2018-07-09  H.J. Lu  <hongjiu.lu@intel.com>
1581
1582         PR ld/23388
1583         * configure.ac: Use changequote for "i[3-7]86-*-linux-*".
1584         * configure: Regenerated.
1585
1586 2018-07-09  Alan Modra  <amodra@gmail.com>
1587
1588         * elf32-m68hc1x.c (elf32_m68hc11_post_process_headers): Call
1589         _bfd_elf_post_process_headers.
1590
1591 2018-07-06  Max Filippov  <jcmvbkbc@gmail.com>
1592
1593         * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Don't allocate
1594         space for dynamic relocation for undefined weak symbol.
1595         (elf_xtensa_relocate_section): Don't emit R_XTENSA_RELATIVE
1596         relocation for undefined weak symbols.
1597         (shrink_dynamic_reloc_sections): Don't shrink dynamic relocation
1598         section for relocations against undefined weak symbols.
1599
1600 2018-07-06  Alan Hayward  <alan.hayward@arm.com>
1601
1602         * elf.c (elfcore_grok_aarch_sve): New function.
1603         (elfcore_grok_note): Check for Aarch64 SVE.
1604         (elfcore_write_aarch_sve): New function.
1605         (elfcore_write_register_note): Check for Aarch64 SVE.
1606         * elf-bfd.h(elfcore_grok_aarch_sve): New declaration.
1607
1608 2018-07-06  Alan Modra  <amodra@gmail.com>
1609
1610         * elf32-arm.c (elf32_arm_nabi_write_core_note): Don't use
1611         DIAGNOTIC_PUSH and DIAGNOSTIC_POP unconditionally.
1612         * elf32-ppc.c (ppc_elf_write_core_note): Likewise.
1613         * elf32-s390.c (elf_s390_write_core_note): Likewise.
1614         * elf64-ppc.c (ppc64_elf_write_core_note): Likewise.
1615         * elf64-s390.c (elf_s390_write_core_note): Likewise.
1616         * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewise.
1617
1618 2018-07-05  Jim Wilson  <jimw@sifive.com>
1619
1620         * config.bfd (riscv32*-*-*): Renamed from riscv32-*-*.
1621         (riscv64*-*-*): Likewise.
1622         (riscv-*-*): Add as an alias for riscv32*-*-*.
1623
1624 2018-07-05  H.J. Lu  <hongjiu.lu@intel.com>
1625
1626         PR ld/23372
1627         * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove x86
1628         ISA properties with empty bits.
1629
1630 2018-07-05  Nick Clifton  <nickc@redhat.com>
1631
1632         * po/ru.po: Updated Russian translation.
1633
1634 2018-07-05  Alan Modra  <amodra@gmail.com>
1635
1636         * elf-bfd.h (_bfd_elf_ppc_merge_fp_attributes): Update prototype.
1637         * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Return error
1638         on mismatch.  Remove "warning: " from messages.  Track last bfd
1639         used to set tags.
1640         (ppc_elf_merge_obj_attributes): Likewise.  Handle status from
1641         _bfd_elf_ppc_merge_fp_attributes.
1642         * elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Handle status
1643         from _bfd_elf_ppc_merge_fp_attributes.
1644
1645 2018-07-04  H.J. Lu  <hongjiu.lu@intel.com>
1646
1647         * Makefile.am (bfdinclude_HEADERS): Add $(INCDIR)/diagnostics.h.
1648         * Makefile.in: Regenerated.
1649
1650 2018-07-03  Alan Modra  <amodra@gmail.com>
1651
1652         * elflink.c (bfd_elf_final_link): Remove zero size .gnu.attributes
1653         sections.
1654
1655 2018-07-03  Alan Modra  <amodra@gmail.com>
1656
1657         * elf-bfd.h (ATTR_TYPE_FLAG_ERROR, ATTR_TYPE_HAS_ERROR): Define.
1658         * elf-attrs.c (is_default_attr): Handle ATTR_TYPE_HAS_ERROR.
1659         * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Use
1660         ATTR_TYPE_FLAG_INT_VAL.  Set ATTR_TYPE_HAS_ERROR on finding
1661         incompatible attribute.
1662         (ppc_elf_merge_obj_attributes): Likewise.  Return
1663         _bfd_elf_merge_object_attributes result.
1664         * elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Return
1665         _bfd_elf_merge_object_attributes result.
1666
1667 2018-07-03  Alan Modra  <amodra@gmail.com>
1668
1669         PR 17550
1670         * elflink.c (_bfd_elf_fix_symbol_flags): Hide dynamic symbols
1671         in discarded sections.
1672
1673 2018-07-02  Maciej W. Rozycki  <macro@mips.com>
1674
1675         * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Set
1676         `mark' for symbols created from `mips_elf_dynsym_rtproc_names'
1677         list.
1678
1679 2018-07-02  Maciej W. Rozycki  <macro@mips.com>
1680
1681         * elf64-mips.c (micromips_elf64_howto_table_rel): Add
1682         R_MICROMIPS_HI0_LO16, R_MICROMIPS_TLS_GD, R_MICROMIPS_TLS_LDM,
1683         R_MICROMIPS_TLS_DTPREL_HI16, R_MICROMIPS_TLS_DTPREL_LO16,
1684         R_MICROMIPS_TLS_GOTTPREL, R_MICROMIPS_TLS_TPREL_HI16,
1685         R_MICROMIPS_TLS_TPREL_LO16, R_MICROMIPS_GPREL7_S2 and
1686         R_MICROMIPS_PC23_S2 relocation entries.
1687         (micromips_elf64_howto_table_rela): Likewise.
1688         (micromips_reloc_map): Likewise.
1689         * elfn32-mips.c (elf_micromips_howto_table_rel): Likewise.
1690         (elf_micromips_howto_table_rela): Likewise.
1691         (micromips_reloc_map): Likewise.
1692
1693 2018-07-02  H.J. Lu  <hongjiu.lu@intel.com>
1694
1695         PR ld/23324
1696         * elf64-x86-64.c (elf_x86_64_relocate_section): Clear the
1697         R_X86_64_converted_reloc_bit bit.
1698
1699 2018-07-02  Jeff Muizelaar  <jrmuizel@gmail.com>
1700             Tom Tromey  <tom@tromey.com>
1701
1702         PR 13157
1703         PR 21787
1704         * mach-o.c (bfd_mach_o_fat_close_and_cleanup): New function.
1705         (bfd_mach_o_close_and_cleanup): Redefine.
1706         * archive.c (_bfd_unlink_from_archive_parent): New function,
1707         extracted from..
1708         (_bfd_archive_close_and_cleanup): ..here.
1709         (bfd_generic_archive_p): Do not clear archive's format.
1710         * libbfd-in.h (_bfd_unlink_from_archive_parent): Declare.
1711         * libbfd.h: Regenerate.
1712
1713 2018-07-02  Thomas Preud'homme  <thomas.preudhomme@arm.com>
1714
1715         * archures.c (bfd_mach_arm_5TEJ, bfd_mach_arm_6, bfd_mach_arm_6KZ,
1716         bfd_mach_arm_6T2, bfd_mach_arm_6K, bfd_mach_arm_7, bfd_mach_arm_6M,
1717         bfd_mach_arm_6SM, bfd_mach_arm_7EM, bfd_mach_arm_8, bfd_mach_arm_8R,
1718         bfd_mach_arm_8M_BASE, bfd_mach_arm_8M_MAIN): Define.
1719         * bfd-in2.h: Regenerate.
1720         * cpu-arm.c (arch_info_struct): Add entries for above new
1721         bfd_mach_arm values.
1722         * elf32-arm.c (bfd_arm_get_mach_from_attributes): Add Tag_CPU_arch to
1723         bfd_mach_arm mapping logic for pre Armv4 and Armv5TEJ and later
1724         architectures.  Force assert failure for any new Tag_CPU_arch value.
1725
1726 2018-07-02  Thomas Preud'homme  <thomas.preudhomme@arm.com>
1727
1728         * doc/bfdint.texi: Use command-line consistently when used in a
1729         compount word.
1730         * doc/bfdsumm.texi: Likewise.
1731
1732 2018-06-29  Maciej W. Rozycki  <macro@mips.com>
1733
1734         * elfxx-mips.c (allocate_dynrelocs): Remove extraneous symbol
1735         visibility check made for undefined weak symbols.
1736
1737 2018-06-26  Nick Clifton  <nickc@redhat.com>
1738
1739         * po/uk.po: Updated Ukranian translation.
1740
1741 2018-06-25  Nick Clifton  <nickc@redhat.com>
1742
1743         * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_stub_name): Check
1744         for malloc returning NULL.
1745         (_bfd_aarch64_erratum_843419_fixup): Check for
1746         _bfd_aarch64_erratum_835769_stub_name returning NULL.
1747
1748 2018-06-24  Nick Clifton  <nickc@redhat.com>
1749
1750         * po/bfd.pot: Regenerate.
1751
1752 2018-06-24  Nick Clifton  <nickc@redhat.com>
1753
1754         * version.m4: Update version string to 2.31.51.
1755         * configure: Regenerate.
1756
1757 2018-06-24  Nick Clifton  <nickc@redhat.com>
1758
1759         2.31 branch created.
1760
1761 2018-06-21  Maciej W. Rozycki  <macro@mips.com>
1762
1763         * elfxx-mips.c (_bfd_mips_elf_compact_eh_encoding)
1764         (_bfd_mips_elf_cant_unwind_opcode): Correct formatting.
1765
1766 2018-06-21  Maciej W. Rozycki  <macro@mips.com>
1767
1768         * elfxx-mips.c (_bfd_mips_post_process_headers): Keep
1769         EI_ABIVERSION setting together.
1770
1771 2018-06-21  Maciej W. Rozycki  <macro@mips.com>
1772
1773         * elfxx-mips.c (MIPS_LIBC_ABI_DEFAULT, MIPS_LIBC_ABI_MIPS_PLT)
1774         (MIPS_LIBC_ABI_UNIQUE, MIPS_LIBC_ABI_MIPS_O32_FP64)
1775         (MIPS_LIBC_ABI_MAX): New enumeration constants.
1776         (_bfd_mips_post_process_headers): Use them in place of magic
1777         numbers.
1778
1779 2018-06-21  Jim Wilson  <jimw@sifive.com>
1780
1781         * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Update comment.
1782         Use SYMBOL_REFERENCES_LOCAL.  Add asserts for h->got.offset.
1783
1784 2018-06-21  Alan Modra  <amodra@gmail.com>
1785
1786         * doc/Makefile.am (AUTOMAKE_OPTIONS): Add "foreign".
1787         * doc/Makefile.in: Regenerate.
1788
1789 2018-06-20  Renlin Li  <renlin.li@arm.com>
1790
1791         * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Use PG_OFFSET
1792         to resolve BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
1793         BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
1794         BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
1795         BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
1796         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
1797         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
1798         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
1799         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
1800
1801 2018-06-20  Nick Clifton  <nickc@redhat.com>
1802
1803         PR 23316
1804         * opncls.c (get_build_id): Check for a negative or excessive data
1805         size in the build-id note.
1806
1807 2018-06-20  Nick Clifton  <nickc@redhat.com>
1808
1809         PR 23299
1810         * mach-o.c (cputype): New function.
1811         (cpusubtype): New function.
1812         (bfd_mach_o_bfd_print_private_data): New function.  Dispalys the
1813         values in the MACH-O file header.
1814         (bfd_mach_o_bfd_copy_private_header_data): Copy the cputype and
1815         cpusubtype fields from the input bfd's mach-o header to the output
1816         bfd.
1817         * mach-o-target.c (bfd_mach_o_bfd_print_private_bfd_data):
1818         Redefine to bfd_mach_o_bfd_print_private_data.
1819         * mach-o.h (bfd_mach_o_bfd_print_private_bfd_data): Prototype.
1820
1821 2018-06-19  Maciej W. Rozycki  <macro@mips.com>
1822
1823         PR ld/22966
1824         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Verify the
1825         `.got.plt' entry referred is in range.
1826         (mips_finish_exec_plt): Correct the range check for `.got.plt'
1827         start.  Replace the assertion used for that with a proper error
1828         message.
1829
1830 2018-06-19  Maciej W. Rozycki  <macro@mips.com>
1831
1832         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Fix
1833         formatting.
1834
1835 2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>
1836
1837         * Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11.
1838         (INCLUDES): Rename to ...
1839         (AM_CPPFLAGS): ... this.
1840         * configure.ac: Remove AC_PREREQ.
1841         * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove 1.9, cygnus, add
1842         info-in-builddir no-texinfo.tex.
1843         (info_TEXINFOS): Rename bfd.texinfo to bfd.texi.
1844         * doc/bfd.texinfo: Rename to ...
1845         * doc/bfd.texi: ... this.
1846         * Makefile.in: Re-generate.
1847         * aclocal.m4: Re-generate.
1848         * config.in: Re-generate.
1849         * configure: Re-generate.
1850         * doc/Makefile.in: Re-generate.
1851
1852 2018-06-18  Mephi  <mephi42@gmail.com>
1853
1854         PR 23297
1855         * mach-o-x86-64.c (x86_64_howto_table): Add entry for
1856         BFD_RELOC_MACH_O_X86_64_RELOC_TLV.
1857         (bfd_mach_o_x86_64_canonicalize_one_reloc): Handle the new reloc.
1858         (bfd_mach_o_x86_64_swap_reloc_out): Likewise.
1859         * reloc.c (BFD_RELOC_MACH_O_X86_64_TV): New entry.
1860         * bfd-in2.h: Regenerate.
1861         * libbfd.h: Regenerate.
1862
1863 2018-06-14  Faraz Shahbazker  <Faraz.Shahbazker@mips.com>
1864
1865         * elfxx-mips.c (print_mips_ases): Add GINV extension.
1866
1867 2018-06-14  H.J. Lu  <hongjiu.lu@intel.com>
1868
1869         PR binutils/23267
1870         * elf.c (_bfd_elf_get_symbol_version_string): Check if the first
1871         symbol version is base version.
1872
1873 2018-06-14  Alan Modra  <amodra@gmail.com>
1874
1875         * elf-bfd.h (struct elf_link_hash_table): Add "dynamic_relocs".
1876         * elflink.c (_bfd_elf_init_2_index_sections): Comment fix.
1877         (_bfd_elf_add_dynamic_entry): Set "dynamic_relocs".
1878         (_bfd_elf_link_renumber_dynsyms): Exclude all section symbols when
1879         "dynamic_relocs" is not set.
1880         * elfxx-mips.c (count_section_dynsyms): Likewise.
1881
1882 2018-06-14  Alan Modra  <amodra@gmail.com>
1883
1884         PR 23282
1885         * bfdio.c (bfd_seek): Optimize away seeks to current position.
1886
1887 2018-06-13  Scott Egerton  <scott.egerton@imgtec.com>
1888             Faraz Shahbazker  <Faraz.Shahbazker@mips.com>
1889
1890         * elfxx-mips.c (print_mips_ases): Add CRC.
1891
1892 2018-06-08  H.J. Lu  <hongjiu.lu@intel.com>
1893
1894         PR ld/23161
1895         * elfxx-x86.c (elf_x86_hide_linker_defined): New function.
1896         (_bfd_x86_elf_link_check_relocs): Use it to hide hidden
1897         __bss_start, _end and _edata in shared libraries.
1898
1899 2018-06-07  Alan Modra  <amodra@gmail.com>
1900
1901         * elf32-tic6x.c (elf32_tic6x_check_relocs): Reference
1902         __c6xabi_DSBT_BASE explicitly for R_C6000_SBR_* relocs.
1903
1904 2018-06-05  Alan Modra  <amodra@gmail.com>
1905
1906         * bfd.c (struct bfd): Update comment on "where" usage.
1907         * bfdio.c (bfd_bwrite, bfd_stat): Use and update "iovec",
1908         "iostream", and "where" from containing archive file.  Return
1909         error on NULL iovec.
1910         (bfd_bread): Similarly, and return error attempted out of
1911         bounds archive element access.
1912         (bfd_tell, bfd_flush): Use and update "iovec", "iostream", and
1913         "where" from containing archive file.
1914         (bfd_seek): Likewise.  Return error on NULL iovec.  Don't
1915         attempt to optimize away seeks.  Don't paper over errors by
1916         calling bfd_tell.
1917         (bfd_get_mtime): Call bfd_stat rather than iovec->bstat.
1918         (bfd_get_size): Likewise.
1919         (bfd_mmap): Operate on and use iovec of containing archive
1920         file.  Return error on NULL iovec.
1921         * cache.c (bfd_cache_lookup_worker): Abort if working on
1922         archive element bfd.
1923         (cache_bread_1): Delete bfd parameter, add FILE* parameter.
1924         Don't ignore zero byte reads.
1925         (cache_bread): Look up FILE* in cache here.  Error on NULL
1926         lookup.
1927         (cache_bwrite): Rename "where" to "from".
1928         (cache_bmmap): Don't handle archive elements.
1929         * coffcode.h (coff_slurp_line_table): Exit early on zero
1930         lineno count.
1931         * bfd-in2.h: Regenerate.
1932
1933 2018-06-05  Alan Modra  <amodra@gmail.com>
1934
1935         PR 23254
1936         * plugin.c (bfd_plugin_open_input): Allow for possibility of
1937         nested archives.  Open file again for plugin.
1938         (try_claim): Don't save and restore file position.  Close file
1939         if not claimed.
1940         * sysdep.h (O_BINARY): Define.
1941
1942 2018-06-04  Max Filippov  <jcmvbkbc@gmail.com>
1943
1944         * elf32-xtensa.c (xtensa_read_table_entries): Make global.
1945         (compute_fill_extra_space): Drop declaration. Rename function to
1946         xtensa_compute_fill_extra_space.
1947         (compute_ebb_actions, remove_dead_literal): Update references to
1948         compute_fill_extra_space.
1949
1950 2018-06-04  Volodymyr Arbatov  <arbatov@cadence.com>
1951
1952         * elf32-xtensa.c (elf32xtensa_separate_props): New global
1953         variable.
1954         (xtensa_add_names): New function.
1955         (xtensa_property_section_name): Add new parameter
1956         separate_sections, use it to choose property section name.
1957         (xtensa_get_separate_property_section): New function.
1958         (xtensa_get_property_section): Invoke
1959         xtensa_get_separate_property_section to get individual property
1960         section if it exists, common property section otherwise.
1961         (xtensa_make_property_section): Pass elf32xtensa_separate_props
1962         to xtensa_property_section_name.
1963
1964 2018-06-04  H.J. Lu  <hongjiu.lu@intel.com>
1965
1966         PR binutils/23146
1967         * bfd-in.h: Include "diagnostics.h".
1968         * bfd-in2.h: Regenerated.
1969         * elf32-arm.c (elf32_arm_nabi_write_core_note): Use
1970         DIAGNOSTIC_PUSH, DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION and
1971         DIAGNOSTIC_POP to silence GCC 8.1 warnings with
1972         -Wstringop-truncation.
1973         * elf32-ppc.c (ppc_elf_write_core_note): Likewse.
1974         * elf32-s390.c (elf_s390_write_core_note): Likewse.
1975         * elf64-ppc.c (ppc64_elf_write_core_note): Likewse.
1976         * elf64-s390.c (elf_s390_write_core_note): Likewse.
1977         * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewse.
1978
1979 2018-06-03  Jim Wilson  <jimw@sifive.com>
1980
1981         PR ld/23244
1982         * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Check
1983         for and handle an undefined weak with no PLT.
1984
1985         PR ld/22756
1986         * elfnn-riscv.c (riscv_relax_delete_bytes): Add versioned_hidden check
1987         to code that ignores duplicate symbols.
1988
1989 2018-06-01  H.J. Lu  <hongjiu.lu@intel.com>
1990
1991         * version.m4: Bump version to 2.30.52
1992         * configure: Regenerated.
1993
1994 2018-06-01  Alan Modra  <amodra@gmail.com>
1995
1996         * bfd.c (_bfd_error_handler): Arrange for this function to be
1997         declared in bfd-in2.h.
1998         * libbfd-in.h (_bfd_error_handler): Don't declare.
1999         * libbfd.h: Regenerate.
2000         * bfd-in2.h: Regenerate.
2001
2002 2018-05-30  Amaan Cheval <amaan.cheval@gmail.com>
2003
2004         * config.bfd (x86_64-*-*): Add pei-x86-64 target to x86_64-*-rtems*
2005         This is needed to generate UEFI application image files from ELFs.
2006
2007 2018-05-28  H.J. Lu  <hongjiu.lu@intel.com>
2008
2009         * elf32-i386.c (elf_i386_lazy_plt): Add plt_tlsdesc_entry,
2010         plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset,
2011         plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and
2012         plt_tlsdesc_got2_insn_end for TLSDESC entry.
2013         (elf_i386_lazy_ibt_plt): Likewise.
2014         (elf_i386_nacl_plt): Likewise.
2015         * elf64-x86-64.c (tlsdesc_plt_entry): Moved and renamed to ...
2016         (elf_x86_64_tlsdesc_plt_entry): This.
2017         (elf_x86_64_lazy_plt): Add plt_tlsdesc_entry,
2018         plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset,
2019         plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and
2020         plt_tlsdesc_got2_insn_end for TLSDESC entry.
2021         (elf_x86_64_lazy_bnd_plt): Likewise.
2022         (elf_x86_64_lazy_ibt_plt): Likewise.
2023         (elf_x32_lazy_ibt_plt): Likewise.
2024         (elf_x86_64_nacl_plt): Likewise.
2025         (elf_x86_64_finish_dynamic_sections): Use plt_tlsdesc_entry,
2026         plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset,
2027         plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and
2028         plt_tlsdesc_got2_insn_end to update TLSDESC entry.
2029         * elfxx-x86.h (elf_x86_lazy_plt_layout): Update comments.
2030         Add plt_tlsdesc_entry, plt_tlsdesc_entry_size,
2031         plt_tlsdesc_got1_offset, plt_tlsdesc_got2_offset,
2032         plt_tlsdesc_got1_insn_end and plt_tlsdesc_got2_insn_end.
2033         (elf_x86_non_lazy_plt_layout): Update comments.
2034         (elf_x86_plt_layout): Likewise.
2035
2036 2018-05-28  H.J. Lu  <hongjiu.lu@intel.com>
2037
2038         PR ld/23238
2039         * elf-s390-common.c (elf_s390_add_symbol_hook): Removed.
2040         * elf32-arc.c (elf_arc_add_symbol_hook): Likewise.
2041         (elf_backend_add_symbol_hook): Likewise.
2042         * elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise.
2043         (elf_backend_add_symbol_hook): Likewise.
2044         * elf32-s390.c (elf_backend_add_symbol_hook): Likewise.
2045         * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
2046         (elf_backend_add_symbol_hook): Likewise.
2047         * elf64-s390.c (elf_backend_add_symbol_hook): Likewise.
2048         * elfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise.
2049         * elfxx-aarch64.h (_bfd_aarch64_elf_add_symbol_hook): Likewise.
2050         (elf_backend_add_symbol_hook): Likewise.
2051         * elf32-arm.c (elf32_arm_add_symbol_hook): Remove STT_GNU_IFUNC
2052         handling.
2053         * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
2054         * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
2055         * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
2056         * elflink.c (elf_link_add_object_symbols): Set
2057         elf_gnu_symbol_ifunc for STT_GNU_IFUNC symbols.
2058
2059 2018-05-26  H.J. Lu  <hongjiu.lu@intel.com>
2060
2061         PR ld/23194
2062         * elf-bfd.h (_bfd_elf_link_hide_sym_by_version): New.
2063         * elflink.c (_bfd_elf_link_hide_versioned_symbol): New function.
2064         Extracted from _bfd_elf_link_assign_sym_version.
2065         (_bfd_elf_link_hide_sym_by_version): New function.
2066         (_bfd_elf_link_assign_sym_version): Use
2067         _bfd_elf_link_hide_versioned_symbol.
2068         * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Call
2069         _bfd_elf_link_hide_sym_by_version instead of
2070         bfd_hide_sym_by_version.  Don't check unversioned symbol.
2071
2072 2018-05-25  Alan Modra  <amodra@gmail.com>
2073
2074         * Makefile.in: Regenerate.
2075         * po/SRC-POTFILES.in: Regenerate.
2076
2077 2018-05-25  Alan Modra  <amodra@gmail.com>
2078
2079         * configure.ac (bfd_cv_hidden): Run test with -Werror in CFLAGS.
2080         * configure: Regenerate.
2081
2082 2018-05-23  H.J. Lu  <hongjiu.lu@intel.com>
2083
2084         * elf64-ppc.c (ppc64_elf_write_core_note): Add ATTRIBUTE_NONSTRING
2085         to data.
2086
2087 2018-05-22  Alan Modra  <amodra@gmail.com>
2088
2089         PR 23207
2090         * elf32-hppa.c (hppa_get_stub_entry): Return NULL when link_sec
2091         is NULL.
2092         (elf32_hppa_size_stubs): Only create stubs for load, alloc, code
2093         sections.
2094         (final_link_relocate): Revert last change.
2095
2096 2018-05-22  Alan Modra  <amodra@gmail.com>
2097
2098         PR 23207
2099         * elf32-hppa.c (final_link_relocate): Don't look for plt call
2100         stubs in non-alloc sections.
2101
2102 2018-05-21  H.J. Lu  <hongjiu.lu@intel.com>
2103
2104         PR ld/23201
2105         * aout-target.h (MY_bfd_link_hide_symbol): New.
2106         * aout-tic30.c (MY_bfd_link_hide_symbol): Likewise.
2107         * binary.c (binary_bfd_link_hide_symbol): Likewise.
2108         * coff-alpha.c (_bfd_ecoff_bfd_link_hide_symbol): Likewise.
2109         * coff-mips.c (_bfd_ecoff_bfd_link_hide_symbol): Likewise.
2110         * coff-rs6000.c (_bfd_xcoff_bfd_link_hide_symbol): Likewise.
2111         * coffcode.h (coff_bfd_link_hide_symbol): Likewise.
2112         * elf-bfd.h (_bfd_elf_link_hide_symbol): Likewise.
2113         * elfxx-target.h (bfd_elfNN_bfd_link_hide_symbol): Likewise.
2114         * i386msdos.c (msdos_bfd_link_hide_symbol): Likewise.
2115         * ihex.c (ihex_bfd_link_hide_symbol): Likewise.
2116         * libbfd-in.h (_bfd_nolink_bfd_link_hide_symbol): Likewise.
2117         * linker.c (_bfd_generic_link_hide_symbol): Likewise.
2118         (bfd_link_hide_symbol): Likewise.
2119         * mach-o-target.c (bfd_mach_o_bfd_link_hide_symbol): Likewise.
2120         * mmo.c (mmo_bfd_link_hide_symbol): Likewise.
2121         * pef.c (bfd_pef_bfd_link_hide_symbol): Likewise.
2122         * plugin.c (bfd_plugin_bfd_link_hide_symbol): Likewise.
2123         * ppcboot.c (ppcboot_bfd_link_hide_symbol): Likewise.
2124         * som.c (som_bfd_link_hide_symbol): Likewise.
2125         * srec.c (srec_bfd_link_hide_symbol): Likewise.
2126         * tekhex.c (tekhex_bfd_link_hide_symbol): Likewise.
2127         * vms-alpha.c (vms_bfd_link_hide_symbol): Likewise.
2128         (alpha_vms_bfd_link_hide_symbol): Likewise.
2129         * xsym.c (bfd_sym_bfd_link_hide_symbol): Likewise.
2130         * coff64-rs6000.c (rs6000_xcoff64_vec): Add
2131         _bfd_generic_link_hide_symbol.
2132         (rs6000_xcoff64_aix_vec): Likewise.
2133         * elflink.c (bfd_elf_record_link_assignment): Don't make forced
2134         local symbol dynamic.
2135         (_bfd_elf_link_hide_symbol): New function.
2136         * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
2137         check root.ldscript_def.
2138         * targets.c (bfd_target): Add _bfd_link_hide_symbol.
2139         (BFD_JUMP_TABLE_LINK): Add NAME##_bfd_link_hide_symbol.
2140         * bfd-in2.h: Regenerated.
2141         * libbfd.h: Likewise.
2142
2143 2018-05-21  H.J. Lu  <hongjiu.lu@intel.com>
2144
2145         PR binutils/23199
2146         * elf.c (setup_group): Mark section in a section group with
2147         SHF_GROUP.
2148
2149 2018-05-18  H.J. Lu  <hongjiu.lu@intel.com>
2150
2151         PR ld/23194
2152         * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
2153         set eh->local_ref to 1 if a symbol is versioned and there is a
2154         version script.
2155
2156 2018-05-18  Kito Cheng  <kito.cheng@gmail.com>
2157
2158         * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Handle
2159         EF_RISCV_RVE.
2160
2161 2018-05-18  Jim Wilson  <jimw@sifive.com>
2162
2163         * elfnn-riscv.c (allocate_dynrelocs): Discard dynamic relocations if
2164         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
2165         (riscv_elf_relocate_section): Don't generate dynamic relocation if
2166         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
2167         (riscv_elf_finish_dynamic_symbol): Likewise.
2168
2169 2018-05-18  John Darrington  <john@darrington.wattle.id.au>
2170
2171         * Makefile.am: Add s12z files.
2172         * Makefile.in: Regenerate.
2173         * archures.c: Add bfd_s12z_arch.
2174         * bfd-in.h: Add exports of bfd_putb24 and bfd_putl24.
2175         * bfd-in2.h: Regenerate.
2176         * config.bfd: Add s12z target.
2177         * configure.ac: Add s12z target.
2178         * configure: Regenerate.
2179         * cpu-s12z.c: New file.
2180         * elf32-s12z.c: New file.
2181         * libbfd.c (bfd_putb24): New function.
2182         (bfd_putl24): New function.
2183         * libbfd.h: Regenerate.
2184         * reloc.c: Add s12z relocations.
2185         (bfd_get_reloc_size): Handle size 5 relocs.
2186         * targets.c: Add s12z_elf32_vec.
2187
2188 2018-05-18  H.J. Lu  <hongjiu.lu@intel.com>
2189
2190         PR ld/23189
2191         * elf32-i386.c (elf_i386_relocate_section): Handle R_386_GOT32X
2192         like R_386_GOT32.
2193         * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
2194         set eh->local_ref to 1 for linker defined symbols.
2195
2196 2018-05-18  Alan Modra  <amodra@gmail.com>
2197
2198         PR 23199
2199         * elf.c (setup_group): Formatting.  Check that SHT_GROUP entries
2200         don't point at other SHT_GROUP sections.  Set shdr corresponding
2201         to invalid entry, to NULL rather than section 0.  Identify
2202         SHT_GROUP section index when reporting an error.  Cope with NULL
2203         shdr pointer.
2204
2205 2018-05-18  Alan Modra  <amodra@gmail.com>
2206
2207         * libbfd-in.h (ATTRIBUTE_HIDDEN): Define and use throughout.
2208         * configure.ac (HAVE_HIDDEN): Check compiler support for hidden
2209         visibility.
2210         * libbfd.h: Regenerate.
2211         * configure: Regenerate.
2212         * config.in: Regenerate.
2213
2214 2018-05-18  Alan Modra  <amodra@gmail.com>
2215
2216         * libbfd-in.h: Add include guard.
2217         * libcoff-in.h: Likewise.
2218         * doc/Makefile.am (libbfd.h, libcoff.h): Append another #endif.
2219         * doc/Makefile.in: Regenerate.
2220         * libbfd.h: Regenerate.
2221         * libcoff.h: Regenerate.
2222
2223 2018-05-16  Maciej W. Rozycki  <macro@mips.com>
2224
2225         * elf32-nds32.c (nds32_convert_32_to_16): Preset `insn_type'.
2226
2227 2018-05-16  Alan Modra  <amodra@gmail.com>
2228
2229         PR 22458
2230         * format.c (struct bfd_preserve): Add section_id.
2231         (bfd_preserve_save, bfd_preserve_restore): Save and restore
2232         _bfd_section_id.
2233         (bfd_reinit): Set _bfd_section_id.
2234         (bfd_check_format_matches): Put all matches of any priority into
2235         matching_vector.  Save initial section id and start each attempted
2236         match at that section id.
2237         * libbfd-in.h (_bfd_section_id): Declare.
2238         * section.c (_bfd_section_id): Rename from section_id and make
2239         global.  Adjust uses.
2240         (bfd_get_next_section_id): Delete.
2241         * elf64-ppc.c (ppc64_elf_setup_section_lists): Replace use of
2242         bfd_get_section_id with _bfd_section_id.
2243         * libbfd.h: Regenerate.
2244         * bfd-in2.h: Regenerate.
2245
2246 2018-05-15  Christophe Guillon  <christophe.guillon@st.com>
2247
2248         * coffcode.h (coff_bigobj_swap_aux_in): Make sure that all fields
2249         of the aux structure are initialised.
2250
2251 2018-05-15  Francois H. Theron  <francois.theron@netronome.com>
2252
2253         * targets.c: Wrap nfp_elf64_vec in BFD64 ifdef.
2254
2255 2018-05-15  Nick Clifton  <nickc@redhat.com>
2256
2257         * po/pt.po: New Portuguese translation.
2258         * configure.ac (ALL_LINGUAS): Add pt.
2259         * configure: Regenerate.
2260
2261 2018-05-14  H.J. Lu  <hongjiu.lu@intel.com>
2262
2263         PR ld/23169
2264         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Don't issue
2265         an error on IFUNC pointer defined in PDE.
2266         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Call
2267         _bfd_x86_elf_link_fixup_ifunc_symbol.
2268         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
2269         * elfxx-x86.c (_bfd_x86_elf_link_fixup_ifunc_symbol): New
2270         function.
2271         * elfxx-x86.h (_bfd_x86_elf_link_fixup_ifunc_symbol): New.
2272
2273 2018-05-14  H.J. Lu  <hongjiu.lu@intel.com>
2274
2275         PR ld/23162
2276         * elfxx-x86.c (elf_x86_linker_defined): New function.
2277         (_bfd_x86_elf_link_check_relocs): Use it to mark __bss_start,
2278         _end and _edata locally defined within executables.
2279
2280 2018-05-12  Alan Modra  <amodra@gmail.com>
2281
2282         PR 20659
2283         * elf.c (rewrite_elf_program_header): Use segment_mark only for
2284         PT_LOAD headers.  Delete first_matching_lma and first_suggested_lma.
2285         Instead make matching_lma and suggested_lma pointers to the
2286         sections.  Align section vma and lma calculated from segment.
2287         Don't clear includes_phdrs or includes_filehdr based on p_paddr
2288         test.  Try to handle alignment padding before first section by
2289         adjusting new segment lma down.  Adjust PT_PHDR map p_paddr.
2290
2291 2018-05-09  Dimitar Dimitrov  <dimitar@dinux.eu>
2292
2293         * elf32-pru.c (pru_elf32_do_ldi32_relocate): Make LDI32 relocation
2294         conformant to TI ABI.
2295         (pru_elf32_relax_section): Likewise.
2296         (pru_elf_relax_delete_bytes): Fix offsets for new LDI32 code.
2297         * elf32-pru.c (pru_elf32_do_ldi32_relocate): Ignore addend.
2298         (pru_elf32_pmem_relocate): Trap - should not get here.
2299         (pru_elf32_relocate_section): Add support for REL relocations.
2300         (elf_info_to_howto_rel): Enable REL.
2301         (elf_backend_may_use_rel_p): Likewise.
2302         (elf_backend_may_use_rela_p): Likewise.
2303         (elf_backend_default_use_rela_p): Likewise.
2304
2305 2018-05-09  Alan Modra  <amodra@gmail.com>
2306
2307         PR 23148
2308         * peXXigen.c (pe_print_edata): Correct minimum size.
2309
2310 2018-05-09  Alan Modra  <amodra@gmail.com>
2311
2312         PR 23147
2313         * peXXigen.c (pe_print_idata): Bound check hint_addr.
2314
2315 2018-05-08  Nick Clifton  <nickc@redhat.com>
2316
2317         PR 22809
2318         * elf.c (bfd_elf_get_str_section): Check for an excessively large
2319         string section.
2320         * elf-attrs.c (_bfd_elf_parse_attributes): Issue an error if the
2321         attribute section is larger than the size of the file.
2322
2323 2018-05-07  Alan Modra  <amodra@gmail.com>
2324
2325         * cofflink.c (_bfd_coff_link_input_bfd): Use memcmp rather than
2326         strncmp when checking for ".bf" special symbol.
2327         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Make pe_required_section_flags
2328         section name a char array, remove sentinal known_sections entry,
2329         and adjust loop over known_sections to suit.  Use memcmp rather
2330         than strncmp.
2331
2332 2018-05-04  Alan Modra  <amodra@gmail.com>
2333
2334         * elf-linux-core.h (struct elf_external_linux_prpsinfo32_ugid32),
2335         (struct elf_external_linux_prpsinfo32_ugid16),
2336         (struct elf_external_linux_prpsinfo64_ugid32),
2337         (struct elf_external_linux_prpsinfo64_ugid16): Add ATTRIBUTE_NONSTRING
2338         to pr_fname and pr_psargs fields.  Remove GCC diagnostic pragmas.
2339         Move comment to..
2340         * elf.c (elfcore_write_prpsinfo): ..here.  Indent nested preprocessor
2341         directives.
2342         * elf32-arm.c (elf32_arm_nabi_write_core_note): Add ATTRIBUTE_NONSTRING
2343         to data.
2344         * elf32-ppc.c (ppc_elf_write_core_note): Likewise.
2345         * elf32-s390.c (elf_s390_write_core_note): Likewise.
2346         * elf64-s390.c (elf_s390_write_core_note): Likewise.
2347         * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewise.
2348         * elf64-x86-64.c (elf_x86_64_write_core_note): Add GCC diagnostic
2349         pragmas.
2350         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Use strnlen to avoid
2351         false positive gcc-8 warning.
2352         * cofflink.c (_bfd_coff_link_input_bfd): Likewise.
2353
2354 2018-05-04  Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>
2355
2356         * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Fix the order
2357         of arguments when warning about different long double types.
2358
2359 2018-05-03  Simon Atanasyan  <simon@atanasyan.com>
2360
2361         * elf32-mips.c: (elf32_mips_fixup_symbol): New function.
2362         (elf_backend_fixup_symbol): New macro.
2363         * elfxx-mips.c: (mips_elf_output_extsym): Discard _gp_disp
2364         handling.
2365         (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
2366
2367 2018-04-30  Francois H. Theron <francois.theron@netronome.com>
2368
2369         * Makefile.am: Added NFP files to build.
2370         * archures.c: Added bfd_arch_nfp
2371         * config.bfd: Added NFP support.
2372         * configure.ac: Added NFP support.
2373         * cpu-nfp.c: New, for NFP support.
2374         * elf-bfd.h: Added elf_section_info()
2375         * elf64-nfp.c: New, for NFP support.
2376         * po/SRC-POTFILES.in: Added NFP source files.
2377         * targets.c: Added nfp_elf64_vec
2378         * bfd-in2.h: Regenerate.
2379         * Makefile.in: Regenerate.
2380         * configure: Regenerate.
2381
2382 2018-04-27  Alan Modra  <amodra@gmail.com>
2383
2384         * bfd-in2.h: Regenerate.
2385         * libbfd.h: Regenerate.
2386
2387 2018-04-27  Alan Modra  <amodra@gmail.com>
2388
2389         PR 23123
2390         PR 22374
2391         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't drop plt
2392         relocs for ifuncs.
2393         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Comment fixes.
2394
2395 2018-04-26  Pedro Alves  <palves@redhat.com>
2396
2397         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't consider
2398         ifunc and non-ifunc symbols duplicates.
2399
2400 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
2401         Mickaël Guêné  <mickael.guene@st.com>
2402
2403         * elf32-arm.c (elf32_arm_fdpic_thumb_plt_entry): New.
2404         (elf32_arm_plt_needs_thumb_stub_p): Handle thumb-only case.
2405         (elf32_arm_populate_plt_entry): Likewise.
2406         (elf32_arm_output_plt_map_1): Likewise.
2407         (elf32_arm_output_arch_local_syms): Likewise.
2408
2409 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
2410         Mickaël Guêné  <mickael.guene@st.com>
2411
2412         * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Handle
2413         _GLOBAL_OFFSET_TABLE_ in FDPIC mode.
2414
2415 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
2416         Mickaël Guêné  <mickael.guene@st.com>
2417
2418         * elf32-arm.c (bfd_elf32_arm_set_target_params): Handle FDPIC case
2419         for R_ARM_TARGET2.
2420
2421 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
2422         Mickaël Guêné  <mickael.guene@st.com>
2423
2424         * elf32-arm.c (DEFAULT_STACK_SIZE): New.
2425         (elf32_arm_always_size_sections): Create stack segment.
2426
2427 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
2428         Mickaël Guêné  <mickael.guene@st.com>
2429
2430         * bfd-in2.h (BFD_RELOC_ARM_TLS_GD32_FDPIC)
2431         (BFD_RELOC_ARM_TLS_LDM32_FDPIC, BFD_RELOC_ARM_TLS_IE32_FDPIC): New
2432         relocations.
2433         * elf32-arm.c (elf32_arm_howto_table_2): Add R_ARM_TLS_GD32_FDPIC,
2434         R_ARM_TLS_LDM32_FDPIC, R_ARM_TLS_IE32_FDPIC relocations.
2435         (elf32_arm_reloc_map): Add R_ARM_TLS_GD32_FDPIC,
2436         R_ARM_TLS_LDM32_FDPIC, R_ARM_TLS_IE32_FDPIC.
2437         (struct elf32_arm_link_hash_table): Update comment.
2438         (elf32_arm_final_link_relocate): Handle TLS FDPIC relocations.
2439         (IS_ARM_TLS_RELOC): Likewise.
2440         (elf32_arm_check_relocs): Likewise.
2441         (allocate_dynrelocs_for_symbol): Likewise.
2442         (elf32_arm_size_dynamic_sections): Update comment.
2443         * reloc.c: Add BFD_RELOC_ARM_TLS_GD32_FDPIC,
2444         BFD_RELOC_ARM_TLS_LDM32_FDPIC, BFD_RELOC_ARM_TLS_IE32_FDPIC.
2445
2446 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
2447         Mickaël Guêné  <mickael.guene@st.com>
2448
2449         * elf32-arm.c (elf32_arm_fdpic_plt_entry): New.
2450         (elf32_arm_create_dynamic_sections): Handle FDPIC.
2451         (elf32_arm_allocate_plt_entry): Likewise.
2452         (elf32_arm_populate_plt_entry): Likewise.
2453         (elf32_arm_output_plt_map_1): Likewise.
2454
2455 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
2456         Mickaël Guêné  <mickael.guene@st.com>
2457
2458         * elf32-arm.c (struct fdpic_local): New.
2459         (elf_arm_obj_tdata): Add local_fdpic_cnts field.
2460         (elf32_arm_local_fdpic_cnts): New.
2461         (struct fdpic_global): New.
2462         (elf32_arm_link_hash_entry): Add fdpic_cnts field.
2463         (elf32_arm_link_hash_table): Add srofixup field.
2464         (arm_elf_add_rofixup): New.
2465         (arm_elf_fill_funcdesc): New.
2466         (elf32_arm_link_hash_newfunc): Handle fdpic_cnts.
2467         (elf32_arm_allocate_local_sym_info): Likewise.
2468         (create_got_section): Create .rofixup section.
2469         (elf32_arm_copy_indirect_symbol): Handle fdpic_cnts.
2470         (bfd_elf32_arm_set_target_params): Handle FDPIC.
2471         (elf32_arm_final_link_relocate): Likewise.
2472         (elf32_arm_check_relocs): Likewise.
2473         (allocate_dynrelocs_for_symbol): Likewise.
2474         (elf32_arm_size_dynamic_sections): Likewise.
2475         (elf32_arm_finish_dynamic_sections): Likewise.
2476         (elf32_arm_output_arch_local_syms): Likewise.
2477         (elf32_arm_fdpic_omit_section_dynsym): New.
2478
2479 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
2480         Mickaël Guêné  <mickael.guene@st.com>
2481
2482         * bfd-in2.c (BFD_RELOC_ARM_GOTFUNCDESC)
2483         (BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC)
2484         (BFD_RELOC_ARM_FUNCDESC_VALUE): New.
2485         * elf32-arm.c (elf32_arm_howto_table_2): Add R_ARM_GOTFUNCDESC,
2486         R_ARM_GOTOFFFUNCDESC, R_ARM_FUNCDESC, R_ARM_FUNCDESC_VALUE.
2487         (elf32_arm_howto_from_type): Take new members of
2488         elf32_arm_howto_table_2 into account.
2489         (elf32_arm_reloc_map): Add BFD_RELOC_ARM_GOTFUNCDESC,
2490         BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC,
2491         BFD_RELOC_ARM_FUNCDESC_VALUE.
2492         * reloc.c: Add BFD_RELOC_ARM_GOTFUNCDESC,
2493         BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC,
2494         BFD_RELOC_ARM_FUNCDESC_VALUE.
2495
2496 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
2497         Mickaël Guêné  <mickael.guene@st.com>
2498
2499         * elf32-arm.c (elf32_arm_print_private_bfd_data): Support
2500         EF_ARM_PIC and ELFOSABI_ARM_FDPIC.
2501         (elf32_arm_post_process_headers): Support ELFOSABI_ARM_FDPIC.
2502         (ELF_OSABI): Define to ELFOSABI_ARM_FDPIC.
2503
2504 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
2505         Mickaël Guêné  <mickael.guene@st.com>
2506
2507         * config.bfd (arm*-*-linux-*): Add arm_elf32_fdpic_be_vec and
2508         arm_elf32_fdpic_le_vec to targ_selvecs. Accept
2509         arm*-*-uclinuxfdpiceabi.
2510         * configure.ac: Add support for arm_elf32_fdpic_be_vec and
2511         arm_elf32_fdpic_le_vec.
2512         * configure: Regenerate.
2513         * elf32-arm.c (struct elf32_arm_link_hash_table): Add fdpic_p.
2514         (elf32_arm_link_hash_table_create): Initialize fdpic_p.
2515         (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, TARGET_BIG_SYM)
2516         (TARGET_BIG_NAME, elf_match_priority): Define for FDPIC targets.
2517         (elf32_arm_fdpic_link_hash_table_create): New.
2518         * targets.c (_bfd_target_vector): Add arm_elf32_fdpic_be_vec and
2519         arm_elf32_fdpic_le_vec.
2520
2521 2018-04-25  Alan Modra  <amodra@gmail.com>
2522
2523         * elf-linux-core.h: Disable gcc-8 string truncation warning.
2524         * elf.c (elfcore_write_prpsinfo): Likewise.
2525
2526 2018-04-25  Alan Modra  <amodra@gmail.com>
2527
2528         * Makefile.am: Remove arm-aout and arm-coff support.
2529         * config.bfd: Likewise.
2530         * configure.ac: Likewise.
2531         * targets.c: Likewise.
2532         * aout-arm.c: Delete.
2533         * armnetbsd.c: Delete.
2534         * riscix.c: Delete.
2535         * Makefile.in: Regenerate.
2536         * configure: Regenerate.
2537         * po/SRC-POTFILES.in: Regenerate.
2538
2539 2018-04-24  Nick Clifton  <nickc@redhat.com>
2540
2541         PR 23113
2542         * elf.c (ignore_section_sym): Check for the output_section pointer
2543         being NULL before dereferencing it.
2544
2545         PR 23110
2546         * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check for
2547         a negative PE_DEBUG_DATA size before iterating over the debug data.
2548
2549 2018-04-23  Alan Modra  <amodra@gmail.com>
2550
2551         * elf-linux-core.h: Revert last change.
2552         * elf.c: Likewise.
2553
2554 2018-04-23  Nick Clifton  <nickc@redhat.com>
2555
2556         PR 23056
2557         * aoutx.h (aout_get_external_symbols): Allocate an extra byte at
2558         the end of the string table, and zero it.
2559
2560 2018-04-23  Alan Modra  <amodra@gmail.com>
2561
2562         * elf-linux-core.h (swap_linux_prpsinfo32_ugid32_out): Disable
2563         gcc-8 string truncation warning.
2564         (swap_linux_prpsinfo32_ugid16_out): Likewise.
2565         (swap_linux_prpsinfo64_ugid32_out): Likewise.
2566         (swap_linux_prpsinfo64_ugid16_out): Likewise.
2567         * elf.c (elfcore_write_prpsinfo): Likewise.
2568
2569 2018-04-23  Nick Clifton  <nickc@redhat.com>
2570
2571         PR 23056
2572         * aoutx.h (aout_get_external_symbols): Allocate an extra byte at
2573         the end of the string table, and zero it.
2574
2575 2018-04-20  Alan Modra  <amodra@gmail.com>
2576
2577         PR 22978
2578         * elf32-hppa.c (got_relocs_needed): Add extra param to special
2579         case both dtprel and tprel relocs.
2580         (allocate_dynrelocs): Adjust conditions for got relocs.
2581         (elf32_hppa_relocate_section): Likewise for local sym got relocs.
2582         Emit dynamic relocs on TLS GOT entries for shared libraries,
2583         not when pic.  Omit dynamic reloc on dtprel entry when local,
2584         and on tprel entry when local and executable.
2585
2586 2018-04-19  Alan Modra  <amodra@gmail.com>
2587
2588         PR 22537
2589         * elf32-hppa.c (elf32_hppa_size_stubs): Init "destination" to -1.
2590         (hppa_type_of_stub): Don't return a long branch stub for
2591         symbols other than those defined statically.
2592
2593 2018-04-19  Alan Modra  <amodra@gmail.com>
2594
2595         * Makefile.am: Revert 2018-04-18 coff-mips changes.
2596         * config.bfd: Add back mips_ecoff_le_vec and mips_ecoff_be_vec
2597         to selvecs for mips targets change 2018-04-18.
2598         * configure.ac: Reinstate mips_ecoff_le_vec, mips_ecoff_be_vec
2599         and  mips_ecoff_bele_vec.
2600         * targets.c: Likewise.
2601         * coff-mips.c: Resurrect.
2602         * Makefile.in: Regenerate.
2603         * configure: Regenerate.
2604         * po/SRC-POTFILES.in: Regenerate.
2605
2606 2018-04-18  Alan Modra  <amodra@gmail.com>
2607
2608         * Makefile.am: Remove mips aout and coff support.
2609         * config.bfd: Likewise.
2610         * configure.ac: Likewise.
2611         * targets.c: Likewise.
2612         * coff-mips.c: Delete
2613         * mipsbsd.c: Delete
2614         * pe-mips.c: Delete
2615         * pei-mips.c: Delete
2616         * Makefile.in: Regenerate.
2617         * configure: Regenerate.
2618         * po/SRC-POTFILES.in: Regenerate.
2619
2620 2018-04-17  H.J. Lu  <hongjiu.lu@intel.com>
2621
2622         * elf32-i386.c (elf32_bed): Define before including
2623         "elf32-target.h".
2624         * elf64-x86-64.c (elf64_bed): Define before including
2625         "elf64-target.h".
2626         (elf32_bed): Define before including "elf32-target.h".
2627
2628 2018-04-17  H.J. Lu  <hongjiu.lu@intel.com>
2629
2630         PR ld/23055
2631         * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Use a
2632         normal input file with compatible relocation.
2633
2634 2018-04-18  Alan Modra  <amodra@gmail.com>
2635
2636         * Makefile.am: Remove support for assorted i386 aout and coff targets.
2637         * config.bfd: Likewise.
2638         * configure.ac: Likewise.
2639         * doc/bfdint.texi: Likewise.
2640         * targets.c: Likewise.
2641         * freebsd.h: Delete.
2642         * i386dynix.c: Delete.
2643         * i386freebsd.c: Delete.
2644         * i386linux.c: Delete.
2645         * i386mach3.c: Delete.
2646         * i386netbsd.c: Delete.
2647         * i386os9k.c: Delete.
2648         * Makefile.in: Regenerate.
2649         * configure: Regenerate.
2650         * po/SRC-POTFILES.in: Regenerate.
2651
2652 2018-04-17 Andrew Sadek  <andrew.sadek.se@gmail.com>
2653
2654         Microblaze Target: PIC data text relative
2655
2656         * bfd/reloc.c (2 new BFD relocations):
2657         BFD_RELOC_MICROBLAZE_64_TEXTPCREL &
2658         BFD_RELOC_MICROBLAZE_64_TEXTPCREL
2659         * bfd/bfd-in2.h: Regenerate
2660         * bfd/libbfd.h: Regenerate
2661         * bfd/elf32-microblaze.c (Handle new relocs): define 'HOWTO' of 3
2662         new relocs and handle them in both relocate and relax functions.
2663         (microblaze_elf_reloc_type_lookup): add mapping between for new
2664         bfd relocs.
2665         (microblaze_elf_relocate_section): Handle new relocs in case of
2666         elf relocation.
2667         (microblaze_elf_relax_section): Handle new relocs for elf relaxation.
2668
2669 2018-04-17  Nick Clifton  <nickc@redhat.com>
2670
2671         PR 23055
2672         * aoutx.h (find_nearest_line): Check that the symbol name exists
2673         and is long enough, before attempting to see if it is for a .o
2674         file.
2675         * hash.c (bfd_hash_hash): Add an assertion that the string is not
2676         NULL.
2677         * linker.c (bfd_link_hash_lookup): Fail if the table or string are
2678         NULL.
2679         (_bfd_generic_link_add_archive_symbols): Fail if an archive entry
2680         has no name.
2681
2682         PR 23065
2683         * dwarf2.c (concat_filename): Check for a NULL table pointer.
2684
2685 2018-04-16  Nick Clifton  <nickc@redhat.com>
2686
2687         PR 23061
2688         * coffgen.c (coff_pointerize_aux): Check for an out of range
2689         fixup.
2690
2691 2018-04-16  Alan Modra  <amodra@gmail.com>
2692
2693         * Makefile.am: Remove arm-epoc-pe support.
2694         * coff-arm.c: Likewise.
2695         * config.bfd: Likewise.
2696         * configure.ac: Likewise.
2697         * targets.c: Likewise.
2698         * epoc-pe-arm.c: Delete.
2699         * epoc-pei-arm.c: Delete.
2700         * Makefile.in: Regenerate.
2701         * configure: Regenerate.
2702         * po/SRC-POTFILES.in: Regenerate.
2703
2704 2018-04-16  Alan Modra  <amodra@gmail.com>
2705
2706         * Makefile.am: Remove sparc-aout and sparc-coff support.
2707         * config.bfd: Likewise.
2708         * configure.ac: Likewise.
2709         * targets.c: Likewise.
2710         * aout-sparcle.c: Delete.
2711         * aoutf1.h: Delete.
2712         * cf-sparclynx.c: Delete.
2713         * coff-sparc.c: Delete.
2714         * demo64.c: Delete.
2715         * sparclinux.c: Delete.
2716         * sparclynx.c: Delete.
2717         * sparcnetbsd.c: Delete.
2718         * sunos.c: Delete.
2719         * Makefile.in: Regenerate.
2720         * configure: Regenerate.
2721         * po/SRC-POTFILES.in: Regenerate.
2722
2723 2018-04-16  Alan Modra  <amodra@gmail.com>
2724
2725         * Makefile.am: Remove m68k-aout and m68k-coff support.
2726         * aoutf1.h: Likewise.
2727         * aoutx.h: Likewise.
2728         * archive.c: Likewise.
2729         * bfd-in.h: Likewise.
2730         * bfd.c: Likewise.
2731         * coffcode.h: Likewise.
2732         * coffswap.h: Likewise.
2733         * config.bfd: Likewise.
2734         * configure.ac: Likewise.
2735         * configure.host: Likewise.
2736         * doc/bfd.texinfo: Likewise.
2737         * doc/bfdint.texi: Likewise.
2738         * freebsd.h: Likewise.
2739         * gen-aout.c: Likewise.
2740         * hpux-core.c: Likewise.
2741         * libaout.h: Likewise.
2742         * libbfd-in.h: Likewise.
2743         * pdp11.c: Likewise.
2744         * peicode.h: Likewise.
2745         * riscix.c: Likewise.
2746         * targets.c: Likewise.
2747         * aout0.c: Delete.
2748         * coff-apollo.c: Delete.
2749         * coff-aux.c: Delete.
2750         * coff-m68k.c: Delete.
2751         * coff-svm68k.c: Delete.
2752         * coff-u68k.c: Delete.
2753         * hosts/delta68.h: Delete.
2754         * hosts/hp300bsd.h: Delete.
2755         * hosts/m68kaux.h: Delete.
2756         * hosts/news.h: Delete.
2757         * hp300bsd.c: Delete.
2758         * hp300hpux.c: Delete.
2759         * liboasys.h: Delete.
2760         * m68k4knetbsd.c: Delete.
2761         * m68klinux.c: Delete.
2762         * m68knetbsd.c: Delete.
2763         * oasys.c: Delete.
2764         * versados.c: Delete.
2765         * Makefile.in: Regenerate.
2766         * bfd-in2.h: Regenerate.
2767         * configure: Regenerate.
2768         * libbfd.h: Regenerate.
2769         * po/SRC-POTFILES.in: Regenerate.
2770
2771 2018-04-16  Alan Modra  <amodra@gmail.com>
2772
2773         * Makefile.am: Remove sh5 and sh64 support.
2774         * archures.c: Likewise.
2775         * config.bfd: Likewise.
2776         * configure.ac: Likewise.
2777         * cpu-sh.c: Likewise.
2778         * elf32-sh-relocs.h: Likewise.
2779         * elf32-sh.c: Likewise.
2780         * targets.c: Likewise.
2781         * elf32-sh64-com.c: Delete.
2782         * elf32-sh64.c: Delete.
2783         * elf32-sh64.h: Delete.
2784         * elf64-sh64.c: Delete.
2785         * Makefile.in: Regenerate.
2786         * bfd-in2.h: Regenerate.
2787         * configure: Regenerate.
2788         * po/SRC-POTFILES.in: Regenerate.
2789
2790 2018-04-16  Alan Modra  <amodra@gmail.com>
2791
2792         * Makefile.am: Remove sh-symbianelf support.
2793         * config.bfd: Likewise.
2794         * configure.ac: Likewise.
2795         * targets.c: Likewise.
2796         * elf32-sh-symbian.c: Delete.
2797         * Makefile.in: Regenerate.
2798         * configure: Regenerate.
2799         * po/SRC-POTFILES.in: Regenerate.
2800
2801 2018-04-16  Alan Modra  <amodra@gmail.com>
2802
2803         * Makefile.am: Remove vax-bsd and vax-ultrix support.
2804         * config.bfd: Likewise.
2805         * configure.ac: Likewise.
2806         * targets.c: Likewise.
2807         * vaxbsd.c: Delete.
2808         * Makefile.in: Regenerate.
2809         * configure: Regenerate.
2810         * po/SRC-POTFILES.in: Regenerate.
2811
2812 2018-04-16  Alan Modra  <amodra@gmail.com>
2813
2814         * Makefile.am: Remove w65 support.
2815         * archures.c: Likewise.
2816         * coffcode.h: Likewise.
2817         * config.bfd: Likewise.
2818         * configure.ac: Likewise.
2819         * targets.c: Likewise.
2820         * coff-w65.c: Delete.
2821         * cpu-w65.c: Delete.
2822         * Makefile.in: Regenerate.
2823         * bfd-in2.h: Regenerate.
2824         * configure: Regenerate.
2825         * po/SRC-POTFILES.in: Regenerate.
2826
2827 2018-04-16  Alan Modra  <amodra@gmail.com>
2828
2829         * Makefile.am: Remove we32k support.
2830         * archures.c: Likewise.
2831         * coffcode.h: Likewise.
2832         * config.bfd: Likewise.
2833         * configure.ac: Likewise.
2834         * targets.c: Likewise.
2835         * coff-we32k.c: Delete.
2836         * cpu-we32k.c: Delete.
2837         * Makefile.in: Regenerate.
2838         * bfd-in2.h: Regenerate.
2839         * configure: Regenerate.
2840         * po/SRC-POTFILES.in: Regenerate.
2841
2842 2018-04-16  Alan Modra  <amodra@gmail.com>
2843
2844         * Makefile.am: Remove m88k support.
2845         * aoutx.h: Likewise.
2846         * archures.c: Likewise.
2847         * coffcode.h: Likewise.
2848         * coffswap.h: Likewise.
2849         * config.bfd: Likewise.
2850         * configure.ac: Likewise.
2851         * cpu-ns32k.c: Likewise.
2852         * elf32-nds32.c: Likewise.
2853         * mach-o.c: Likewise.
2854         * netbsd-core.c: Likewise.
2855         * reloc.c: Likewise.
2856         * targets.c: Likewise.
2857         * coff-m88k.c: Delete.
2858         * cpu-m88k.c: Delete.
2859         * elf32-m88k.c: Delete.
2860         * hosts/m88kmach3.h: Delete.
2861         * m88kmach3.c: Delete.
2862         * m88kopenbsd.c: Delete.
2863         * Makefile.in: Regenerate.
2864         * bfd-in2.h: Regenerate.
2865         * configure: Regenerate.
2866         * po/SRC-POTFILES.in: Regenerate.
2867
2868 2018-04-16  Alan Modra  <amodra@gmail.com>
2869
2870         * Makefile.am: Remove i370 support.
2871         * archures.c: Likewise.
2872         * config.bfd: Likewise.
2873         * configure.ac: Likewise.
2874         * targets.c: Likewise.
2875         * cpu-i370.c: Delete.
2876         * elf32-i370.c: Delete.
2877         * Makefile.in: Regenerate.
2878         * bfd-in2.h: Regenerate.
2879         * configure: Regenerate.
2880         * po/SRC-POTFILES.in: Regenerate.
2881
2882 2018-04-16  Alan Modra  <amodra@gmail.com>
2883
2884         * Makefile.am: Remove h8500 support.
2885         * archures.c: Likewise.
2886         * coffcode.h: Likewise.
2887         * config.bfd: Likewise.
2888         * configure.ac: Likewise.
2889         * targets.c: Likewise.
2890         * coff-h8500.c: Delete.
2891         * cpu-h8500.c: Delete.
2892         * Makefile.in: Regenerate.
2893         * bfd-in2.h: Regenerate.
2894         * configure: Regenerate.
2895         * po/SRC-POTFILES.in: Regenerate.
2896
2897 2018-04-16  Alan Modra  <amodra@gmail.com>
2898
2899         * Makefile.am: Remove h8300-coff support.
2900         * coffcode.h: Likewise.
2901         * config.bfd: Likewise.
2902         * configure.ac: Likewise.
2903         * reloc16.c: Likewise.
2904         * targets.c: Likewise.
2905         * coff-h8300.c: Delete.
2906         * Makefile.in: Regenerate.
2907         * configure: Regenerate.
2908         * po/SRC-POTFILES.in: Regenerate.
2909
2910 2018-04-16  Alan Modra  <amodra@gmail.com>
2911
2912         * Makefile.am: Remove IEEE 695 support.
2913         * archures.c: Likewise.
2914         * bfd.c: Likewise.
2915         * config.bfd: Likewise.
2916         * configure.ac: Likewise.
2917         * doc/bfd.texinfo: Likewise.
2918         * doc/bfdint.texi: Likewise.
2919         * doc/bfdsumm.texi: Likewise.
2920         * section.c: Likewise.
2921         * targets.c: Likewise.
2922         * ieee.c: Delete.
2923         * libieee.h: Delete.
2924         * Makefile.in: Regenerate.
2925         * bfd-in2.h: Regenerate.
2926         * configure: Regenerate.
2927         * po/SRC-POTFILES.in: Regenerate.
2928
2929 2018-04-16  Alan Modra  <amodra@gmail.com>
2930
2931         * config.bfd: Remove tandem support.
2932
2933 2018-04-16  Alan Modra  <amodra@gmail.com>
2934
2935         * Makefile.am: Remove newsos3 support.
2936         * aoutx.h: Likewise.
2937         * config.bfd: Likewise.
2938         * configure.ac: Likewise.
2939         * targets.c: Likewise.
2940         * newsos3.c: Delete.
2941         * Makefile.in: Regenerate.
2942         * configure: Regenerate.
2943         * po/SRC-POTFILES.in: Regenerate.
2944
2945 2018-04-16  Alan Modra  <amodra@gmail.com>
2946
2947         * Makefile.am: Remove netware support.
2948         * bfd-in.h: Likewise.
2949         * bfd.c: Likewise.
2950         * config.bfd: Likewise.
2951         * configure.ac: Likewise.
2952         * doc/bfdint.texi: Likewise.
2953         * ecoff.c: Likewise.
2954         * targets.c: Likewise.
2955         * libnlm.h: Delete.
2956         * nlm-target.h: Delete.
2957         * nlm.c: Delete.
2958         * nlm32-alpha.c: Delete.
2959         * nlm32-i386.c: Delete.
2960         * nlm32-ppc.c: Delete.
2961         * nlm32-sparc.c: Delete.
2962         * nlm32.c: Delete.
2963         * nlm64.c: Delete.
2964         * nlmcode.h: Delete.
2965         * nlmswap.h: Delete.
2966         * Makefile.in: Regenerate.
2967         * bfd-in2.h: Regenerate.
2968         * configure: Regenerate.
2969         * po/SRC-POTFILES.in: Regenerate.
2970
2971 2018-04-16  Alan Modra  <amodra@gmail.com>
2972
2973         * archures.c: Remove tahoe support.
2974         * config.bfd: Likewise.
2975         * configure.ac: Likewise.
2976         * hosts/tahoe.h: Delete.
2977         * bfd-in2.h: Regenerate.
2978         * configure: Regenerate.
2979
2980 2018-04-14  Alan Modra  <amodra@gmail.com>
2981
2982         * elf-bfd.h (struct elf_backend_data): Add relropagesize.
2983         * elfxx-target.h (ELF_RELROPAGESIZE): Provide default and
2984         sanity test.
2985         (elfNN_bed): Init relropagesize.
2986         * bfd.c (bfd_emul_get_commonpagesize): Add boolean param to
2987         select relropagesize.
2988         * elf32-ppc.c (ELF_COMMONPAGESIZE): Define as 0x1000.
2989         (ELF_RELROPAGESIZE): Define as ELF_MAXPAGESIZE.
2990         (ELF_MINPAGESIZE): Don't define.
2991         * elf64-ppc.c (ELF_COMMONPAGESIZE): Define as 0x1000.
2992         (ELF_RELROPAGESIZE): Define as ELF_MAXPAGESIZE.
2993         * bfd-in2.h: Regenerate.
2994
2995 2018-04-14  Alan Modra  <amodra@gmail.com>
2996
2997         * elf32-ppc.c (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Don't depend
2998         on __QNXTARGET__ define.
2999
3000 2018-04-14  Alan Modra  <amodra@gmail.com>
3001
3002         * config.bfd: Add powerpc-*-lynxos* and powerpc-*-windiss*
3003         to obsolete list.
3004
3005 2018-04-11  Alan Modra  <amodra@gmail.com>
3006
3007         * aout-adobe.c: Delete.
3008         * bout.c: Delete.
3009         * coff-i860.c: Delete.
3010         * coff-i960.c: Delete.
3011         * cpu-i860.c: Delete.
3012         * cpu-i960.c: Delete.
3013         * elf32-i860.c: Delete.
3014         * elf32-i960.c: Delete.
3015         * hosts/i860mach3.h: Delete.
3016         * Makefile.am: Remove i860, i960, bout, and adobe support.
3017         * archures.c: Remove i860 and i960 support.
3018         * coffcode.h: Likewise.
3019         * reloc.c: Likewise.
3020         * aoutx.h: Comment updates.
3021         * archive.c: Remove BOUT and i960 support.
3022         * bfd.c: Remove BOUT support.
3023         * coffswap.h: Remove i960 support.
3024         * config.bfd: Remove i860, i960 and adobe targets.
3025         * configure.ac: Remove adode, bout, i860, i960, icoff targets.
3026         * targets.c: Likewise.
3027         * ieee.c: Remove i960 support.
3028         * mach-o.c: Remove i860 support.
3029         * Makefile.in: Regenerate.
3030         * bfd-in2.h: Regenerate.
3031         * configure: Regenerate.
3032         * libbfd.h: Regenerate.
3033         * po/SRC-POTFILES.in: Regenerate.
3034
3035 2018-04-09  Maciej W. Rozycki  <macro@mips.com>
3036
3037         * elf64-mips.c (mips_elf64_write_rel): Handle a NULL BFD pointer
3038         in the BFD symbol referred by the relocation.
3039         (mips_elf64_write_rela): Likewise.
3040
3041 2018-04-09  Maciej W. Rozycki  <macro@mips.com>
3042
3043         * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Issue an
3044         error for out-of-range `r_sym' values.
3045
3046 2018-04-09  Alan Modra  <amodra@gmail.com>
3047
3048         * elf64-ppc.c (struct _ppc64_elf_section_data): Add has_pltcall field.
3049         (struct ppc_link_hash_table): Add can_convert_all_inline_plt.
3050         (ppc64_elf_check_relocs): Set has_pltcall.
3051         (ppc64_elf_adjust_dynamic_symbol): Discard some PLT entries.
3052         (ppc64_elf_inline_plt): New function.
3053         (ppc64_elf_size_dynamic_sections): Discard some PLT entries for locals.
3054         * elf64-ppc.h (ppc64_elf_inline_plt): Declare.
3055         * elf32-ppc.c (has_pltcall): Define.
3056         (struct ppc_elf_link_hash_table): Add can_convert_all_inline_plt.
3057         (ppc_elf_check_relocs): Set has_pltcall.
3058         (ppc_elf_inline_plt): New function.
3059         (ppc_elf_adjust_dynamic_symbol): Discard some PLT entries.
3060         (ppc_elf_size_dynamic_sections): Likewise.
3061         * elf32-ppc.h (ppc_elf_inline_plt): Declare.
3062
3063 2018-04-09  Alan Modra  <amodra@gmail.com>
3064
3065         * elf32-ppc.c (ppc_elf_howto_raw): Add PLTSEQ and PLTCALL howtos.
3066         (is_plt_seq_reloc): New function.
3067         (ppc_elf_check_relocs): Handle PLTSEQ and PLTCALL relocs.
3068         (ppc_elf_tls_optimize): Handle inline plt call sequence.
3069         (ppc_elf_relax_section): Handle PLTCALL reloc.
3070         (ppc_elf_relocate_section): Nop out inline plt call sequence when
3071         resolving locally.
3072         * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_PLTSEQ and
3073         R_PPC64_PLTCALL entries.  Comment R_PPC64_TOCSAVE.
3074         (has_tls_get_addr_call): Correct comment.
3075         (is_branch_reloc): Add PLTCALL.
3076         (is_plt_seq_reloc): New function.
3077         (ppc64_elf_check_relocs): Handle PLT16_LO_DS reloc.  Set
3078         has_tls_reloc for R_PPC64_TLSGD and R_PPC64_TLSLD.  Create plt
3079         entry for R_PPC64_PLTCALL.
3080         (ppc64_elf_tls_optimize): Handle inline plt call sequence.
3081         (ppc_type_of_stub): Handle PLTCALL reloc.
3082         (toc_adjusting_stub_needed): Likewise.
3083         (ppc64_elf_relocate_section): Set "can_plt_call" for PLTCALL
3084         reloc insn.  Nop out inline plt call sequence when resolving
3085         locally.  Handle __tls_get_addr inline plt call optimization.
3086
3087 2018-04-09  Alan Modra  <amodra@gmail.com>
3088
3089         * elf64-ppc.c (LOCAL_PLT_ENTRY_SIZE): Define.
3090         (struct ppc_stub_hash_entry): Add symtype field.
3091         (PLT_KEEP): Define.
3092         (struct ppc_link_hash_table): Add pltlocal and relpltlocal.
3093         (create_linkage_sections): Create pltlocal and relpltlocal.
3094         (ppc64_elf_check_relocs): Allow PLT relocs on local symbols.
3095         Set PLT_KEEP.
3096         (ppc64_elf_adjust_dynamic_symbol): Keep PLT entries for inline calls.
3097         (allocate_dynrelocs): Allocate pltlocal and relpltlocal.
3098         (ppc64_elf_size_dynamic_sections): Size pltlocal and relpltlocal.
3099         Keep PLT entries for inline calls against locals.
3100         (ppc_build_one_stub): Use pltlocal as appropriate.
3101         (ppc_size_one_stub): Likewise.
3102         (ppc64_elf_size_stubs): Set symtype.
3103         (build_global_entry_stubs_and_plt): Init pltlocal and write
3104         relpltlocal for globals.
3105         (write_plt_relocs_for_local_syms): Likewise for local syms.
3106         (ppc64_elf_relocate_section): Support PLT for local syms.
3107         * elf32-ppc.c (PLT_KEEP): Define.
3108         (struct ppc_elf_link_hash_table): Add pltlocal and relpltlocal.
3109         (ppc_elf_create_glink): Create pltlocal and relpltlocal.
3110         (ppc_elf_check_relocs): Allow PLT relocs on local symbols.
3111         Set PLT_KEEP.  Adjust update_local_sym_info call.
3112         (ppc_elf_adjust_dynamic_symbol): Keep PLT entries for inline calls.
3113         (allocate_dynrelocs): Allocate pltlocal and relpltlocal.
3114         (ppc_elf_size_dynamic_sections): Size pltlocal and relpltlocal.
3115         (ppc_elf_relocate_section): Support PLT16 relocs for local syms.
3116         (write_global_sym_plt): Init pltlocal and write relpltlocal.
3117         (ppc_finish_symbols): Likewise for locals.
3118
3119 2018-04-09  Alan Modra  <amodra@gmail.com>
3120
3121         * elf64-ppc.c (ppc_build_one_stub): Move output of PLT relocs
3122         for local symbols to..
3123         (write_plt_relocs_for_local_syms): ..here.  New function.
3124         (ppc64_elf_finish_dynamic_symbol): Move output of PLT relocs for
3125         global symbols to..
3126         (build_global_entry_stubs_and_plt): ..here.  Rename from
3127         build_global_entry_stubs.
3128         (ppc64_elf_build_stubs): Always call build_global_entry_stubs_and_plt.
3129         Call write_plt_relocs_for_local_syms.
3130         * elf32-ppc.c (get_sym_h): New function.
3131         (ppc_elf_relax_section): Use get_sym_h.
3132         (ppc_elf_relocate_section): Move output of PLT relocs and glink
3133         stubs for local symbols to..
3134         (ppc_finish_symbols): ..here.  New function.
3135         (ppc_elf_finish_dynamic_symbol): Move output of PLT relocs for
3136         global syms to..
3137         (write_global_sym_plt): ..here.  New function.
3138         * elf32-ppc.h (ppc_elf_modify_segment_map): Delete attribute.
3139         (ppc_finish_symbols): Declare.
3140
3141 2018-04-09  Alan Modra  <amodra@gmail.com>
3142
3143         * elf32-ppc.c (ppc_elf_check_relocs): Handle PLT16 relocs.
3144         (ppc_elf_relocate_section): Likewise.
3145         * elf64-ppc.c (ppc64_elf_check_relocs): Handle PLT16_LO_DS.
3146         (ppc64_elf_relocate_section): Likewise.  Correct PLT16
3147         resolution to plt entry relative to toc pointer.
3148
3149 2018-04-09  Alan Modra  <amodra@gmail.com>
3150
3151         * elf64-ppc.c (TLS_TLS, TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL,
3152         TLS_TPRELGD, TLS_EXPLICIT):  Renumber.  Test TLS_TLS throughout
3153         file when other TLS flags are tested in a mask.
3154         (TLS_MARK, NON_GOT): Define.
3155         (PLT_IFUNC): Redefine, and test TLS_TLS throughout file as well.
3156         (update_local_sym_info): Don't create got entry when NON_GOT.
3157         (ppc64_elf_check_relocs): Pass NON_GOT with PLT_IFUNC.
3158         Set TLS_MARK.
3159         (get_tls_mask): Do toc lookup if tls_mask is just TLS_MARK.
3160         (ppc64_elf_relocate_section): Likewise.
3161         (ppc64_elf_tls_optimize): Don't attempt to optimize indirect
3162         __tls_get_addr calls lacking a marker reloc.
3163         * elf32-ppc.c (TLS_TLS, TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL,
3164         TLS_TPRELGD): Renumber.  Update comment.
3165         (TLS_MARK, NON_GOT): Define.
3166         (PLT_IFUNC): Redefine, and test TLS_TLS throughout file as well.
3167         (update_local_sym_info): Don't create got entry when NON_GOT.
3168         (ppc_elf_check_relocs): Pass NON_GOT with PLT_IFUNC.
3169         Set TLS_MARK.
3170         (ppc_elf_tls_optimize): Don't attempt to optimize indirect
3171         __tls_get_addr calls lacking a marker reloc.
3172
3173 2018-04-06  H.J. Lu  <hongjiu.lu@intel.com>
3174
3175         * elf64-x86-64.c (elf_x86_64_info_to_howto): Don't mask out
3176         R_X86_64_converted_reloc_bit.
3177
3178 2018-04-05  H.J. Lu  <hongjiu.lu@intel.com>
3179
3180         PR gas/22318
3181         * configure: Regenerated.
3182
3183 2018-04-05  Alan Modra  <amodra@gmail.com>
3184
3185         * elf-hppa.h (elf_hppa_info_to_howto): Init howto to NULL.
3186         (elf_hppa_info_to_howto_rel): Likewise.
3187
3188 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
3189
3190         * elf-hppa.h (elf_hppa_info_to_howto): Also return
3191         unsuccessfully for unimplemented relocations.
3192         (elf_hppa_info_to_howto_rel): Likewise.
3193
3194 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
3195
3196         * elf32-i860.c (lookup_howto): Add `abfd' parameter.  Set the
3197         `bfd_error_bad_value' error and call `_bfd_error_handler' on a
3198         howto lookup failure.
3199         (elf32_i860_reloc_type_lookup): Adjust `lookup_howto' call
3200         accordingly.
3201         (elf32_i860_info_to_howto_rela): Likewise.
3202         (elf32_i860_relocate_splitn): Likewise.
3203         (elf32_i860_relocate_pc16): Likewise.
3204         (elf32_i860_relocate_pc26): Likewise.
3205         (elf32_i860_relocate_section): Likewise.
3206
3207 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
3208
3209         * elf32-visium.c (visium_info_to_howto_rela): Correct the range
3210         check for `visium_elf_howto_table' table access.
3211
3212 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
3213
3214         * elf32-iq2000.c (iq2000_info_to_howto_rela): Correct the range
3215         check for `iq2000_elf_howto_table' table access.
3216
3217 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
3218
3219         * elf32-frv.c (frv_info_to_howto_rela): Correct the range check
3220         for `elf32_frv_howto_table' table access.
3221
3222 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
3223
3224         * elf32-mips.c (mips_elf32_rtype_to_howto): Also return
3225         unsuccessfully for placeholder howtos.
3226         * elf64-mips.c (mips_elf64_rtype_to_howto): Likewise.
3227         * elfn32-mips.c (mips_elf_n32_rtype_to_howto): Likewise.
3228
3229 2018-03-29  Maciej W. Rozycki  <macro@mips.com>
3230
3231         * elf32-mips.c (mips_info_to_howto_rel): Remove the calls to
3232         `_bfd_error_handler' and to set the `bfd_error_bad_value' error.
3233
3234 2018-03-28  Maciej W. Rozycki  <macro@mips.com>
3235
3236         * elf-hppa.h (elf_hppa_info_to_howto_rel): Remove
3237         ATTRIBUTE_UNUSED from `abfd'.
3238
3239 2018-03-28  Maciej W. Rozycki  <macro@mips.com>
3240
3241         * elf-hppa.h (elf_hppa_info_to_howto_rel): Correct
3242         `_bfd_error_handler' call formatting.
3243
3244 2018-03-28  Maciej W. Rozycki  <macro@mips.com>
3245
3246         * elf32-mips.c (mips_info_to_howto_rel): Call
3247         `mips_elf32_rtype_to_howto' directly rather than via
3248         `->elf_backend_mips_rtype_to_howto'.
3249
3250 2018-03-28  Renlin Li  <renlin.li@arm.com>
3251
3252         PR ld/22970
3253         * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Add cases for
3254         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
3255         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
3256         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
3257         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
3258         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
3259         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
3260         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
3261         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
3262         (elfNN_aarch64_final_link_relocate): Support new relocations.
3263         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Support new
3264         relocations.
3265         (_bfd_aarch64_elf_resolve_relocation): Support new relocations.
3266
3267 2018-03-28  Renlin Li  <renlin.li@arm.com>
3268
3269         PR ld/22970
3270         * reloc.c: Add BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12
3271         BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
3272         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
3273         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
3274         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
3275         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
3276         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
3277         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
3278         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
3279         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
3280         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add table entry for
3281         TLSLE_LDST16_TPREL_LO12,
3282         TLSLE_LDST16_TPREL_LO12_NC,
3283         TLSLE_LDST32_TPREL_LO12,
3284         TLSLE_LDST32_TPREL_LO12_NC,
3285         TLSLE_LDST64_TPREL_LO12,
3286         TLSLE_LDST64_TPREL_LO12_NC,
3287         TLSLE_LDST8_TPREL_LO12,
3288         TLSLE_LDST8_TPREL_LO12_NC.
3289         * bfd-in2.h: Regenerated.
3290         * libbfd.h: Regenerated.
3291
3292 2018-03-28  Eric Botcazou  <ebotcazou@adacore.com>
3293
3294         PR ld/22972
3295         * elfxx-sparc.c (struct _bfd_sparc_elf_link_hash_entry): Add new flag
3296         has_old_style_got_reloc.
3297         (_bfd_sparc_elf_check_relocs) <GOT relocations>: Set it for old-style
3298         relocations.  Fix a couple of long lines.
3299         (_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: Do not generate
3300         a R_SPARC_NONE for the GOT slot if the symbol is also subject to old-style
3301         GOT relocations.
3302
3303 2018-03-25  H.J. Lu  <hongjiu.lu@intel.com>
3304
3305         PR ld/23000
3306         * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Add
3307         ENDBR64 to the TLSDESC PLT entry.
3308
3309 2018-03-21  Alan Modra  <amodra@gmail.com>
3310
3311         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Trim uninteresting
3312         symbols.  Use size_t counts.  Delete redundant opd test.
3313
3314 2018-03-21  Alan Modra  <amodra@gmail.com>
3315
3316         * elf32-ppc.c (ppc_elf_tls_optimize): Delete locsyms.
3317
3318 2018-03-21  Alan Modra  <amodra@gmail.com>
3319
3320         * elf32-ppc.c (struct ppc_elf_link_hash_entry): Make tls_mask
3321         field unsigned.
3322         (update_local_sym_info): Likewise for local_got_tls_masks.
3323         (ppc_elf_tls_optimize): Likewise for lgot_masks.
3324
3325 2018-03-21  Alan Modra  <amodra@gmail.com>
3326
3327         * elf64-ppc.c (ppc_size_one_stub): Fix comment typo.
3328         (ppc64_elf_layout_multitoc): Allocate relocs for tprel as we
3329         do in size_dynamic_sections.
3330
3331 2018-03-21  Alan Modra  <amodra@gmail.com>
3332
3333         * elf64-ppc.c (ppc64_elf_relocate_section): Don't access rel[1]
3334         without first checking array bounds.
3335         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
3336
3337 2018-03-20  H.J. Lu  <hongjiu.lu@intel.com>
3338
3339         PR ld/22983
3340         * elflink.c (bfd_elf_link_mark_dynamic_symbol): Set
3341         non_ir_ref_dynamic if a symbol is made dynamic by --dynamic-list.
3342
3343 2018-03-19  Nick Clifton  <nickc@redhat.com>
3344
3345         * po/es.po: Updated Spanish translation.
3346
3347 2018-03-15  Max Filippov  <jcmvbkbc@gmail.com>
3348
3349         * elf32-xtensa.c (xlate_map_entry): Change types of address
3350         fields from 'unsigned' to 'bfd_vma'.
3351         (xlate_offset_with_removed_text): Use struct xlate_map_entry as
3352         the key argument to bsearch. Allow offsets past the end of a
3353         section, use the last map entry for translation of such offsets.
3354
3355 2018-03-15  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
3356
3357         * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Removed.
3358         Not support the target feature.
3359         (nds32_elf_ex9_itb_base): Likewise.
3360         (nds32_elf_ex9_import_table): Likewise.
3361         (nds32_elf_ex9_finish): Likewise.
3362         (nds32_elf_ex9_reloc_jmp): Likewise.
3363         (nds32_elf_get_insn_with_reg): Likewise.
3364         (nds32_get_local_syms): Likewise.
3365         (nds32_elf_ex9_replace_instruction): Likewise.
3366         (nds32_elf_ifc_calc): Likewise.
3367         (nds32_elf_ifc_finish): Likewise.
3368         (nds32_elf_ifc_replace): Likewise.
3369         (nds32_elf_ifc_reloc): Likewise.
3370
3371 2018-03-14  Alan Modra  <amodra@gmail.com>
3372
3373         * elf64-ppc.c (sfpr_define): Adjust for stub_sec size having
3374         sfpr size added before defining alias symbols.
3375         (ppc64_elf_build_stubs): Add stub section padding before
3376         copying sfpr contents and defining save/restore alias symbols.
3377
3378 2018-03-14  H.J. Lu  <hongjiu.lu@intel.com>
3379
3380         PR ld/20882
3381         * elflink.c (elf_gc_mark_debug_section): Also check the local
3382         debug definition section.
3383
3384 2018-03-13  Nick Clifton  <nickc@redhat.com>
3385
3386         PR 22113
3387         * pei-x86_64.c (pex64_get_unwind_info): Change to a boolean
3388         function.  Add an end address parameter.  Check access of the data
3389         pointer to make sure that they do not extend beyond the end
3390         address.  Return FALSE if any check fails.  Add the end address
3391         pointer to the ui structure.
3392         (pex64_xdata_print_uwd_codes): Check accesses of the raw unwind
3393         codes to make sure that they do not extend beyond the end address
3394         pointer.  Print an error message and return immediately if any
3395         check fails.
3396
3397 2018-03-09  Nick Clifton  <nickc@redhat.com>
3398
3399         * elf64-s390.c (elf_s390_relocate_section): Move check for
3400         relocations against non-allocated sections to before the code that
3401         handles ifunc relocations.
3402         * elf32-s390.c (elf_s390_relocate_section): Likewise.
3403         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Treat
3404         relocs against IFUNC symbols in non-allocated sections as relocs
3405         against FUNC symbols.
3406         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
3407
3408 2018-03-08  H.J. Lu  <hongjiu.lu@intel.com>
3409
3410         PR ld/22929
3411         * elf32-i386.c (elf_i386_relocate_section): Treat relocation
3412         against IFUNC symbol in SHT_NOTE section without SHF_ALLOC as
3413         relocation against FUNC symbol.
3414         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
3415
3416 2018-03-07  Renlin Li  <renlin.li@arm.com>
3417
3418         PR ld/20402
3419         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Check absolute
3420         symbol, and don't emit relocation in specific case.
3421
3422 2018-03-07  Alan Modra  <amodra@gmail.com>
3423
3424         * elf64-mips.c (mips_elf64_rtype_to_howto): Return NULL on error.
3425         (mips_elf64_slurp_one_reloc_table): Pass on error.
3426
3427 2018-03-03  James Cowgill  <james.cowgill@mips.com>
3428             Maciej W. Rozycki  <macro@mips.com>
3429
3430         PR ld/21900
3431         * elfxx-mips.c (mips_elf_calculate_relocation): Only return
3432         after calling `undefined_symbol' hook if this is an error
3433         condition.  Assume the value of 0 for the symbol requested
3434         otherwise.
3435
3436 2018-03-02  Jim Wilson  <jimw@sifive.com>
3437
3438         PR 22903
3439         * elfnn-aarch64.c (_bfd_aarch64_resize_stubs): Add 8 bytes for branch
3440         and nop instead of 4.
3441         (elfNN_arch64_build_stubs): Add nop after branch.  Increase size by
3442         8 instead of 4.
3443
3444 2018-03-01  Jim Wilson  <jimw@sifive.com>
3445
3446         PR 22756
3447         * elfnn-riscv.c (riscv_relax_delete_bytes): When adjust st_size, use
3448         else if instead of if.
3449
3450 2018-03-01  Alan Modra  <amodra@gmail.com>
3451
3452         * elf32-ft32.c (ft32_info_to_howto_rela): Correct range test.
3453
3454 2018-02-28  Alan Modra  <amodra@gmail.com>
3455
3456         PR 22887
3457         * aoutx.h (swap_std_reloc_in): Correct r_index bound check.
3458
3459 2018-02-28  Nick Clifton  <nickc@redhat.com>
3460
3461         PR 22895
3462         PR 22893
3463         * dwarf2.c (read_n_bytes): Replace size parameter with dwarf_block
3464         pointer.  Drop unused abfd parameter.  Check the size of the block
3465         before initialising the data field.  Return the end pointer if the
3466         size is invalid.
3467         (read_attribute_value): Adjust invocations of read_n_bytes.
3468
3469         PR 22894
3470         * dwarf1.c (parse_die): Check the length of form blocks before
3471         advancing the data pointer.
3472
3473 2018-02-28  Alan Modra  <amodra@gmail.com>
3474
3475         PR 22887
3476         * aoutx.h (translate_symbol_table): Print an error message and set
3477         bfd_error on finding an invalid name string offset.
3478
3479 2018-02-27  H.J. Lu  <hongjiu.lu@intel.com>
3480
3481         * config.in: Regenerated.
3482         * configure: Likewise.
3483         * configure.ac: Add --enable-separate-code.
3484         (DEFAULT_LD_Z_SEPARATE_CODE): New AC_DEFINE_UNQUOTED.  Default
3485         to 1 for Linux/x86 targets,
3486         * elf64-x86-64.c (ELF_MAXPAGESIZE): Set to 0x1000 if
3487         DEFAULT_LD_Z_SEPARATE_CODE is 1.
3488
3489 2018-02-27  Nick Clifton  <nickc@redhat.com>
3490
3491         * aout-cris.c (swap_ext_reloc_out): Standadize error/warning
3492         message.
3493         * elf-hppa.h (elf_hppa_info_to_howto_rel): Likewise.
3494         * elf32-i386.c (elf_i386_reloc_type_lookup): Likewise.
3495         * elf32-xtensa.c (elf_xtensa_reloc_type_lookup): Likewise.
3496         * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Likewise.
3497         * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise.
3498         * elf64-sh64.c (sh_elf64_info_to_howto): Likewise.
3499         * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise.
3500         * elfxx-sparc.c (_bfd_sparc_elf_reloc_type_lookup): Likewise.
3501         * elfxx-tilegx.c (tilegx_reloc_type_lookup): Likewise.
3502
3503         PR 22875
3504         * elf-bfd.h (struct elf_backend_data): Change the return type of
3505         the elf_info_to_howto and elf_info_to_howto_rel function pointers
3506         to bfd_boolean.
3507         * elfcode.h (elf_slurp_reloc_table_from_section): Check the return
3508         value from the info_to_howto function and fail if that function
3509         failed.
3510         * elf32-h8300.c (elf32_h8_relocate_section): Check return value
3511         from the info_to_howto function.
3512         (elf32_h8_relax_section): Likewise.
3513         * elf32-lm32.c (lm32_elf_relocate_section): Likewise.
3514         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
3515         * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
3516         * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3517         * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
3518         * elf64-ia64-vms.c (elf64_ia64_relocate_section): Likewise.
3519         * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
3520         * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
3521         * elfnn-ia64.c (elfNN_ia64_relocate_section): Likewise.
3522         * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
3523         (riscv_elf_relocate_section): Likewise.
3524         * elf-hppa.h (elf_hppa_info_to_howto): Change return type to
3525         bfd_boolean.  Issue an error message, set an error value and
3526         return FALSE if the reloc is not recognized.
3527         (elf_hppa_info_to_howto_rel): Likewise.
3528         * elf-m10200.c (mn10200_info_to_howto): Likewise.
3529         * elf-m10300.c (mn10300_info_to_howto): Likewise.
3530         * elf.c (_bfd_elf_no_info_to_howto): Likewise.
3531         * elf32-arc.c (arc_info_to_howto_rel): Likewise.
3532         * elf32-arm.c (elf32_arm_info_to_howto): Likewise.
3533         * elf32-avr.c (avr_info_to_howto_rela): Likewise.
3534         * elf32-bfin.c (bfin_info_to_howto): Likewise.
3535         * elf32-cr16.c (elf_cr16_info_to_howto): Likewise.
3536         * elf32-cr16c.c (elf_cr16c_info_to_howto): Likewise.
3537         * elf32-cris.c (elf_cr16c_info_to_howto_rel)
3538         (cris_info_to_howto_rela): Likewise.
3539         * elf32-crx.c (elf_crx_info_to_howto): Likewise.
3540         * elf32-d10v.c (d10v_info_to_howto_rel): Likewise.
3541         * elf32-d30v.c (d30v_info_to_howto_rel, d30v_info_to_howto_rela):
3542         Likewise.
3543         * elf32-dlx.c (dlx_rtype_to_howto, elf32_dlx_info_to_howto)
3544         (elf32_dlx_info_to_howto_rel): Likewise.
3545         * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise.
3546         * elf32-fr30.c (fr30_info_to_howto_rela): Likewise.
3547         * elf32-frv.c (frv_info_to_howto_rela)
3548         (frvfdpic_info_to_howto_rel): Likewise.
3549         * elf32-ft32.c (ft32_info_to_howto_rela): Likewise.
3550         * elf32-gen.c (elf_generic_info_to_howto)
3551         (elf_generic_info_to_howto_rel): Likewise.
3552         * elf32-h8300.c (elf32_h8_info_to_howto)
3553         (elf32_h8_info_to_howto_rel): Likewise.
3554         * elf32-i370.c (i370_elf_info_to_howto): Likewise.
3555         * elf32-i386.c (elf_i386_reloc_type_lookup)
3556         (elf_i386_rtype_to_howto, elf_i386_info_to_howto_rel): Likewise.
3557         * elf32-i860.c (lookup_howto, elf32_i860_info_to_howto_rela):
3558         Likewise.
3559         * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise.
3560         * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise.
3561         * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise.
3562         * elf32-lm32.c (lm32_info_to_howto_rela): Likewise.
3563         * elf32-m32c.c (m32c_info_to_howto_rela): Likewise.
3564         * elf32-m32r.c (m32r_info_to_howto_rel, m32r_info_to_howto):
3565         Likewise.
3566         * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise.
3567         * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise.
3568         * elf32-m68k.c (rtype_to_howto): Likewise.
3569         * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
3570         * elf32-mep.c (mep_info_to_howto_rela): Likewise.
3571         * elf32-metag.c (metag_info_to_howto_rela): Likewise.
3572         * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
3573         * elf32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela):
3574         Likewise.
3575         * elf32-moxie.c (moxie_info_to_howto_rela): Likewise.
3576         * elf32-msp430.c (msp430_info_to_howto_rela): Likewise.
3577         * elf32-mt.c (mt_info_to_howto_rela): Likewise.
3578         * elf32-nds32.c (nds32_info_to_howto_rel, nds32_info_to_howto):
3579         Likewise.
3580         * elf32-nios2.c (nios2_elf32_info_to_howto): Likewise.
3581         * elf32-or1k.c (or1k_info_to_howto_rela): Likewise.
3582         * elf32-pj.c (pj_elf_info_to_howto): Likewise.
3583         * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
3584         * elf32-pru.c (pru_elf32_info_to_howto): Likewise.
3585         * elf32-rl78.c (rl78_info_to_howto_rela): Likewise.
3586         * elf32-rx.c (rx_info_to_howto_rela): Likewise.
3587         * elf32-s390.c (elf_s390_info_to_howto): Likewise.
3588         * elf32-score.c (s3_bfd_score_info_to_howto)
3589         (_bfd_score_info_to_howto): Likewise.
3590         * elf32-score7.c (s7_bfd_score_info_to_howto): Likewise.
3591         * elf32-sh.c (sh_elf_info_to_howto): Likewise.
3592         * elf32-spu.c (spu_elf_info_to_howto): Likewise.
3593         * elf32-tic6x.c (elf32_tic6x_info_to_howto)
3594         (elf32_tic6x_info_to_howto_rel): Likewise.
3595         * elf32-tilepro.c (tilepro_info_to_howto_rela): Likewise.
3596         * elf32-v850.c (v850_elf_info_to_howto_rel)
3597         (v850_elf_info_to_howto_rela, v800_elf_info_to_howto): Likewise.
3598         * elf32-vax.c (rtype_to_howto): Likewise.
3599         * elf32-visium.c (visium_info_to_howto_rela): Likewise.
3600         * elf32-wasm32.c (elf32_wasm32_rtype_to_howto)
3601         (elf32_wasm32_info_to_howto_rela): Likewise.
3602         * elf32-xc16x.c (elf32_xc16x_info_to_howto): Likewise.
3603         * elf32-xgate.c (xgate_info_to_howto_rel): Likewise.
3604         * elf32-xstormy16.c (xstormy16_info_to_howto_rela): Likewise.
3605         * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise.
3606         * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
3607         * elf64-gen.c (elf_generic_info_to_howto)
3608         (elf_generic_info_to_howto_rel): Likewise.
3609         * elf64-ia64-vms.c (elf64_ia64_info_to_howto): Likewise.
3610         * elf64-mips.c (mips_elf64_info_to_howto_rela): Likewise.
3611         * elf64-mmix.c (mmix_info_to_howto_rela): Likewise.
3612         * elf64-ppc.c (ppc64_elf_info_to_howto): Likewise.
3613         * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise.
3614         * elf64-sh64.c (elf_s390_info_to_howto, sh_elf64_info_to_howto):
3615         Likewise.
3616         * elf64-x86-64.c (elf_x86_64_info_to_howto): Likewise.
3617         * elfn32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela):
3618         Likewise.
3619         * elfnn-aarch64.c (elfNN_aarch64_info_to_howto): Likewise.
3620         * elfnn-ia64.c (elfNN_ia64_info_to_howto): Likewise.
3621         * elfnn-riscv.c (riscv_info_to_howto_rela): Likewise.
3622         * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise.
3623         * elfxx-sparc.c (_bfd_sparc_elf_info_to_howto): Likewise.
3624         * elfxx-tilegx.c (tilegx_info_to_howto_rela): Likewise.
3625         * elf32-score.h (s7_bfd_score_info_to_howto): Update prototype.
3626         * elfxx-sparc.h (_bfd_sparc_elf_info_to_howto): Update prototype.
3627         * elfxx-tilegx.h (tilegx_info_to_howto_rela): Update prototype.
3628         * elfxx-target.h (elf_info_to_howto, elf_info_to_howto_rel):
3629         Default to NULL.
3630
3631 2018-02-26  Jim Wilson  <jimw@sifive.com>
3632             Stephan Schreiber <info@fs-driver.org>
3633
3634         PR 15904
3635         * elfnn-ia64.c (elfNN_ia64_relax_section): After ia64_elf_relax_brl
3636         call, set changed_contents and changed_relocs.  Likewise after
3637         successful ia64_elf_relax_br call.
3638
3639 2018-02-26  Alan Modra  <amodra@gmail.com>
3640
3641         * elf.c (assign_file_positions_except_relocs): Don't segfault
3642         when actual number of phdrs is less than allocated.  Delete
3643         outdated comment.  Formatting.
3644
3645 2018-02-26  Alan Modra  <amodra@gmail.com>
3646
3647         * elf-m10300.c, * elf-s390-common.c, * elf32-arc.c, * elf32-cris.c,
3648         * elf32-dlx.c, * elf32-frv.c, * elf32-i370.c, * elf32-lm32.c,
3649         * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c,
3650         * elf32-microblaze.c, * elf32-msp430.c, * elf32-nds32.c,
3651         * elf32-nios2.c, * elf32-or1k.c, * elf32-rl78.c, * elf32-rx.c,
3652         * elf32-score.c, * elf32-score7.c, * elf32-sh-symbian.c,
3653         * elf32-sh.c, * elf32-spu.c, * elf32-v850.c, * elf32-xtensa.c,
3654         * elf64-alpha.c, * elf64-ia64-vms.c, * elf64-mmix.c,
3655         * elf64-sh64.c, * elf64-sparc.c, * elfnn-ia64.c, * elfxx-tilegx.c,
3656         * mmo.c, * osf-core.c, * srec.c, * vms-alpha.c: Standardize
3657         error/warning messages.
3658
3659 2018-02-26  Alan Modra  <amodra@gmail.com>
3660
3661         * archive.c, * bfd.c, * linker.c, * reloc.c, * stabs.c,
3662         * syms.c: Standardize error/warning messages.
3663
3664 2018-02-26  Alan Modra  <amodra@gmail.com>
3665
3666         * aout-adobe.c, * aout-cris.c, * i386linux.c, * m68klinux.c,
3667         * sparclinux.c, * coff-alpha.c, * coff-arm.c, * coff-mcore.c,
3668         * coffcode.h, * coffgen.c, * cofflink.c, * ecoff.c, * pe-mips.c,
3669         * peXXigen.c, * peicode.h: Standardize error/warning messages.
3670
3671 2018-02-26  Alan Modra  <amodra@gmail.com>
3672
3673         * elf32-arm.c, * elfnn-aarch64.c: Standardize error/warning messages.
3674
3675 2018-02-26  Alan Modra  <amodra@gmail.com>
3676
3677         * elfxx-mips.c: Standardize error/warning messages.
3678
3679 2018-02-26  Alan Modra  <amodra@gmail.com>
3680
3681         * dwarf2.c, * elf-attrs.c, * elf-eh-frame.c, * elf.c, * elf32-gen.c,
3682         * elflink.c: Standardize error/warning messages.  Replace use of
3683         linker callback einfo with _bfd_error_handler when possible.
3684
3685 2018-02-26  Alan Modra  <amodra@gmail.com>
3686
3687         * aoutx.h, * coff-alpha.c, * coff-i860.c, * coff-m68k.c,
3688         * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
3689         * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-w65.c,
3690         * elf-bfd.h, * elf-m10300.c, * elf.c, * elf32-avr.c, * elf32-bfin.c,
3691         * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c,
3692         * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c,
3693         * elf32-fr30.c, * elf32-frv.c, * elf32-i370.c, * elf32-i386.c,
3694         * elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c,
3695         * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c,
3696         * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c,
3697         * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c,
3698         * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-or1k.c,
3699         * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-rx.c,
3700         * elf32-s390.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
3701         * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c,
3702         * elf32-xgate.c, * elf32-xtensa.c, * elf64-alpha.c,
3703         * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
3704         * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
3705         * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
3706         * elfnn-riscv.c, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-riscv.h,
3707         * elfxx-sparc.c, * elfxx-sparc.h, * reloc.c: Standardize
3708         unrecognized/unsupported reloc message.
3709
3710 2018-02-26  Alan Modra  <amodra@gmail.com>
3711
3712         * elf32-ppc.c: Standardize error/warning messages.  Use
3713         _bfd_error_handler rather than einfo when einfo features not used.
3714         * elf64-ppc.c: Likewise.
3715
3716 2018-02-23  Alan Modra  <amodra@gmail.com>
3717
3718         PR 22881
3719         * elf.c (assign_file_positions_for_non_load_sections): Remove RELRO
3720         segment if no matching LOAD segment.
3721
3722 2018-02-23  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
3723
3724         * elf32-nds32.h: Define mask for ict_model.
3725
3726 2018-02-20  Jason Duerstock  <jason.duerstock@gmail.com>
3727
3728         * elfnn-ia64.c (elf_backend_can_gc_sections): Enable.
3729
3730 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
3731
3732         Revert
3733         2018-01-12  Vlad Ivanov  <vlad@ivanov.email>
3734
3735         * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when
3736         .reginfo section has wrong size.
3737
3738 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
3739
3740         * elfxx-mips.c (_bfd_mips_elf_always_size_sections): Set
3741         SEC_FIXED_SIZE and SEC_HAS_CONTENTS flags for `.reginfo' and
3742         `.MIPS.abiflags' sections.
3743         (_bfd_mips_elf_final_link): Avoid reading beyond `.reginfo'
3744         section's end.
3745
3746 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
3747
3748         * section.c (SEC_FIXED_SIZE): New macro.
3749         * bfd-in2.h: Regenerate.
3750
3751 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
3752
3753         * section.c (SEC_HAS_GOT_REF): Remove macro.
3754         * bfd-in2.h: Regenerate.
3755
3756 2018-02-19  Alan Modra  <amodra@gmail.com>
3757
3758         * elf-attrs.c (_bfd_elf_parse_attributes): Correct _bfd_error_handler
3759         arguments.
3760         * elfxx-mips.c (_bfd_mips_elf_final_link): Likewise.
3761         * elfnn-riscv.c (_bfd_riscv_relax_align): Likewise.
3762         (_bfd_riscv_relax_pc): Likewise and fix typos.
3763         * libbfd-in.h (_bfd_error_handler): Add attribute printf.
3764         * libbfd.h: Regenerate.
3765
3766 2018-02-19  Alan Modra  <amodra@gmail.com>
3767
3768         * dwarf2.c (read_section): Don't use 'll' format modifier.
3769         (find_abstract_instance): Likewise.
3770         * elfcore.h (elf_core_file_p): Likewise.
3771
3772 2018-02-19  Alan Modra  <amodra@gmail.com>
3773
3774         * bfd-in.h: Include inttypes.h or if not available define
3775         PRId64, PRIu64 and PRIx64.
3776         * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Remove support for L
3777         modifier to print bfd_vma.
3778         * coff-arm.c, * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c,
3779         * coff-sh.c, * coff-tic80.c, * coffcode.h, * coffgen.c, * cofflink.c,
3780         * compress.c, * dwarf2.c, * elf-m10300.c, * elf.c, * elf32-arc.c,
3781         * elf32-arm.c, * elf32-bfin.c, * elf32-cris.c, * elf32-hppa.c,
3782         * elf32-i386.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32r.c,
3783         * elf32-m68k.c, * elf32-metag.c, * elf32-nds32.c, * elf32-nios2.c,
3784         * elf32-ppc.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c,
3785         * elf32-score7.c, * elf32-sh.c, * elf32-sh64.c, * elf32-spu.c,
3786         * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c,
3787         * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c,
3788         * elf64-mmix.c, * elf64-s390.c, * elf64-sh64.c, * elf64-x86-64.c,
3789         * elfcode.h, * elfcore.h, * elflink.c, * elfnn-aarch64.c,
3790         * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c, * elfxx-sparc.c,
3791         * elfxx-tilegx.c, * ieee.c, * ihex.c, * mach-o.c, * merge.c, * mmo.c,
3792         * peXXigen.c, * xcofflink.c: Replace use of Lx modifier with PRIx64,
3793         and cast input to uint64_t, and similarly for Ld and Lu.
3794         * bfd-in2.h: Regenerate.
3795
3796 2018-02-19  Alan Modra  <amodra@gmail.com>
3797
3798         * elf32-arm.c, * elf32-hppa.c, * elf32-lm32.c, * elf32-m32r.c,
3799         * elf32-metag.c, * elf32-nds32.c, * elf32-or1k.c, * elf32-ppc.c,
3800         * elf32-s390.c, * elf32-sh.c, * elf32-tic6x.c, * elf32-tilepro.c,
3801         * elf64-ppc.c, * elf64-s390.c, * elflink.c, * elfnn-aarch64.c,
3802         * elfnn-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c,
3803         * reloc.c: Replace use of %R and %T in format strings passed to
3804         einfo and friends by %pR and %pT.
3805
3806 2018-02-19  Alan Modra  <amodra@gmail.com>
3807
3808         * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Handle %pA and %pB in place
3809         of %A and %B.
3810         * aout-adobe.c: Update all messages using %A and %B.
3811         * aout-cris.c: Likewise.
3812         * aoutx.h: Likewise.
3813         * archive.c: Likewise.
3814         * binary.c: Likewise.
3815         * cache.c: Likewise.
3816         * coff-alpha.c: Likewise.
3817         * coff-arm.c: Likewise.
3818         * coff-i860.c: Likewise.
3819         * coff-mcore.c: Likewise.
3820         * coff-ppc.c: Likewise.
3821         * coff-rs6000.c: Likewise.
3822         * coff-sh.c: Likewise.
3823         * coff-tic4x.c: Likewise.
3824         * coff-tic54x.c: Likewise.
3825         * coff-tic80.c: Likewise.
3826         * coff64-rs6000.c: Likewise.
3827         * coffcode.h: Likewise.
3828         * coffgen.c: Likewise.
3829         * cofflink.c: Likewise.
3830         * coffswap.h: Likewise.
3831         * compress.c: Likewise.
3832         * cpu-arm.c: Likewise.
3833         * ecoff.c: Likewise.
3834         * elf-attrs.c: Likewise.
3835         * elf-eh-frame.c: Likewise.
3836         * elf-ifunc.c: Likewise.
3837         * elf-m10300.c: Likewise.
3838         * elf-properties.c: Likewise.
3839         * elf-s390-common.c: Likewise.
3840         * elf.c: Likewise.
3841         * elf32-arc.c: Likewise.
3842         * elf32-arm.c: Likewise.
3843         * elf32-avr.c: Likewise.
3844         * elf32-bfin.c: Likewise.
3845         * elf32-cr16.c: Likewise.
3846         * elf32-cr16c.c: Likewise.
3847         * elf32-cris.c: Likewise.
3848         * elf32-crx.c: Likewise.
3849         * elf32-d10v.c: Likewise.
3850         * elf32-d30v.c: Likewise.
3851         * elf32-epiphany.c: Likewise.
3852         * elf32-fr30.c: Likewise.
3853         * elf32-frv.c: Likewise.
3854         * elf32-gen.c: Likewise.
3855         * elf32-hppa.c: Likewise.
3856         * elf32-i370.c: Likewise.
3857         * elf32-i386.c: Likewise.
3858         * elf32-i960.c: Likewise.
3859         * elf32-ip2k.c: Likewise.
3860         * elf32-iq2000.c: Likewise.
3861         * elf32-lm32.c: Likewise.
3862         * elf32-m32c.c: Likewise.
3863         * elf32-m32r.c: Likewise.
3864         * elf32-m68hc11.c: Likewise.
3865         * elf32-m68hc12.c: Likewise.
3866         * elf32-m68hc1x.c: Likewise.
3867         * elf32-m68k.c: Likewise.
3868         * elf32-mcore.c: Likewise.
3869         * elf32-mep.c: Likewise.
3870         * elf32-metag.c: Likewise.
3871         * elf32-microblaze.c: Likewise.
3872         * elf32-moxie.c: Likewise.
3873         * elf32-msp430.c: Likewise.
3874         * elf32-mt.c: Likewise.
3875         * elf32-nds32.c: Likewise.
3876         * elf32-nios2.c: Likewise.
3877         * elf32-or1k.c: Likewise.
3878         * elf32-pj.c: Likewise.
3879         * elf32-ppc.c: Likewise.
3880         * elf32-rl78.c: Likewise.
3881         * elf32-rx.c: Likewise.
3882         * elf32-s390.c: Likewise.
3883         * elf32-score.c: Likewise.
3884         * elf32-score7.c: Likewise.
3885         * elf32-sh-symbian.c: Likewise.
3886         * elf32-sh.c: Likewise.
3887         * elf32-sh64.c: Likewise.
3888         * elf32-sparc.c: Likewise.
3889         * elf32-spu.c: Likewise.
3890         * elf32-tic6x.c: Likewise.
3891         * elf32-tilepro.c: Likewise.
3892         * elf32-v850.c: Likewise.
3893         * elf32-vax.c: Likewise.
3894         * elf32-visium.c: Likewise.
3895         * elf32-wasm32.c: Likewise.
3896         * elf32-xgate.c: Likewise.
3897         * elf32-xtensa.c: Likewise.
3898         * elf64-alpha.c: Likewise.
3899         * elf64-gen.c: Likewise.
3900         * elf64-hppa.c: Likewise.
3901         * elf64-ia64-vms.c: Likewise.
3902         * elf64-mmix.c: Likewise.
3903         * elf64-ppc.c: Likewise.
3904         * elf64-s390.c: Likewise.
3905         * elf64-sh64.c: Likewise.
3906         * elf64-sparc.c: Likewise.
3907         * elf64-x86-64.c: Likewise.
3908         * elfcode.h: Likewise.
3909         * elfcore.h: Likewise.
3910         * elflink.c: Likewise.
3911         * elfnn-aarch64.c: Likewise.
3912         * elfnn-ia64.c: Likewise.
3913         * elfnn-riscv.c: Likewise.
3914         * elfxx-mips.c: Likewise.
3915         * elfxx-sparc.c: Likewise.
3916         * elfxx-tilegx.c: Likewise.
3917         * elfxx-x86.c: Likewise.
3918         * hpux-core.c: Likewise.
3919         * ieee.c: Likewise.
3920         * ihex.c: Likewise.
3921         * libbfd.c: Likewise.
3922         * linker.c: Likewise.
3923         * mach-o.c: Likewise.
3924         * merge.c: Likewise.
3925         * mmo.c: Likewise.
3926         * oasys.c: Likewise.
3927         * pdp11.c: Likewise.
3928         * pe-mips.c: Likewise.
3929         * peXXigen.c: Likewise.
3930         * peicode.h: Likewise.
3931         * reloc.c: Likewise.
3932         * rs6000-core.c: Likewise.
3933         * srec.c: Likewise.
3934         * stabs.c: Likewise.
3935         * vms-alpha.c: Likewise.
3936         * xcofflink.c: Likewise.
3937
3938 2018-02-19  Alan Modra  <amodra@gmail.com>
3939
3940         PR 22845
3941         * elf.c (IS_TBSS): Define.
3942         (_bfd_elf_map_sections_to_segments): Use IS_TBSS.
3943         (assign_file_positions_for_non_load_sections): Revert last change.
3944         Properly calculate load segment limits to compare against relro limits.
3945
3946 2018-02-17  Alan Modra  <amodra@gmail.com>
3947
3948         PR 22845
3949         * elf.c (assign_file_positions_for_non_load_sections): Ignore
3950         degenerate zero size PT_LOAD segments when finding one overlapping
3951         the PT_GNU_RELRO segment.
3952
3953 2018-02-16  Alan Modra  <amodra@gmail.com>
3954
3955         * libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false.
3956         (_bfd_bool_bfd_true): Rename from bfd_true.
3957         (_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr.
3958         (_bfd_int_bfd_0): Rename from bfd_0.
3959         (_bfd_uint_bfd_0): Rename from bfd_0u.
3960         (_bfd_long_bfd_0): Rename from bfd_0l.
3961         (_bfd_long_bfd_n1_error): Rename from _bfd_n1.
3962         (_bfd_void_bfd): Rename from bfd_void.
3963         (_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false),
3964         (_bfd_bool_bfd_link_false_error),
3965         (_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true),
3966         (_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true),
3967         (_bfd_bool_bfd_asection_bfd_asection_true),
3968         (_bfd_bool_bfd_asymbol_bfd_asymbol_true),
3969         (_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions.
3970         * archive.c (_bfd_noarchive_get_elt_at_index),
3971         (_bfd_noarchive_openr_next_archived_file),
3972         (_bfd_noarchive_construct_extended_name_table),
3973         (_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname),
3974         (_bfd_noarchive_write_armap): New functions.
3975         * archures.c (_bfd_nowrite_set_arch_mach): New function.
3976         * coff-alpha.c (alpha_ecoff_swap_coff_aux_in),
3977         (alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in),
3978         (alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out),
3979         (alpha_ecoff_swap_coff_lineno_out),
3980         (alpha_ecoff_swap_coff_reloc_out): New functions.
3981         * coff-mips.c (mips_ecoff_swap_coff_aux_in),
3982         (mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in),
3983         (mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out),
3984         (mips_ecoff_swap_coff_lineno_out),
3985         (mips_ecoff_swap_coff_reloc_out): New functions.
3986         * coffcode.h (coff_set_alignment_hook): Replace define with
3987         new function.
3988         (symname_in_debug_hook): Likewise.
3989         * ecoff.c (_bfd_ecoff_set_alignment_hook): New function.
3990         * elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0.
3991         * elf.c (assign_file_positions_except_relocs): Test
3992         elf_backend_allow_non_load_phdr for NULL.
3993         * elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from
3994         _bfd_elf_link_omit_section_dynsym.  Update uses.
3995         (_bfd_elf_omit_section_dynsym_all): New function.
3996         * elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete.
3997         (_bfd_elf_omit_section_dynsym_default): Declare.
3998         (_bfd_elf_omit_section_dynsym_all): Declare.
3999         * linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section),
4000         (_bfd_nolink_bfd_get_relocated_section_contents),
4001         (_bfd_nolink_bfd_lookup_section_flags),
4002         (_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group),
4003         (_bfd_nolink_bfd_link_hash_table_create),
4004         (_bfd_nolink_bfd_link_just_syms),
4005         (_bfd_nolink_bfd_copy_link_hash_symbol_type),
4006         (_bfd_nolink_bfd_link_split_section),
4007         (_bfd_nolink_section_already_linked),
4008         (_bfd_nolink_bfd_define_common_symbol),
4009         (_bfd_nolink_bfd_define_start_stop): New functions.
4010         * reloc.c (_bfd_norelocs_bfd_reloc_type_lookup),
4011         (_bfd_norelocs_bfd_reloc_name_lookup),
4012         (_bfd_nodynamic_canonicalize_dynamic_reloc): New functions.
4013         * section.c (_bfd_nowrite_set_section_contents): New function.
4014         * syms.c (_bfd_nosymbols_canonicalize_symtab),
4015         (_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info),
4016         (_bfd_nosymbols_get_symbol_version_string),
4017         (_bfd_nosymbols_bfd_is_local_label_name),
4018         (_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line),
4019         (_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info),
4020         (_bfd_nosymbols_bfd_make_debug_symbol),
4021         ( _bfd_nosymbols_read_minisymbols),
4022         ( _bfd_nosymbols_minisymbol_to_symbol),
4023         (_bfd_nodynamic_get_synthetic_symtab): New functions.
4024         * libbfd-in.h: Declare new functions.  Update existing defines,
4025         removing casts.
4026         * aix386-core.c: Update to use new hooks.  Formatting.
4027         * aout-adobe.c: Likewise.
4028         * aout-arm.c: Likewise.
4029         * aout-target.h: Likewise.
4030         * aout-tic30.c: Likewise.
4031         * aoutf1.h: Likewise.
4032         * binary.c: Likewise.
4033         * bout.c: Likewise.
4034         * cisco-core.c: Likewise.
4035         * coff-alpha.c: Likewise.
4036         * coff-i386.c: Likewise.
4037         * coff-i860.c: Likewise.
4038         * coff-i960.c: Likewise.
4039         * coff-ia64.c: Likewise.
4040         * coff-mips.c: Likewise.
4041         * coff-ppc.c: Likewise.
4042         * coff-rs6000.c: Likewise.
4043         * coff-sh.c: Likewise.
4044         * coff-tic30.c: Likewise.
4045         * coff-tic54x.c: Likewise.
4046         * coff-x86_64.c: Likewise.
4047         * coff64-rs6000.c: Likewise.
4048         * coffcode.h: Likewise.
4049         * elf-m10300.c: Likewise.
4050         * elf32-cr16.c: Likewise.
4051         * elf32-lm32.c: Likewise.
4052         * elf32-m32r.c: Likewise.
4053         * elf32-metag.c: Likewise.
4054         * elf32-score.c: Likewise.
4055         * elf32-score7.c: Likewise.
4056         * elf32-tilepro.c: Likewise.
4057         * elf32-xstormy16.c: Likewise.
4058         * elf32-xtensa.c: Likewise.
4059         * elf64-alpha.c: Likewise.
4060         * elf64-hppa.c: Likewise.
4061         * elf64-ia64-vms.c: Likewise.
4062         * elf64-mmix.c: Likewise.
4063         * elf64-sh64.c: Likewise.
4064         * elfnn-ia64.c: Likewise.
4065         * elfxx-sparc.c: Likewise.
4066         * elfxx-target.h: Likewise.
4067         * elfxx-tilegx.c: Likewise.
4068         * elfxx-x86.h: Likewise.
4069         * hp300hpux.c: Likewise.
4070         * hppabsd-core.c: Likewise.
4071         * hpux-core.c: Likewise.
4072         * i386msdos.c: Likewise.
4073         * i386os9k.c: Likewise.
4074         * ieee.c: Likewise.
4075         * ihex.c: Likewise.
4076         * irix-core.c: Likewise.
4077         * libaout.h: Likewise.
4078         * libecoff.h: Likewise.
4079         * mach-o-target.c: Likewise.
4080         * mach-o.c: Likewise.
4081         * mipsbsd.c: Likewise.
4082         * mmo.c: Likewise.
4083         * netbsd-core.c: Likewise.
4084         * nlm-target.h: Likewise.
4085         * oasys.c: Likewise.
4086         * osf-core.c: Likewise.
4087         * pdp11.c: Likewise.
4088         * pe-mips.c: Likewise.
4089         * pe-x86_64.c: Likewise.
4090         * pef.c: Likewise.
4091         * plugin.c: Likewise.
4092         * ppcboot.c: Likewise.
4093         * ptrace-core.c: Likewise.
4094         * sco5-core.c: Likewise.
4095         * som.c: Likewise.
4096         * sparclynx.c: Likewise.
4097         * srec.c: Likewise.
4098         * tekhex.c: Likewise.
4099         * trad-core.c: Likewise.
4100         * verilog.c: Likewise.
4101         * versados.c: Likewise.
4102         * vms-alpha.c: Likewise.
4103         * vms-lib.c: Likewise.
4104         * wasm-module.c: Likewise.
4105         * xsym.c: Likewise.
4106         * libbfd.h: Regenerate.
4107
4108 2018-02-15  Jim Wilson  <jimw@sifive.com>
4109
4110         * elfnn-riscv.c (_bfd_riscv_relax_section): Ifdef out check to ignore
4111         symbols whose section address is zero.
4112
4113         * elfnn-riscv.c (riscv_elf_relocate_section): Use bfd_reloc_dangerous
4114         when pcrel_lo reloc has an addend.  Use reloc_dangerous callback for
4115         bfd_reloc_dangerous.  Use einfo instead of warning callback for errors.
4116         Add %X%P to error messages.
4117
4118 2018-02-15  Eric Botcazou  <ebotcazou@adacore.com>
4119
4120         PR ld/22832
4121         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
4122         Pass FALSE instead of TRUE as 'create' argument to bfd_link_hash_lookup
4123         and assert that the result of the call is not NULL.
4124
4125 2018-02-14  Nick Clifton  <nickc@redhat.com>
4126
4127         PR 22823
4128         Revert previous delta.  Add extra casts to avoid compile time
4129         warnings instead.
4130         * libbfd-in.h (_bfd_generic_bfd_copy_private_bfd_data): Add extra
4131         cast to avoid warning from gcc v8 compiler.
4132         (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
4133         (_bfd_generic_bfd_set_private_flags): Likewise.
4134         (_bfd_generic_bfd_copy_private_section_data): Likewise.
4135         (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
4136         (_bfd_generic_bfd_copy_private_header_data): Likewise.
4137         (_bfd_generic_bfd_print_private_bfd_data): Likewise.
4138         (_bfd_noarchive_construct_extended_name_table): Likewise.
4139         (_bfd_noarchive_truncate_arname): Likewise.
4140         (_bfd_noarchive_write_ar_hdr): Likewise.
4141         (_bfd_noarchive_get_elt_at_index): Likewise.
4142         (_bfd_nosymbols_canonicalize_symtab): Likewise.
4143         (_bfd_nosymbols_print_symbol): Likewise.
4144         (_bfd_nosymbols_get_symbol_info): Likewise.
4145         (_bfd_nosymbols_get_symbol_version_string): Likewise.
4146         (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
4147         (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
4148         (_bfd_nosymbols_get_lineno): Likewise.
4149         (_bfd_nosymbols_find_nearest_line): Likewise.
4150         (_bfd_nosymbols_find_line): Likewise.
4151         (_bfd_nosymbols_find_inliner_info): Likewise.
4152         (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
4153         (_bfd_nosymbols_read_minisymbols): Likewise.
4154         (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
4155         (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
4156         (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
4157         (_bfd_nowrite_set_arch_mach): Likewise.
4158         (_bfd_nowrite_set_section_contents): Likewise.
4159         (_bfd_nolink_sizeof_headers): Likewise.
4160         (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
4161         (_bfd_nolink_bfd_relax_section): Likewise.
4162         (_bfd_nolink_bfd_gc_sections): Likewise.
4163         (_bfd_nolink_bfd_lookup_section_flags): Likewise.
4164         (_bfd_nolink_bfd_merge_sections): Likewise.
4165         (_bfd_nolink_bfd_is_group_section): Likewise.
4166         (_bfd_nolink_bfd_discard_group): Likewise.
4167         (_bfd_nolink_bfd_link_hash_table_create): Likewise.
4168         (_bfd_nolink_bfd_link_add_symbols): Likewise.
4169         (_bfd_nolink_bfd_link_just_syms): Likewise.
4170         (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
4171         (_bfd_nolink_bfd_final_link): Likewise.
4172         (_bfd_nolink_bfd_link_split_section): Likewise.
4173         (_bfd_nolink_section_already_linked): Likewise.
4174         (_bfd_nolink_bfd_define_common_symbol): Likewise.
4175         (_bfd_nolink_bfd_define_start_stop): Likewise.
4176         (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
4177         (_bfd_nodynamic_get_synthetic_symtab): Likewise.
4178         (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
4179         (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
4180         * libbfd.c (bfd_false_any): Delete.
4181         (bfd_true_any, bfd_nullvoidptr_any, bfd_0_any): Delete.
4182         (bfd_0u_any, bfd_0l_any, _bfd_n1_any, bfd_void_any): Delete.
4183         * libbfd.h (extern): Regenerate
4184         * aout-target.h (MY_bfd_is_target_special_symbol): Add extra
4185         cast to avoid warning from gcc v8 compiler.
4186         * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
4187         * binary.c (binary_get_symbol_info): Likewise.
4188         * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
4189         * coff-mips.c (mips_ecoff_backend_data): Likewise.
4190         * coffcode.h (coff_set_alignment_hook): Likewise.
4191         (symname_in_debug_hook): Likewise.
4192         (bfd_coff_backend_data bigobj_swap_table): Likewise.
4193         * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
4194         * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
4195         * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
4196         * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
4197         * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
4198         * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
4199         * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
4200         * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
4201         * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
4202         * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
4203         * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
4204         * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
4205         * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
4206         * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
4207         * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
4208         * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
4209         (bfd_elfNN_bfd_make_debug_symbol): Likewise.
4210         (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
4211         (bfd_elfNN_bfd_set_private_flags): Likewise.
4212         (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
4213         (elf_backend_init_index_section): Likewise.
4214         (elf_backend_allow_non_load_phdr): Likewise.
4215         * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
4216         * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
4217         * ieee.c (ieee_construct_extended_name_table): Likewise.
4218         (ieee_write_armap): Likewise.
4219         (ieee_write_ar_hdr): Likewise.
4220         (ieee_bfd_is_target_special_symbol): Likewise.
4221         * ihex.c (ihex_canonicalize_symtab): Likewise.
4222         (ihex_bfd_is_target_special_symbol): Likewise.
4223         * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
4224         * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
4225         (_bfd_ecoff_set_alignment_hook): Likewise.
4226         * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
4227         * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
4228         * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
4229         * oasys.c (oasys_construct_extended_name_table): Likewise.
4230         (oasys_write_armap): Likewise.
4231         (oasys_write_ar_hdr): Likewise.
4232         (oasys_bfd_is_target_special_symbol): Likewise.
4233         * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
4234         * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
4235         * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
4236         * som.c (som_bfd_is_target_special_symbol): Likewise.
4237         * srec.c (srec_bfd_is_target_special_symbol): Likewise.
4238         * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
4239         * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
4240         * versados.c (versados_bfd_is_target_special_symbol): Likewise.
4241         (versados_bfd_reloc_name_lookup): Likewise.
4242         * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
4243         (vms_bfd_define_start_stop): Likewise.
4244         (alpha_vms_bfd_is_target_special_symbol): Likewise.
4245         * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
4246         * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
4247
4248 2018-02-14  H.J. Lu  <hongjiu.lu@intel.com>
4249
4250         PR ld/22842
4251         * elf32-i386.c (elf_i386_check_relocs): Pass FALSE for non
4252         PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
4253         * elf64-x86-64.c (elf_x86_64_check_relocs): Create PLT for
4254         R_X86_64_PC32 reloc against dynamic function in data section.
4255         Pass TRUE for PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
4256         (elf_x86_64_relocate_section): Use PLT for R_X86_64_PC32 reloc
4257         against dynamic function in data section.
4258         * elfxx-x86.c (elf_x86_allocate_dynrelocs): Use PLT in PIE as
4259         function address only if pcrel_plt is true.
4260         (_bfd_x86_elf_link_hash_table_create): Set pcrel_plt.
4261         * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): Add PCREL_PLT for
4262         PC-relative PLT.  If PLT is PC-relative, don't generate dynamic
4263         PC-relative relocation against a function definition in data
4264         secton in PIE.  Remove the obsolete comments.
4265         (elf_x86_link_hash_table): Add pcrel_plt.
4266
4267 2018-02-13  H.J. Lu  <hongjiu.lu@intel.com>
4268
4269         * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check bfd_link_dll,
4270         instead of bfd_link_pic, for building shared library.
4271
4272 2018-02-13  H.J. Lu  <hongjiu.lu@intel.com>
4273
4274         PR gas/22791
4275         * elf64-x86-64.c (is_32bit_relative_branch): Removed.
4276         (elf_x86_64_relocate_section): Check PIC relocations in PIE.
4277         Remove is_32bit_relative_branch usage.  Disallow PC32 reloc
4278         against protected function in shared object.
4279
4280 2018-02-13  Sergei Trofimovich  <slyfox@inbox.ru>
4281
4282         PR 22828
4283         * po/ru.po: Fix typo in Russian translation.
4284
4285 2018-02-13  Maciej W. Rozycki  <macro@mips.com>
4286
4287         * wasm-module.c (wasm_scan_name_function_section): Rename
4288         `index' local variable to `idx'.
4289
4290 2018-02-13  Nick Clifton  <nickc@redhat.com>
4291
4292         PR 22823
4293         Fix compile time warnings generated by gcc version 8.
4294         * libbfd-in.h: Remove extraneous text from prototypes.
4295         Add prototypes for bfd_false_any, bfd_true_any,
4296         bfd_nullvoidptr_any, bfd_0_any, bfd_0u_any, bfd_0l_any,
4297         bfd_n1_any, bfd_void_any.
4298         (_bfd_generic_bfd_copy_private_bfd_data): Use vararg based dummy
4299         function.
4300         (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
4301         (_bfd_generic_bfd_set_private_flags): Likewise.
4302         (_bfd_generic_bfd_copy_private_section_data): Likewise.
4303         (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
4304         (_bfd_generic_bfd_copy_private_header_data): Likewise.
4305         (_bfd_generic_bfd_print_private_bfd_data): Likewise.
4306         (_bfd_noarchive_construct_extended_name_table): Likewise.
4307         (_bfd_noarchive_truncate_arname): Likewise.
4308         (_bfd_noarchive_write_ar_hdr): Likewise.
4309         (_bfd_noarchive_get_elt_at_index): Likewise.
4310         (_bfd_nosymbols_canonicalize_symtab): Likewise.
4311         (_bfd_nosymbols_print_symbol): Likewise.
4312         (_bfd_nosymbols_get_symbol_info): Likewise.
4313         (_bfd_nosymbols_get_symbol_version_string): Likewise.
4314         (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
4315         (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
4316         (_bfd_nosymbols_get_lineno): Likewise.
4317         (_bfd_nosymbols_find_nearest_line): Likewise.
4318         (_bfd_nosymbols_find_line): Likewise.
4319         (_bfd_nosymbols_find_inliner_info): Likewise.
4320         (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
4321         (_bfd_nosymbols_read_minisymbols): Likewise.
4322         (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
4323         (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
4324         (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
4325         (_bfd_nowrite_set_arch_mach): Likewise.
4326         (_bfd_nowrite_set_section_contents): Likewise.
4327         (_bfd_nolink_sizeof_headers): Likewise.
4328         (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
4329         (_bfd_nolink_bfd_relax_section): Likewise.
4330         (_bfd_nolink_bfd_gc_sections): Likewise.
4331         (_bfd_nolink_bfd_lookup_section_flags): Likewise.
4332         (_bfd_nolink_bfd_merge_sections): Likewise.
4333         (_bfd_nolink_bfd_is_group_section): Likewise.
4334         (_bfd_nolink_bfd_discard_group): Likewise.
4335         (_bfd_nolink_bfd_link_hash_table_create): Likewise.
4336         (_bfd_nolink_bfd_link_add_symbols): Likewise.
4337         (_bfd_nolink_bfd_link_just_syms): Likewise.
4338         (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
4339         (_bfd_nolink_bfd_final_link): Likewise.
4340         (_bfd_nolink_bfd_link_split_section): Likewise.
4341         (_bfd_nolink_section_already_linked): Likewise.
4342         (_bfd_nolink_bfd_define_common_symbol): Likewise.
4343         (_bfd_nolink_bfd_define_start_stop): Likewise.
4344         (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
4345         (_bfd_nodynamic_get_synthetic_symtab): Likewise.
4346         (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
4347         (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
4348         * libbfd.c (bfd_false_any): New function.  Like bfd_false but
4349         accepts one or more arguments.
4350         (bfd_true_any): Likewise.
4351         (bfd_nullvoidptr_any): Likewise.
4352         (bfd_0_any): Likewise.
4353         (bfd_0u_any): Likewise.
4354         (bfd_0l_any): Likewise.
4355         (_bfd_n1_any): Likewise.
4356         (bfd_void_any): Likewise.
4357         * libbfd.h (extern): Regenerate
4358         * aout-target.h (MY_bfd_is_target_special_symbol): Use vararg
4359         based dummy function.
4360         * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
4361         * binary.c (binary_get_symbol_info): Likewise.
4362         * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
4363         * coff-mips.c (mips_ecoff_backend_data): Likewise.
4364         * coffcode.h (coff_set_alignment_hook): Likewise.
4365         (symname_in_debug_hook): Likewise.
4366         (bfd_coff_backend_data bigobj_swap_table): Likewise.
4367         * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
4368         * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
4369         * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
4370         * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
4371         * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
4372         * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
4373         * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
4374         * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
4375         * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
4376         * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
4377         * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
4378         * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
4379         * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
4380         * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
4381         * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
4382         * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
4383         (bfd_elfNN_bfd_make_debug_symbol): Likewise.
4384         (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
4385         (bfd_elfNN_bfd_set_private_flags): Likewise.
4386         (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
4387         (elf_backend_init_index_section): Likewise.
4388         (elf_backend_allow_non_load_phdr): Likewise.
4389         * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
4390         * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
4391         * ieee.c (ieee_construct_extended_name_table): Likewise.
4392         (ieee_write_armap): Likewise.
4393         (ieee_write_ar_hdr): Likewise.
4394         (ieee_bfd_is_target_special_symbol): Likewise.
4395         * ihex.c (ihex_canonicalize_symtab): Likewise.
4396         (ihex_bfd_is_target_special_symbol): Likewise.
4397         * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
4398         * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
4399         (_bfd_ecoff_set_alignment_hook): Likewise.
4400         * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
4401         * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
4402         * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
4403         * oasys.c (oasys_construct_extended_name_table): Likewise.
4404         (oasys_write_armap): Likewise.
4405         (oasys_write_ar_hdr): Likewise.
4406         (oasys_bfd_is_target_special_symbol): Likewise.
4407         * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
4408         * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
4409         * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
4410         * som.c (som_bfd_is_target_special_symbol): Likewise.
4411         * srec.c (srec_bfd_is_target_special_symbol): Likewise.
4412         * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
4413         * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
4414         * versados.c (versados_bfd_is_target_special_symbol): Likewise.
4415         (versados_bfd_reloc_name_lookup): Likewise.
4416         * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
4417         (vms_bfd_define_start_stop): Likewise.
4418         (alpha_vms_bfd_is_target_special_symbol): Likewise.
4419         * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
4420         * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
4421         * elf32-arc.c (get_replace_function): Assign replacement function
4422         to func pointer.
4423         * elf32-i370.c (i370_noop): Update prototype.
4424
4425 2018-02-13  Alan Modra  <amodra@gmail.com>
4426
4427         PR 22836
4428         * elf.c (_bfd_elf_fixup_group_sections): Account for removed
4429         relocation sections.  If size reduces to just the flag word,
4430         remove that too and mark with SEC_EXCLUDE.
4431         * elflink.c (bfd_elf_final_link): Strip empty group sections.
4432
4433 2018-02-13  Alan Modra  <amodra@gmail.com>
4434
4435         PR 22829
4436         * elf.c (assign_file_positions_for_non_load_sections): Rewrite
4437         PT_GNU_RELRO setup.
4438
4439 2018-02-12  Zebediah Figura  <z.figura12@gmail.com>
4440
4441         * i386msdos.c (msdos_mkobject); New function.
4442         (msdos_object_p): New function.
4443         (i386_msdos_vec): Use msdos_object_p as the check_format
4444         function.
4445         * peicode.h: Rename external_PEI_DOS_hdr, DOSMAGIC, and
4446         NT_SIGNATURE to external_DOS_hdr, IMAGE_DOS_SIGNATURE, and
4447         IMAGE_NT_SIGNATURE.
4448         * peXXigen.c: Likewise.
4449         * coff-ia64.c: Likewise.
4450
4451 2018-02-12  Nick Clifton  <nickc@redhat.com>
4452
4453         * elf32-nds32.c (nds32_elf_relax_longjump3): Remove redundant
4454         assignment.
4455         * elf32-arc.c (elf_arc_relocate_section): Likewise.
4456
4457 2018-02-09  Eric Botcazou  <ebotcazou@adacore.com>
4458
4459         * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Reorder conditions.
4460         (sparc_elf_append_rela): Assert that there is enough room in section.
4461         (_bfd_sparc_elf_copy_indirect_symbol): Fix formatting.
4462         (_bfd_sparc_elf_adjust_dynamic_symbol): Minor tweak.
4463         (allocate_dynrelocs): Remove outdated comments and reorder conditions.
4464         For a symbol subject to a GOT relocation, reserve a slot in the
4465         relocation section if the symbol isn't dynamic and we are in PIC mode.
4466         (_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: If relocation
4467         is relaxed and a slot was reserved, generate a R_SPARC_NONE relocation.
4468         <R_SPARC_GOTDATA_OP_HIX22>: Adjust comments.
4469         <R_SPARC_PC10>: Reorder conditions.  Remove always-false assertion.
4470         (_bfd_sparc_elf_finish_dynamic_symbol): Rename local_undefweak into
4471         resolved_to_zero.  Do not generate a dynamic GOT relocation for an
4472         undefined weak symbol with non-default visibility.  Remove superfluous
4473         'else' and fix formatting.
4474
4475 2018-02-09  H.J. Lu  <hongjiu.lu@intel.com>
4476
4477         * elf32-i386.c (elf_i386_get_synthetic_symtab): Also handle
4478         is_solaris.
4479         (i386_elf32_sol2_vec): Don't declare.
4480         (elf_i386_link_setup_gnu_properties): Also handle is_solaris.
4481         Don't set need_global_offset_table.
4482         (elf_i386_solaris_arch_bed): New.
4483         (elf_backend_arch_data): Set to elf_i386_solaris_arch_bed for
4484         Solaris.
4485         * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Check
4486         target_os != is_nacl instead of target_os == is_normal.
4487         (x86_64_elf64_sol2_vec): Don't declare.
4488         (elf_x86_64_link_setup_gnu_properties): Check target_os !=
4489         is_nacl instead of target_os == is_normal.  Don't set
4490         need_global_offset_table.
4491         (elf_x86_64_solaris_arch_bed): New.
4492         (elf_backend_arch_data): Set to elf_x86_64_solaris_arch_bed for
4493         Solaris.
4494         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep
4495         _GLOBAL_OFFSET_TABLE_ for Solaris.
4496         (_bfd_x86_elf_link_setup_gnu_properties): Don't copy
4497         need_global_offset_table.
4498         * elfxx-x86.h (elf_x86_target_os): Add is_solaris.
4499         (elf_x86_link_hash_table): Remove need_global_offset_table.
4500         (elf_x86_init_table): Likewise.
4501
4502 2018-02-08  H.J. Lu  <hongjiu.lu@intel.com>
4503
4504         * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
4505         Remove prototype.
4506         (i386_elf32_sol2_vec): Declared.
4507         (elf_i386_link_setup_gnu_properties): Set
4508         need_global_offset_table with info->output_bfd->xvec.
4509         * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
4510         Remove prototype.
4511         (x86_64_elf64_sol2_vec): Declared.
4512         (elf_x86_64_link_setup_gnu_properties): Set
4513         need_global_offset_table with info->output_bfd->xvec.
4514
4515 2018-02-08  H.J. Lu  <hongjiu.lu@intel.com>
4516
4517         * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
4518         New prototype.
4519         (elf_i386_link_setup_gnu_properties): Set need_global_offset_table
4520         for Solaris.
4521         * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
4522         New prototype.
4523         (elf_x86_64_link_setup_gnu_properties): Set
4524         need_global_offset_table for Solaris.
4525         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep the
4526         unused _GLOBAL_OFFSET_TABLE_ for Solaris.
4527         (_bfd_x86_elf_link_setup_gnu_properties): Copy
4528         need_global_offset_table.
4529         * elfxx-x86.h (elf_x86_link_hash_table): Add
4530         need_global_offset_table.
4531         (elf_x86_init_table): Likewise.
4532
4533 2018-02-08  Jim Wilson  <jimw@sifive.com>
4534
4535         * elfnn-riscv.c (riscv_elf_relocate_section): Add comment for previous
4536         change.
4537
4538 2018-02-08  Nick Clifton  <nickc@redhat.com>
4539
4540         PR 22788
4541         * elf.c (elf_parse_notes): Reject notes with excessuively large
4542         alignments.
4543
4544 2018-02-07  Alan Modra  <amodra@gmail.com>
4545
4546         Revert 2018-01-17  Alan Modra  <amodra@gmail.com>
4547         * elf32-ppc.c: Remove speculation barrier support.
4548         * elf32-ppc.h: Likewise.
4549         * elf64-ppc.c: Likewise.
4550         * elf64-ppc.h: Likewise.
4551
4552 2018-02-06  Jim Wilson  <jimw@sifive.com>
4553
4554         * elfnn-riscv.c (riscv_elf_relocate_section): Return TRUE if used
4555         callback to report an error.
4556
4557 2018-02-06  Eric Botcazou  <ebotcazou@adacore.com>
4558
4559         PR ld/22263
4560         * elfxx-sparc.c (sparc_elf_tls_transition): Turn call to bfd_link_pic
4561         into call to !bfd_link_executable and tidy up.
4562         (_bfd_sparc_elf_check_relocs): Fix formatting and tidy up.
4563         <R_SPARC_TLS_LE_HIX22>: Turn call to bfd_link_pic into call to
4564         !bfd_link_executable.
4565         <R_SPARC_TLS_IE_HI22>: Likewise.
4566         <GOT relocations>: Remove useless code, tidy and merge related blocks.
4567         <R_SPARC_TLS_GD_CALL>: Turn call to bfd_link_pic into call to
4568         !bfd_link_executable.
4569         <R_SPARC_WPLT30>: Tidy up.
4570         (_bfd_sparc_elf_gc_mark_hook): Turn call to bfd_link_pic into call to
4571         !bfd_link_executable.
4572         (allocate_dynrelocs): Likewise.
4573         (_bfd_sparc_elf_relocate_section): Fix formatting and tidy up.
4574         <R_SPARC_TLS_GD_HI22>: Merge into...
4575         <R_SPARC_TLS_GD_LO10>: ...this.  Adjust 4th argument in call to
4576         sparc_elf_tls_transition and remove redundant code.
4577         <R_SPARC_TLS_LDM_HI22>: Turn call to bfd_link_pic into call to
4578         !bfd_link_executable.
4579         <R_SPARC_TLS_LDO_HIX22>: Likewise.
4580         <R_SPARC_TLS_LE_HIX22>: Likewise.  Tidy up.
4581         <R_SPARC_TLS_LDM_CALL>: Likewise.
4582         <R_SPARC_TLS_GD_CALL>: Likewise.  Tidy up.
4583         <R_SPARC_TLS_GD_ADD>: Likewise.
4584         <R_SPARC_TLS_LDM_ADD>: Likewise.
4585         <R_SPARC_TLS_LDO_ADD>: Likewise.
4586         <R_SPARC_TLS_IE_LD>: Likewise.
4587
4588 2018-02-06  MiloÅ¡ Stojanović  <milos.stojanovic@rt-rk.com>
4589
4590         PR 22789
4591         * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): If the dwarf
4592         functions failed to find the function name, try the generic elf
4593         find function instead.
4594
4595 2018-02-06  Sergio Durigan Junior  <sergiodj@redhat.com>
4596
4597         * coff-rs6000.c (xcoff_write_archive_contents_old): Use
4598         'memcpy' instead of 'strncpy' when writing the magic number.
4599
4600 2018-02-06  Nick Clifton  <nickc@redhat.com>
4601
4602         PR 22794
4603         * opncls.c (bfd_get_debug_link_info_1): Check the size of the
4604         section before attempting to read it in.
4605         (bfd_get_alt_debug_link_info): Likewise.
4606
4607 2018-02-06  Paul Carroll  <pcarroll@codesourcery.com>
4608
4609         * bfd/dwarf2.c (find_abstract_name): Modified to return file and
4610         line information in addition to name, if they can be found.
4611
4612 2018-02-05  Renlin Li  <renlin.li@arm.com>
4613
4614         PR ld/22764
4615         * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Relax the
4616         R_AARCH64_ABS32 and R_AARCH64_ABS16 for absolute symbol. Apply the
4617         check for writeable section as well.
4618
4619 2018-02-05  H.J. Lu  <hongjiu.lu@intel.com>
4620
4621         PR ld/22782
4622         * elf32-i386.c (elf_i386_check_relocs): Set got_referenced if
4623         _GLOBAL_OFFSET_TABLE_ is referenced or GOT is needed to resolve
4624         undefined weak symbol to 0.
4625         * elf64-x86-64.c (elf_x86_64_check_relocs): Set got_referenced
4626         if _GLOBAL_OFFSET_TABLE_ is referenced.
4627         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Check
4628         got_referenced instead of ref_regular_nonweak.  Remove the
4629         unused _GLOBAL_OFFSET_TABLE_ from symbol table.
4630         * elfxx-x86.h (elf_x86_link_hash_table): Add got_referenced.
4631
4632 2018-02-05  Maciej W. Rozycki  <macro@mips.com>
4633
4634         * elfnn-riscv.c (_bfd_riscv_relax_pc): Use `memset' to
4635         initialize `hi_reloc'.
4636
4637 2018-02-05  Maciej W. Rozycki  <macro@mips.com>
4638
4639         * elfxx-mips.c (_bfd_mips_elf_section_processing): For
4640         SHT_MIPS_REGINFO sections don't assert the correct size and
4641         report an error instead.
4642
4643 2018-02-05  Maciej W. Rozycki  <macro@mips.com>
4644
4645         * elf.c (_bfd_elf_write_object_contents): Propagate a failure
4646         status from `->elf_backend_section_processing'.
4647
4648 2018-02-02  Jim Wilson  <jimw@sifive.com>
4649
4650         PR ld/22756
4651         * elfnn-riscv.c (riscv_relax_delete_bytes): New parameter link_info.
4652         If link_info->wrap_hash, check for a duplicate symbol and ignore.
4653         (_bfd_riscv_relax_call, bfd_riscv_relax_lui, _bfd_riscv_relax_tls_le):
4654         Pass new argument to riscv_relax_delete_bytes.
4655         (_bfd_riscv_relax_align, _bfd_riscv_relax_delete): Likewise.  Remove
4656         ATTRIBUTE_UNUSED from link_info parameter.
4657
4658 2018-02-02  Alan Modra  <amodra@gmail.com>
4659
4660         * elf64-ppc.c (ppc64_elf_relocate_section): Don't relocate nops
4661         emitted for toc sequence optimization.  Set and use "howto" later.
4662
4663 2018-02-01  Simon Marchi  <simon.marchi@ericsson.com>
4664
4665         * elf64-ppc.c (ppc64_elf_archive_symbol_lookup): Avoid pointer
4666         arithmetic on NULL pointer.
4667         * elflink.c (_bfd_elf_archive_symbol_lookup,
4668         elf_link_add_archive_symbols): Likewise.
4669
4670 2018-01-31  Michael Matz  <matz@suse.de>
4671
4672         * elflink.c (bfd_elf_define_start_stop): Fix check of
4673         def_dynamic.
4674
4675 2018-01-31  H.J. Lu  <hongjiu.lu@intel.com>
4676
4677         PR ld/21964
4678         * elflink.c (bfd_elf_define_start_stop): Check if __start and
4679         __stop symbols are referenced by shared objects.
4680
4681 2018-01-30  Alan Modra  <amodra@gmail.com>
4682
4683         PR 22758
4684         * elf.c (_bfd_elf_map_sections_to_segments): Don't start a new
4685         segment when demand paged with lma on the same page.  Test this
4686         before load/non-load, executable/non-executable,
4687         writable/non-writable tests and simplify.  Delete bogus relro
4688         condition in writable/non-writable test.  Delete outdated
4689         comment.  Formatting.
4690
4691 2018-01-30  Alan Modra  <amodra@gmail.com>
4692
4693         * elflink.c (bfd_elf_define_start_stop): Make __start and __stop
4694         symbols dynamic.
4695
4696 2018-01-29  Alan Modra  <amodra@gmail.com>
4697
4698         PR 22741
4699         * coffgen.c (coff_pointerize_aux): Ensure auxent tagndx is in
4700         range before converting to a symbol table pointer.
4701
4702 2018-01-27  Nick Clifton  <nickc@redhat.com>
4703
4704         * po/ru.po: Updated Russian translation.
4705
4706 2018-01-26  Alan Modra  <amodra@gmail.com>
4707
4708         * elflink.c (bfd_elf_define_start_stop): Override symbols when
4709         they are defined dynamically.
4710
4711 2018-01-26  Alan Modra  <amodra@gmail.com>
4712
4713         * elf64-ppc.c (ppc64_elf_size_stubs): Iterate sizing when
4714         .branch_lt changes size.
4715
4716 2018-01-25  Alan Modra  <amodra@gmail.com>
4717
4718         PR 22746
4719         * elfcode.h (elf_object_p): Avoid integer overflow.
4720
4721 2018-01-25  Eric Botcazou  <ebotcazou@adacore.com>
4722
4723         PR ld/22727
4724         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
4725         Do a mere lookup of the __tls_get_addr symbol instead of adding it.
4726
4727         Revert
4728         2017-10-19  H.J. Lu  <hongjiu.lu@intel.com>
4729
4730         PR ld/22263
4731         * elfxx-sparc.c (sparc_elf_tls_transition): Replace
4732         bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
4733         bfd_link_executable for TLS check.
4734         (_bfd_sparc_elf_check_relocs): Likewise.
4735         (allocate_dynrelocs): Likewise.
4736         (_bfd_sparc_elf_relocate_section): Likewise.
4737
4738 2018-01-24  Renlin Li  <renlin.li@arm.com>
4739
4740         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Add support for
4741         BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
4742         BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
4743         BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
4744         BFD_RELOC_AARCH64_MOVW_PREL_G3.
4745         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4746         (_bfd_aarch64_elf_resolve_relocation): Likewise.
4747
4748 2018-01-24  Renlin Li  <renlin.li@arm.com>
4749
4750         * reloc.c: Add BFD_RELOC_AARCH64_MOVW_PREL_G0,
4751         BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, BFD_RELOC_AARCH64_MOVW_PREL_G1,
4752         BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, BFD_RELOC_AARCH64_MOVW_PREL_G2,
4753         BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, BFD_RELOC_AARCH64_MOVW_PREL_G3.
4754         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add entries for
4755         BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
4756         BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
4757         BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
4758         BFD_RELOC_AARCH64_MOVW_PREL_G3.
4759         * bfd-in2.h: Regenerate.
4760         * libbfd.h: Regenerate.
4761
4762 2018-01-23  Maciej W. Rozycki  <macro@mips.com>
4763
4764         * elfxx-mips.c (_bfd_mips_elf_final_link): Update a stale
4765         `mips_elf32_section_processing' comment reference.
4766
4767 2018-01-20  H.J. Lu  <hongjiu.lu@intel.com>
4768
4769         PR ld/22721
4770         * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Check the
4771         versioned __tls_get_addr symbol.
4772
4773 2018-01-19  Nick Clifton  <nickc@redhat.com>
4774
4775         * po/fr.po: Updated French translation.
4776
4777 2018-01-18  Alan Modra  <amodra@gmail.com>
4778
4779         * elf32-ppc.c (ppc_elf_create_glink): Correct alignment of .glink.
4780         * elf64-ppc.c (ppc64_elf_size_stubs): Handle negative plt_stub_align.
4781         (ppc64_elf_build_stubs): Likewise.
4782
4783 2018-01-17  Nick Clifton  <nickc@redhat.com>
4784
4785         * po/ru.po: Updated Russian translation.
4786         * po/uk/po: Updated Ukranian translation.
4787
4788 2018-01-17  Alan Modra  <amodra@gmail.com>
4789
4790         * elf64-ppc.c (ppc64_elf_build_stubs): Silence gcc warning.
4791
4792 2018-01-17  Alan Modra  <amodra@gmail.com>
4793
4794         * elf32-ppc.c (GLINK_ENTRY_SIZE): Handle speculation barrier.
4795         (CRSETEQ, BEQCTRM): Define.
4796         (is_nonpic_glink_stub): Don't check bctr.
4797         (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
4798         (ppc_elf_relax_section): Size speculation barrier.
4799         (output_bctr): New function.
4800         (write_glink_stub): Use output_bctr.
4801         (ppc_elf_relocate_section): Use output_bctr for long branch stub.
4802         (ppc_elf_finish_dynamic_symbol): Likewise.
4803         (ppc_elf_finish_dynamic_sections): Use output_bctr.
4804         * elf32-ppc.h (struct ppc_elf_params): Add speculate_indirect_jumps.
4805         * elf64-ppc.c (CRSETEQ, BEQCTRM, BEQCTRLM): Define.
4806         (GLINK_PLTRESOLVE_SIZE): Size speculation barrier.
4807         (size_global_entry_stubs): Handle speculation barrier sizing.
4808         (plt_stub_size): Likewise.
4809         (output_bctr): New function.
4810         (build_plt_stub, build_tls_get_addr_stub): Output speculation
4811         barrier.
4812         (ppc_build_one_stub): Likewise for ppc_stub_plt_branch.
4813         (ppc_size_one_stub): Size speculation barrier in ppc_stub_plt_branch.
4814         (build_global_entry_stubs): Output speculation barrier.
4815         (ppc64_elf_build_stubs): Likewise in __glink_PLTresolve stub.
4816         * elf64-ppc.h (struct ppc64_elf_params): Add speculate_indirect_jumps.
4817
4818 2018-01-17  Alan Modra  <amodra@gmail.com>
4819
4820         * elf32-ppc.c (GLINK_ENTRY_SIZE): Add parameters, handle
4821         __tls_get_addr_opt, and alignment sizing.
4822         (TLS_GET_ADDR_GLINK_SIZE): Delete.
4823         (is_nonpic_glink_stub): Don't use GLINK_ENTRY_SIZE.
4824         (ppc_elf_get_synthetic_symtab): Recognize stubs spaced at 4, 6,
4825         or 8 insns.
4826         (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
4827         (allocate_dynrelocs): Use new GLINK_ENTRY_SIZE.
4828         (ppc_elf_size_dynamic_sections): Likewise.  Size branch table
4829         by PLT reloc count.
4830         (write_glink_stub): Handle __tls_get_addr_opt stub.
4831         Pad out to size given by GLINK_ENTRY_SIZE.
4832         (ppc_elf_relocate_section): Adjust write_glink_stub call.
4833         (ppc_elf_finish_dynamic_symbol): Likewise.
4834         (ppc_elf_finish_dynamic_sections): Write PLTresolve without using
4835         insn array since so many need rewriting.
4836         * elf32-ppc.h (struct ppc_elf_params): Add plt_stub_align.
4837         * elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Rename from
4838         GLINK_CALL_STUB_SIZE.  Add htab param and evaluate to size without
4839         nops.  Adjust all uses.
4840         (ppc64_elf_get_synthetic_symtab): Don't use GLINK_CALL_STUB_SIZE
4841         in glink_vma calculation.
4842         (struct ppc_link_hash_table): Add global_entry section pointer.
4843         (create_linkage_sections): Create separate section for global
4844         entry stubs.
4845         (PPC_LO, PPC_HI, PPC_HA): Move earlier.
4846         (size_global_entry_stubs): Handle sizing for aligned stubs.
4847         (ppc64_elf_size_dynamic_sections): Handle global_entry alloc,
4848         and don't stash end of glink branch table in rawsize.
4849         (ppc_build_one_stub): Rewrite stub size calculations.
4850         (build_global_entry_stubs): Use new section.
4851         (ppc64_elf_build_stubs): Don't pad __glink_PLTresolve with nops.
4852         Build lazy link stubs out to end of section.  Build global entry
4853         stubs in new section.
4854
4855 2018-01-15  Nick Clifton  <nickc@redhat.com>
4856
4857         * po/uk.po: Updated Ukranian translation.
4858
4859 2018-01-13  Nick Clifton  <nickc@redhat.com>
4860
4861         * po/bfd.pot: Regenerated.
4862
4863 2018-01-13  Nick Clifton  <nickc@redhat.com>
4864
4865         * version.m4: Bump version to 2.30.51
4866         * configure: Regenerate.
4867
4868 2018-01-13  Nick Clifton  <nickc@redhat.com>
4869
4870         2.30 branch created.
4871
4872 2018-01-12  Jens Widell  <jl@opera.com>
4873
4874         * elf.c (setup_group): Optimize search for group by remembering
4875         last found group and restarting search at that index.
4876         * elf-bfd.h (struct elf_obj_tdata): Add group_search_offset field.
4877
4878 2018-01-12  Gunther Nikl  <gnikl@users.sourceforge.net>
4879
4880         * aoutx.h (aout_link_check_ar_symbols): Remove default and handle
4881         bfd_link_common_skip_none in switch.
4882
4883 2018-01-12  Alan Modra  <amodra@gmail.com>
4884
4885         PR ld/22649
4886         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Ignore dynamic
4887         references on forced local symbols.
4888
4889 2018-01-12  Vlad Ivanov  <vlad@ivanov.email>
4890
4891         * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when
4892         .reginfo section has wrong size.
4893
4894 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
4895
4896         PR ld/22393
4897         * elf.c (_bfd_elf_map_sections_to_segments): When generating
4898         separate code and read-only data LOAD segments, create a new
4899         LOAD segment if the previous section contains text and the
4900         current section doesn't or vice versa.  Don't put a writable
4901         section in a read-only segment if there is a RELRO segment.
4902
4903 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
4904
4905         PR ld/22649
4906         * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Ignore dynamic
4907         references on forced local symbols.
4908
4909 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
4910
4911         PR ld/22677
4912         * elflink.c (bfd_elf_gc_sections): Keep all PREINIT_ARRAY,
4913         INIT_ARRAY as well as FINI_ARRAY sections for ld -r --gc-section.
4914
4915 2018-01-09  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
4916
4917         PR 22662
4918         * elf32-nds32.c (nds32_elf_relax_loadstore): Fix a typographical error.
4919
4920 2018-01-03  John Baldwin  <jhb@FreeBSD.org>
4921
4922         * elf.c (elfcore_grok_freebsd_note): Handle
4923         NT_FREEBSD_PROCSTAT_PROC, NT_FREEBSD_PROCSTAT_FILES, and
4924         NT_FREEBSD_PROCSTAT_VMMAP.
4925
4926 2018-01-03  Alan Modra  <amodra@gmail.com>
4927
4928         Update year range in copyright notice of all files.
4929
4930 For older changes see ChangeLog-2017
4931 \f
4932 Copyright (C) 2018 Free Software Foundation, Inc.
4933
4934 Copying and distribution of this file, with or without modification,
4935 are permitted in any medium without royalty provided the copyright
4936 notice and this notice are preserved.
4937
4938 Local Variables:
4939 mode: change-log
4940 left-margin: 8
4941 fill-column: 74
4942 version-control: never
4943 End: