Remove tandem support
[external/binutils.git] / bfd / ChangeLog
1 2018-04-16  Alan Modra  <amodra@gmail.com>
2
3         * config.bfd: Remove tandem support.
4
5 2018-04-16  Alan Modra  <amodra@gmail.com>
6
7         * Makefile.am: Remove newsos3 support.
8         * aoutx.h: Likewise.
9         * config.bfd: Likewise.
10         * configure.ac: Likewise.
11         * targets.c: Likewise.
12         * newsos3.c: Delete.
13         * Makefile.in: Regenerate.
14         * configure: Regenerate.
15         * po/SRC-POTFILES.in: Regenerate.
16
17 2018-04-16  Alan Modra  <amodra@gmail.com>
18
19         * Makefile.am: Remove netware support.
20         * bfd-in.h: Likewise.
21         * bfd.c: Likewise.
22         * config.bfd: Likewise.
23         * configure.ac: Likewise.
24         * doc/bfdint.texi: Likewise.
25         * ecoff.c: Likewise.
26         * targets.c: Likewise.
27         * libnlm.h: Delete.
28         * nlm-target.h: Delete.
29         * nlm.c: Delete.
30         * nlm32-alpha.c: Delete.
31         * nlm32-i386.c: Delete.
32         * nlm32-ppc.c: Delete.
33         * nlm32-sparc.c: Delete.
34         * nlm32.c: Delete.
35         * nlm64.c: Delete.
36         * nlmcode.h: Delete.
37         * nlmswap.h: Delete.
38         * Makefile.in: Regenerate.
39         * bfd-in2.h: Regenerate.
40         * configure: Regenerate.
41         * po/SRC-POTFILES.in: Regenerate.
42
43 2018-04-16  Alan Modra  <amodra@gmail.com>
44
45         * archures.c: Remove tahoe support.
46         * config.bfd: Likewise.
47         * configure.ac: Likewise.
48         * hosts/tahoe.h: Delete.
49         * bfd-in2.h: Regenerate.
50         * configure: Regenerate.
51
52 2018-04-14  Alan Modra  <amodra@gmail.com>
53
54         * elf-bfd.h (struct elf_backend_data): Add relropagesize.
55         * elfxx-target.h (ELF_RELROPAGESIZE): Provide default and
56         sanity test.
57         (elfNN_bed): Init relropagesize.
58         * bfd.c (bfd_emul_get_commonpagesize): Add boolean param to
59         select relropagesize.
60         * elf32-ppc.c (ELF_COMMONPAGESIZE): Define as 0x1000.
61         (ELF_RELROPAGESIZE): Define as ELF_MAXPAGESIZE.
62         (ELF_MINPAGESIZE): Don't define.
63         * elf64-ppc.c (ELF_COMMONPAGESIZE): Define as 0x1000.
64         (ELF_RELROPAGESIZE): Define as ELF_MAXPAGESIZE.
65         * bfd-in2.h: Regenerate.
66
67 2018-04-14  Alan Modra  <amodra@gmail.com>
68
69         * elf32-ppc.c (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Don't depend
70         on __QNXTARGET__ define.
71
72 2018-04-14  Alan Modra  <amodra@gmail.com>
73
74         * config.bfd: Add powerpc-*-lynxos* and powerpc-*-windiss*
75         to obsolete list.
76
77 2018-04-11  Alan Modra  <amodra@gmail.com>
78
79         * aout-adobe.c: Delete.
80         * bout.c: Delete.
81         * coff-i860.c: Delete.
82         * coff-i960.c: Delete.
83         * cpu-i860.c: Delete.
84         * cpu-i960.c: Delete.
85         * elf32-i860.c: Delete.
86         * elf32-i960.c: Delete.
87         * hosts/i860mach3.h: Delete.
88         * Makefile.am: Remove i860, i960, bout, and adobe support.
89         * archures.c: Remove i860 and i960 support.
90         * coffcode.h: Likewise.
91         * reloc.c: Likewise.
92         * aoutx.h: Comment updates.
93         * archive.c: Remove BOUT and i960 support.
94         * bfd.c: Remove BOUT support.
95         * coffswap.h: Remove i960 support.
96         * config.bfd: Remove i860, i960 and adobe targets.
97         * configure.ac: Remove adode, bout, i860, i960, icoff targets.
98         * targets.c: Likewise.
99         * ieee.c: Remove i960 support.
100         * mach-o.c: Remove i860 support.
101         * Makefile.in: Regenerate.
102         * bfd-in2.h: Regenerate.
103         * configure: Regenerate.
104         * libbfd.h: Regenerate.
105         * po/SRC-POTFILES.in: Regenerate.
106
107 2018-04-09  Maciej W. Rozycki  <macro@mips.com>
108
109         * elf64-mips.c (mips_elf64_write_rel): Handle a NULL BFD pointer
110         in the BFD symbol referred by the relocation.
111         (mips_elf64_write_rela): Likewise.
112
113 2018-04-09  Maciej W. Rozycki  <macro@mips.com>
114
115         * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Issue an
116         error for out-of-range `r_sym' values.
117
118 2018-04-09  Alan Modra  <amodra@gmail.com>
119
120         * elf64-ppc.c (struct _ppc64_elf_section_data): Add has_pltcall field.
121         (struct ppc_link_hash_table): Add can_convert_all_inline_plt.
122         (ppc64_elf_check_relocs): Set has_pltcall.
123         (ppc64_elf_adjust_dynamic_symbol): Discard some PLT entries.
124         (ppc64_elf_inline_plt): New function.
125         (ppc64_elf_size_dynamic_sections): Discard some PLT entries for locals.
126         * elf64-ppc.h (ppc64_elf_inline_plt): Declare.
127         * elf32-ppc.c (has_pltcall): Define.
128         (struct ppc_elf_link_hash_table): Add can_convert_all_inline_plt.
129         (ppc_elf_check_relocs): Set has_pltcall.
130         (ppc_elf_inline_plt): New function.
131         (ppc_elf_adjust_dynamic_symbol): Discard some PLT entries.
132         (ppc_elf_size_dynamic_sections): Likewise.
133         * elf32-ppc.h (ppc_elf_inline_plt): Declare.
134
135 2018-04-09  Alan Modra  <amodra@gmail.com>
136
137         * elf32-ppc.c (ppc_elf_howto_raw): Add PLTSEQ and PLTCALL howtos.
138         (is_plt_seq_reloc): New function.
139         (ppc_elf_check_relocs): Handle PLTSEQ and PLTCALL relocs.
140         (ppc_elf_tls_optimize): Handle inline plt call sequence.
141         (ppc_elf_relax_section): Handle PLTCALL reloc.
142         (ppc_elf_relocate_section): Nop out inline plt call sequence when
143         resolving locally.
144         * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_PLTSEQ and
145         R_PPC64_PLTCALL entries.  Comment R_PPC64_TOCSAVE.
146         (has_tls_get_addr_call): Correct comment.
147         (is_branch_reloc): Add PLTCALL.
148         (is_plt_seq_reloc): New function.
149         (ppc64_elf_check_relocs): Handle PLT16_LO_DS reloc.  Set
150         has_tls_reloc for R_PPC64_TLSGD and R_PPC64_TLSLD.  Create plt
151         entry for R_PPC64_PLTCALL.
152         (ppc64_elf_tls_optimize): Handle inline plt call sequence.
153         (ppc_type_of_stub): Handle PLTCALL reloc.
154         (toc_adjusting_stub_needed): Likewise.
155         (ppc64_elf_relocate_section): Set "can_plt_call" for PLTCALL
156         reloc insn.  Nop out inline plt call sequence when resolving
157         locally.  Handle __tls_get_addr inline plt call optimization.
158
159 2018-04-09  Alan Modra  <amodra@gmail.com>
160
161         * elf64-ppc.c (LOCAL_PLT_ENTRY_SIZE): Define.
162         (struct ppc_stub_hash_entry): Add symtype field.
163         (PLT_KEEP): Define.
164         (struct ppc_link_hash_table): Add pltlocal and relpltlocal.
165         (create_linkage_sections): Create pltlocal and relpltlocal.
166         (ppc64_elf_check_relocs): Allow PLT relocs on local symbols.
167         Set PLT_KEEP.
168         (ppc64_elf_adjust_dynamic_symbol): Keep PLT entries for inline calls.
169         (allocate_dynrelocs): Allocate pltlocal and relpltlocal.
170         (ppc64_elf_size_dynamic_sections): Size pltlocal and relpltlocal.
171         Keep PLT entries for inline calls against locals.
172         (ppc_build_one_stub): Use pltlocal as appropriate.
173         (ppc_size_one_stub): Likewise.
174         (ppc64_elf_size_stubs): Set symtype.
175         (build_global_entry_stubs_and_plt): Init pltlocal and write
176         relpltlocal for globals.
177         (write_plt_relocs_for_local_syms): Likewise for local syms.
178         (ppc64_elf_relocate_section): Support PLT for local syms.
179         * elf32-ppc.c (PLT_KEEP): Define.
180         (struct ppc_elf_link_hash_table): Add pltlocal and relpltlocal.
181         (ppc_elf_create_glink): Create pltlocal and relpltlocal.
182         (ppc_elf_check_relocs): Allow PLT relocs on local symbols.
183         Set PLT_KEEP.  Adjust update_local_sym_info call.
184         (ppc_elf_adjust_dynamic_symbol): Keep PLT entries for inline calls.
185         (allocate_dynrelocs): Allocate pltlocal and relpltlocal.
186         (ppc_elf_size_dynamic_sections): Size pltlocal and relpltlocal.
187         (ppc_elf_relocate_section): Support PLT16 relocs for local syms.
188         (write_global_sym_plt): Init pltlocal and write relpltlocal.
189         (ppc_finish_symbols): Likewise for locals.
190
191 2018-04-09  Alan Modra  <amodra@gmail.com>
192
193         * elf64-ppc.c (ppc_build_one_stub): Move output of PLT relocs
194         for local symbols to..
195         (write_plt_relocs_for_local_syms): ..here.  New function.
196         (ppc64_elf_finish_dynamic_symbol): Move output of PLT relocs for
197         global symbols to..
198         (build_global_entry_stubs_and_plt): ..here.  Rename from
199         build_global_entry_stubs.
200         (ppc64_elf_build_stubs): Always call build_global_entry_stubs_and_plt.
201         Call write_plt_relocs_for_local_syms.
202         * elf32-ppc.c (get_sym_h): New function.
203         (ppc_elf_relax_section): Use get_sym_h.
204         (ppc_elf_relocate_section): Move output of PLT relocs and glink
205         stubs for local symbols to..
206         (ppc_finish_symbols): ..here.  New function.
207         (ppc_elf_finish_dynamic_symbol): Move output of PLT relocs for
208         global syms to..
209         (write_global_sym_plt): ..here.  New function.
210         * elf32-ppc.h (ppc_elf_modify_segment_map): Delete attribute.
211         (ppc_finish_symbols): Declare.
212
213 2018-04-09  Alan Modra  <amodra@gmail.com>
214
215         * elf32-ppc.c (ppc_elf_check_relocs): Handle PLT16 relocs.
216         (ppc_elf_relocate_section): Likewise.
217         * elf64-ppc.c (ppc64_elf_check_relocs): Handle PLT16_LO_DS.
218         (ppc64_elf_relocate_section): Likewise.  Correct PLT16
219         resolution to plt entry relative to toc pointer.
220
221 2018-04-09  Alan Modra  <amodra@gmail.com>
222
223         * elf64-ppc.c (TLS_TLS, TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL,
224         TLS_TPRELGD, TLS_EXPLICIT):  Renumber.  Test TLS_TLS throughout
225         file when other TLS flags are tested in a mask.
226         (TLS_MARK, NON_GOT): Define.
227         (PLT_IFUNC): Redefine, and test TLS_TLS throughout file as well.
228         (update_local_sym_info): Don't create got entry when NON_GOT.
229         (ppc64_elf_check_relocs): Pass NON_GOT with PLT_IFUNC.
230         Set TLS_MARK.
231         (get_tls_mask): Do toc lookup if tls_mask is just TLS_MARK.
232         (ppc64_elf_relocate_section): Likewise.
233         (ppc64_elf_tls_optimize): Don't attempt to optimize indirect
234         __tls_get_addr calls lacking a marker reloc.
235         * elf32-ppc.c (TLS_TLS, TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL,
236         TLS_TPRELGD): Renumber.  Update comment.
237         (TLS_MARK, NON_GOT): Define.
238         (PLT_IFUNC): Redefine, and test TLS_TLS throughout file as well.
239         (update_local_sym_info): Don't create got entry when NON_GOT.
240         (ppc_elf_check_relocs): Pass NON_GOT with PLT_IFUNC.
241         Set TLS_MARK.
242         (ppc_elf_tls_optimize): Don't attempt to optimize indirect
243         __tls_get_addr calls lacking a marker reloc.
244
245 2018-04-06  H.J. Lu  <hongjiu.lu@intel.com>
246
247         * elf64-x86-64.c (elf_x86_64_info_to_howto): Don't mask out
248         R_X86_64_converted_reloc_bit.
249
250 2018-04-05  H.J. Lu  <hongjiu.lu@intel.com>
251
252         PR gas/22318
253         * configure: Regenerated.
254
255 2018-04-05  Alan Modra  <amodra@gmail.com>
256
257         * elf-hppa.h (elf_hppa_info_to_howto): Init howto to NULL.
258         (elf_hppa_info_to_howto_rel): Likewise.
259
260 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
261
262         * elf-hppa.h (elf_hppa_info_to_howto): Also return
263         unsuccessfully for unimplemented relocations.
264         (elf_hppa_info_to_howto_rel): Likewise.
265
266 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
267
268         * elf32-i860.c (lookup_howto): Add `abfd' parameter.  Set the
269         `bfd_error_bad_value' error and call `_bfd_error_handler' on a
270         howto lookup failure.
271         (elf32_i860_reloc_type_lookup): Adjust `lookup_howto' call
272         accordingly.
273         (elf32_i860_info_to_howto_rela): Likewise.
274         (elf32_i860_relocate_splitn): Likewise.
275         (elf32_i860_relocate_pc16): Likewise.
276         (elf32_i860_relocate_pc26): Likewise.
277         (elf32_i860_relocate_section): Likewise.
278
279 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
280
281         * elf32-visium.c (visium_info_to_howto_rela): Correct the range
282         check for `visium_elf_howto_table' table access.
283
284 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
285
286         * elf32-iq2000.c (iq2000_info_to_howto_rela): Correct the range
287         check for `iq2000_elf_howto_table' table access.
288
289 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
290
291         * elf32-frv.c (frv_info_to_howto_rela): Correct the range check
292         for `elf32_frv_howto_table' table access.
293
294 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
295
296         * elf32-mips.c (mips_elf32_rtype_to_howto): Also return
297         unsuccessfully for placeholder howtos.
298         * elf64-mips.c (mips_elf64_rtype_to_howto): Likewise.
299         * elfn32-mips.c (mips_elf_n32_rtype_to_howto): Likewise.
300
301 2018-03-29  Maciej W. Rozycki  <macro@mips.com>
302
303         * elf32-mips.c (mips_info_to_howto_rel): Remove the calls to
304         `_bfd_error_handler' and to set the `bfd_error_bad_value' error.
305
306 2018-03-28  Maciej W. Rozycki  <macro@mips.com>
307
308         * elf-hppa.h (elf_hppa_info_to_howto_rel): Remove
309         ATTRIBUTE_UNUSED from `abfd'.
310
311 2018-03-28  Maciej W. Rozycki  <macro@mips.com>
312
313         * elf-hppa.h (elf_hppa_info_to_howto_rel): Correct
314         `_bfd_error_handler' call formatting.
315
316 2018-03-28  Maciej W. Rozycki  <macro@mips.com>
317
318         * elf32-mips.c (mips_info_to_howto_rel): Call
319         `mips_elf32_rtype_to_howto' directly rather than via
320         `->elf_backend_mips_rtype_to_howto'.
321
322 2018-03-28  Renlin Li  <renlin.li@arm.com>
323
324         PR ld/22970
325         * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Add cases for
326         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
327         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
328         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
329         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
330         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
331         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
332         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
333         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
334         (elfNN_aarch64_final_link_relocate): Support new relocations.
335         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Support new
336         relocations.
337         (_bfd_aarch64_elf_resolve_relocation): Support new relocations.
338
339 2018-03-28  Renlin Li  <renlin.li@arm.com>
340
341         PR ld/22970
342         * reloc.c: Add BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12
343         BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
344         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
345         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
346         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
347         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
348         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
349         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
350         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
351         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
352         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add table entry for
353         TLSLE_LDST16_TPREL_LO12,
354         TLSLE_LDST16_TPREL_LO12_NC,
355         TLSLE_LDST32_TPREL_LO12,
356         TLSLE_LDST32_TPREL_LO12_NC,
357         TLSLE_LDST64_TPREL_LO12,
358         TLSLE_LDST64_TPREL_LO12_NC,
359         TLSLE_LDST8_TPREL_LO12,
360         TLSLE_LDST8_TPREL_LO12_NC.
361         * bfd-in2.h: Regenerated.
362         * libbfd.h: Regenerated.
363
364 2018-03-28  Eric Botcazou  <ebotcazou@adacore.com>
365
366         PR ld/22972
367         * elfxx-sparc.c (struct _bfd_sparc_elf_link_hash_entry): Add new flag
368         has_old_style_got_reloc.
369         (_bfd_sparc_elf_check_relocs) <GOT relocations>: Set it for old-style
370         relocations.  Fix a couple of long lines.
371         (_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: Do not generate
372         a R_SPARC_NONE for the GOT slot if the symbol is also subject to old-style
373         GOT relocations.
374
375 2018-03-25  H.J. Lu  <hongjiu.lu@intel.com>
376
377         PR ld/23000
378         * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Add
379         ENDBR64 to the TLSDESC PLT entry.
380
381 2018-03-21  Alan Modra  <amodra@gmail.com>
382
383         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Trim uninteresting
384         symbols.  Use size_t counts.  Delete redundant opd test.
385
386 2018-03-21  Alan Modra  <amodra@gmail.com>
387
388         * elf32-ppc.c (ppc_elf_tls_optimize): Delete locsyms.
389
390 2018-03-21  Alan Modra  <amodra@gmail.com>
391
392         * elf32-ppc.c (struct ppc_elf_link_hash_entry): Make tls_mask
393         field unsigned.
394         (update_local_sym_info): Likewise for local_got_tls_masks.
395         (ppc_elf_tls_optimize): Likewise for lgot_masks.
396
397 2018-03-21  Alan Modra  <amodra@gmail.com>
398
399         * elf64-ppc.c (ppc_size_one_stub): Fix comment typo.
400         (ppc64_elf_layout_multitoc): Allocate relocs for tprel as we
401         do in size_dynamic_sections.
402
403 2018-03-21  Alan Modra  <amodra@gmail.com>
404
405         * elf64-ppc.c (ppc64_elf_relocate_section): Don't access rel[1]
406         without first checking array bounds.
407         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
408
409 2018-03-20  H.J. Lu  <hongjiu.lu@intel.com>
410
411         PR ld/22983
412         * elflink.c (bfd_elf_link_mark_dynamic_symbol): Set
413         non_ir_ref_dynamic if a symbol is made dynamic by --dynamic-list.
414
415 2018-03-19  Nick Clifton  <nickc@redhat.com>
416
417         * po/es.po: Updated Spanish translation.
418
419 2018-03-15  Max Filippov  <jcmvbkbc@gmail.com>
420
421         * elf32-xtensa.c (xlate_map_entry): Change types of address
422         fields from 'unsigned' to 'bfd_vma'.
423         (xlate_offset_with_removed_text): Use struct xlate_map_entry as
424         the key argument to bsearch. Allow offsets past the end of a
425         section, use the last map entry for translation of such offsets.
426
427 2018-03-15  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
428
429         * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Removed.
430         Not support the target feature.
431         (nds32_elf_ex9_itb_base): Likewise.
432         (nds32_elf_ex9_import_table): Likewise.
433         (nds32_elf_ex9_finish): Likewise.
434         (nds32_elf_ex9_reloc_jmp): Likewise.
435         (nds32_elf_get_insn_with_reg): Likewise.
436         (nds32_get_local_syms): Likewise.
437         (nds32_elf_ex9_replace_instruction): Likewise.
438         (nds32_elf_ifc_calc): Likewise.
439         (nds32_elf_ifc_finish): Likewise.
440         (nds32_elf_ifc_replace): Likewise.
441         (nds32_elf_ifc_reloc): Likewise.
442
443 2018-03-14  Alan Modra  <amodra@gmail.com>
444
445         * elf64-ppc.c (sfpr_define): Adjust for stub_sec size having
446         sfpr size added before defining alias symbols.
447         (ppc64_elf_build_stubs): Add stub section padding before
448         copying sfpr contents and defining save/restore alias symbols.
449
450 2018-03-14  H.J. Lu  <hongjiu.lu@intel.com>
451
452         PR ld/20882
453         * elflink.c (elf_gc_mark_debug_section): Also check the local
454         debug definition section.
455
456 2018-03-13  Nick Clifton  <nickc@redhat.com>
457
458         PR 22113
459         * pei-x86_64.c (pex64_get_unwind_info): Change to a boolean
460         function.  Add an end address parameter.  Check access of the data
461         pointer to make sure that they do not extend beyond the end
462         address.  Return FALSE if any check fails.  Add the end address
463         pointer to the ui structure.
464         (pex64_xdata_print_uwd_codes): Check accesses of the raw unwind
465         codes to make sure that they do not extend beyond the end address
466         pointer.  Print an error message and return immediately if any
467         check fails.
468
469 2018-03-09  Nick Clifton  <nickc@redhat.com>
470
471         * elf64-s390.c (elf_s390_relocate_section): Move check for
472         relocations against non-allocated sections to before the code that
473         handles ifunc relocations.
474         * elf32-s390.c (elf_s390_relocate_section): Likewise.
475         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Treat
476         relocs against IFUNC symbols in non-allocated sections as relocs
477         against FUNC symbols.
478         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
479
480 2018-03-08  H.J. Lu  <hongjiu.lu@intel.com>
481
482         PR ld/22929
483         * elf32-i386.c (elf_i386_relocate_section): Treat relocation
484         against IFUNC symbol in SHT_NOTE section without SHF_ALLOC as
485         relocation against FUNC symbol.
486         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
487
488 2018-03-07  Renlin Li  <renlin.li@arm.com>
489
490         PR ld/20402
491         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Check absolute
492         symbol, and don't emit relocation in specific case.
493
494 2018-03-07  Alan Modra  <amodra@gmail.com>
495
496         * elf64-mips.c (mips_elf64_rtype_to_howto): Return NULL on error.
497         (mips_elf64_slurp_one_reloc_table): Pass on error.
498
499 2018-03-03  James Cowgill  <james.cowgill@mips.com>
500             Maciej W. Rozycki  <macro@mips.com>
501
502         PR ld/21900
503         * elfxx-mips.c (mips_elf_calculate_relocation): Only return
504         after calling `undefined_symbol' hook if this is an error
505         condition.  Assume the value of 0 for the symbol requested
506         otherwise.
507
508 2018-03-02  Jim Wilson  <jimw@sifive.com>
509
510         PR 22903
511         * elfnn-aarch64.c (_bfd_aarch64_resize_stubs): Add 8 bytes for branch
512         and nop instead of 4.
513         (elfNN_arch64_build_stubs): Add nop after branch.  Increase size by
514         8 instead of 4.
515
516 2018-03-01  Jim Wilson  <jimw@sifive.com>
517
518         PR 22756
519         * elfnn-riscv.c (riscv_relax_delete_bytes): When adjust st_size, use
520         else if instead of if.
521
522 2018-03-01  Alan Modra  <amodra@gmail.com>
523
524         * elf32-ft32.c (ft32_info_to_howto_rela): Correct range test.
525
526 2018-02-28  Alan Modra  <amodra@gmail.com>
527
528         PR 22887
529         * aoutx.h (swap_std_reloc_in): Correct r_index bound check.
530
531 2018-02-28  Nick Clifton  <nickc@redhat.com>
532
533         PR 22895
534         PR 22893
535         * dwarf2.c (read_n_bytes): Replace size parameter with dwarf_block
536         pointer.  Drop unused abfd parameter.  Check the size of the block
537         before initialising the data field.  Return the end pointer if the
538         size is invalid.
539         (read_attribute_value): Adjust invocations of read_n_bytes.
540
541         PR 22894
542         * dwarf1.c (parse_die): Check the length of form blocks before
543         advancing the data pointer.
544
545 2018-02-28  Alan Modra  <amodra@gmail.com>
546
547         PR 22887
548         * aoutx.h (translate_symbol_table): Print an error message and set
549         bfd_error on finding an invalid name string offset.
550
551 2018-02-27  H.J. Lu  <hongjiu.lu@intel.com>
552
553         * config.in: Regenerated.
554         * configure: Likewise.
555         * configure.ac: Add --enable-separate-code.
556         (DEFAULT_LD_Z_SEPARATE_CODE): New AC_DEFINE_UNQUOTED.  Default
557         to 1 for Linux/x86 targets,
558         * elf64-x86-64.c (ELF_MAXPAGESIZE): Set to 0x1000 if
559         DEFAULT_LD_Z_SEPARATE_CODE is 1.
560
561 2018-02-27  Nick Clifton  <nickc@redhat.com>
562
563         * aout-cris.c (swap_ext_reloc_out): Standadize error/warning
564         message.
565         * elf-hppa.h (elf_hppa_info_to_howto_rel): Likewise.
566         * elf32-i386.c (elf_i386_reloc_type_lookup): Likewise.
567         * elf32-xtensa.c (elf_xtensa_reloc_type_lookup): Likewise.
568         * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Likewise.
569         * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise.
570         * elf64-sh64.c (sh_elf64_info_to_howto): Likewise.
571         * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise.
572         * elfxx-sparc.c (_bfd_sparc_elf_reloc_type_lookup): Likewise.
573         * elfxx-tilegx.c (tilegx_reloc_type_lookup): Likewise.
574
575         PR 22875
576         * elf-bfd.h (struct elf_backend_data): Change the return type of
577         the elf_info_to_howto and elf_info_to_howto_rel function pointers
578         to bfd_boolean.
579         * elfcode.h (elf_slurp_reloc_table_from_section): Check the return
580         value from the info_to_howto function and fail if that function
581         failed.
582         * elf32-h8300.c (elf32_h8_relocate_section): Check return value
583         from the info_to_howto function.
584         (elf32_h8_relax_section): Likewise.
585         * elf32-lm32.c (lm32_elf_relocate_section): Likewise.
586         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
587         * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
588         * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
589         * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
590         * elf64-ia64-vms.c (elf64_ia64_relocate_section): Likewise.
591         * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
592         * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
593         * elfnn-ia64.c (elfNN_ia64_relocate_section): Likewise.
594         * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
595         (riscv_elf_relocate_section): Likewise.
596         * elf-hppa.h (elf_hppa_info_to_howto): Change return type to
597         bfd_boolean.  Issue an error message, set an error value and
598         return FALSE if the reloc is not recognized.
599         (elf_hppa_info_to_howto_rel): Likewise.
600         * elf-m10200.c (mn10200_info_to_howto): Likewise.
601         * elf-m10300.c (mn10300_info_to_howto): Likewise.
602         * elf.c (_bfd_elf_no_info_to_howto): Likewise.
603         * elf32-arc.c (arc_info_to_howto_rel): Likewise.
604         * elf32-arm.c (elf32_arm_info_to_howto): Likewise.
605         * elf32-avr.c (avr_info_to_howto_rela): Likewise.
606         * elf32-bfin.c (bfin_info_to_howto): Likewise.
607         * elf32-cr16.c (elf_cr16_info_to_howto): Likewise.
608         * elf32-cr16c.c (elf_cr16c_info_to_howto): Likewise.
609         * elf32-cris.c (elf_cr16c_info_to_howto_rel)
610         (cris_info_to_howto_rela): Likewise.
611         * elf32-crx.c (elf_crx_info_to_howto): Likewise.
612         * elf32-d10v.c (d10v_info_to_howto_rel): Likewise.
613         * elf32-d30v.c (d30v_info_to_howto_rel, d30v_info_to_howto_rela):
614         Likewise.
615         * elf32-dlx.c (dlx_rtype_to_howto, elf32_dlx_info_to_howto)
616         (elf32_dlx_info_to_howto_rel): Likewise.
617         * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise.
618         * elf32-fr30.c (fr30_info_to_howto_rela): Likewise.
619         * elf32-frv.c (frv_info_to_howto_rela)
620         (frvfdpic_info_to_howto_rel): Likewise.
621         * elf32-ft32.c (ft32_info_to_howto_rela): Likewise.
622         * elf32-gen.c (elf_generic_info_to_howto)
623         (elf_generic_info_to_howto_rel): Likewise.
624         * elf32-h8300.c (elf32_h8_info_to_howto)
625         (elf32_h8_info_to_howto_rel): Likewise.
626         * elf32-i370.c (i370_elf_info_to_howto): Likewise.
627         * elf32-i386.c (elf_i386_reloc_type_lookup)
628         (elf_i386_rtype_to_howto, elf_i386_info_to_howto_rel): Likewise.
629         * elf32-i860.c (lookup_howto, elf32_i860_info_to_howto_rela):
630         Likewise.
631         * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise.
632         * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise.
633         * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise.
634         * elf32-lm32.c (lm32_info_to_howto_rela): Likewise.
635         * elf32-m32c.c (m32c_info_to_howto_rela): Likewise.
636         * elf32-m32r.c (m32r_info_to_howto_rel, m32r_info_to_howto):
637         Likewise.
638         * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise.
639         * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise.
640         * elf32-m68k.c (rtype_to_howto): Likewise.
641         * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
642         * elf32-mep.c (mep_info_to_howto_rela): Likewise.
643         * elf32-metag.c (metag_info_to_howto_rela): Likewise.
644         * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
645         * elf32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela):
646         Likewise.
647         * elf32-moxie.c (moxie_info_to_howto_rela): Likewise.
648         * elf32-msp430.c (msp430_info_to_howto_rela): Likewise.
649         * elf32-mt.c (mt_info_to_howto_rela): Likewise.
650         * elf32-nds32.c (nds32_info_to_howto_rel, nds32_info_to_howto):
651         Likewise.
652         * elf32-nios2.c (nios2_elf32_info_to_howto): Likewise.
653         * elf32-or1k.c (or1k_info_to_howto_rela): Likewise.
654         * elf32-pj.c (pj_elf_info_to_howto): Likewise.
655         * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
656         * elf32-pru.c (pru_elf32_info_to_howto): Likewise.
657         * elf32-rl78.c (rl78_info_to_howto_rela): Likewise.
658         * elf32-rx.c (rx_info_to_howto_rela): Likewise.
659         * elf32-s390.c (elf_s390_info_to_howto): Likewise.
660         * elf32-score.c (s3_bfd_score_info_to_howto)
661         (_bfd_score_info_to_howto): Likewise.
662         * elf32-score7.c (s7_bfd_score_info_to_howto): Likewise.
663         * elf32-sh.c (sh_elf_info_to_howto): Likewise.
664         * elf32-spu.c (spu_elf_info_to_howto): Likewise.
665         * elf32-tic6x.c (elf32_tic6x_info_to_howto)
666         (elf32_tic6x_info_to_howto_rel): Likewise.
667         * elf32-tilepro.c (tilepro_info_to_howto_rela): Likewise.
668         * elf32-v850.c (v850_elf_info_to_howto_rel)
669         (v850_elf_info_to_howto_rela, v800_elf_info_to_howto): Likewise.
670         * elf32-vax.c (rtype_to_howto): Likewise.
671         * elf32-visium.c (visium_info_to_howto_rela): Likewise.
672         * elf32-wasm32.c (elf32_wasm32_rtype_to_howto)
673         (elf32_wasm32_info_to_howto_rela): Likewise.
674         * elf32-xc16x.c (elf32_xc16x_info_to_howto): Likewise.
675         * elf32-xgate.c (xgate_info_to_howto_rel): Likewise.
676         * elf32-xstormy16.c (xstormy16_info_to_howto_rela): Likewise.
677         * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise.
678         * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
679         * elf64-gen.c (elf_generic_info_to_howto)
680         (elf_generic_info_to_howto_rel): Likewise.
681         * elf64-ia64-vms.c (elf64_ia64_info_to_howto): Likewise.
682         * elf64-mips.c (mips_elf64_info_to_howto_rela): Likewise.
683         * elf64-mmix.c (mmix_info_to_howto_rela): Likewise.
684         * elf64-ppc.c (ppc64_elf_info_to_howto): Likewise.
685         * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise.
686         * elf64-sh64.c (elf_s390_info_to_howto, sh_elf64_info_to_howto):
687         Likewise.
688         * elf64-x86-64.c (elf_x86_64_info_to_howto): Likewise.
689         * elfn32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela):
690         Likewise.
691         * elfnn-aarch64.c (elfNN_aarch64_info_to_howto): Likewise.
692         * elfnn-ia64.c (elfNN_ia64_info_to_howto): Likewise.
693         * elfnn-riscv.c (riscv_info_to_howto_rela): Likewise.
694         * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise.
695         * elfxx-sparc.c (_bfd_sparc_elf_info_to_howto): Likewise.
696         * elfxx-tilegx.c (tilegx_info_to_howto_rela): Likewise.
697         * elf32-score.h (s7_bfd_score_info_to_howto): Update prototype.
698         * elfxx-sparc.h (_bfd_sparc_elf_info_to_howto): Update prototype.
699         * elfxx-tilegx.h (tilegx_info_to_howto_rela): Update prototype.
700         * elfxx-target.h (elf_info_to_howto, elf_info_to_howto_rel):
701         Default to NULL.
702
703 2018-02-26  Jim Wilson  <jimw@sifive.com>
704             Stephan Schreiber <info@fs-driver.org>
705
706         PR 15904
707         * elfnn-ia64.c (elfNN_ia64_relax_section): After ia64_elf_relax_brl
708         call, set changed_contents and changed_relocs.  Likewise after
709         successful ia64_elf_relax_br call.
710
711 2018-02-26  Alan Modra  <amodra@gmail.com>
712
713         * elf.c (assign_file_positions_except_relocs): Don't segfault
714         when actual number of phdrs is less than allocated.  Delete
715         outdated comment.  Formatting.
716
717 2018-02-26  Alan Modra  <amodra@gmail.com>
718
719         * elf-m10300.c, * elf-s390-common.c, * elf32-arc.c, * elf32-cris.c,
720         * elf32-dlx.c, * elf32-frv.c, * elf32-i370.c, * elf32-lm32.c,
721         * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c,
722         * elf32-microblaze.c, * elf32-msp430.c, * elf32-nds32.c,
723         * elf32-nios2.c, * elf32-or1k.c, * elf32-rl78.c, * elf32-rx.c,
724         * elf32-score.c, * elf32-score7.c, * elf32-sh-symbian.c,
725         * elf32-sh.c, * elf32-spu.c, * elf32-v850.c, * elf32-xtensa.c,
726         * elf64-alpha.c, * elf64-ia64-vms.c, * elf64-mmix.c,
727         * elf64-sh64.c, * elf64-sparc.c, * elfnn-ia64.c, * elfxx-tilegx.c,
728         * mmo.c, * osf-core.c, * srec.c, * vms-alpha.c: Standardize
729         error/warning messages.
730
731 2018-02-26  Alan Modra  <amodra@gmail.com>
732
733         * archive.c, * bfd.c, * linker.c, * reloc.c, * stabs.c,
734         * syms.c: Standardize error/warning messages.
735
736 2018-02-26  Alan Modra  <amodra@gmail.com>
737
738         * aout-adobe.c, * aout-cris.c, * i386linux.c, * m68klinux.c,
739         * sparclinux.c, * coff-alpha.c, * coff-arm.c, * coff-mcore.c,
740         * coffcode.h, * coffgen.c, * cofflink.c, * ecoff.c, * pe-mips.c,
741         * peXXigen.c, * peicode.h: Standardize error/warning messages.
742
743 2018-02-26  Alan Modra  <amodra@gmail.com>
744
745         * elf32-arm.c, * elfnn-aarch64.c: Standardize error/warning messages.
746
747 2018-02-26  Alan Modra  <amodra@gmail.com>
748
749         * elfxx-mips.c: Standardize error/warning messages.
750
751 2018-02-26  Alan Modra  <amodra@gmail.com>
752
753         * dwarf2.c, * elf-attrs.c, * elf-eh-frame.c, * elf.c, * elf32-gen.c,
754         * elflink.c: Standardize error/warning messages.  Replace use of
755         linker callback einfo with _bfd_error_handler when possible.
756
757 2018-02-26  Alan Modra  <amodra@gmail.com>
758
759         * aoutx.h, * coff-alpha.c, * coff-i860.c, * coff-m68k.c,
760         * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
761         * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-w65.c,
762         * elf-bfd.h, * elf-m10300.c, * elf.c, * elf32-avr.c, * elf32-bfin.c,
763         * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c,
764         * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c,
765         * elf32-fr30.c, * elf32-frv.c, * elf32-i370.c, * elf32-i386.c,
766         * elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c,
767         * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c,
768         * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c,
769         * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c,
770         * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-or1k.c,
771         * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-rx.c,
772         * elf32-s390.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
773         * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c,
774         * elf32-xgate.c, * elf32-xtensa.c, * elf64-alpha.c,
775         * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
776         * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
777         * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
778         * elfnn-riscv.c, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-riscv.h,
779         * elfxx-sparc.c, * elfxx-sparc.h, * reloc.c: Standardize
780         unrecognized/unsupported reloc message.
781
782 2018-02-26  Alan Modra  <amodra@gmail.com>
783
784         * elf32-ppc.c: Standardize error/warning messages.  Use
785         _bfd_error_handler rather than einfo when einfo features not used.
786         * elf64-ppc.c: Likewise.
787
788 2018-02-23  Alan Modra  <amodra@gmail.com>
789
790         PR 22881
791         * elf.c (assign_file_positions_for_non_load_sections): Remove RELRO
792         segment if no matching LOAD segment.
793
794 2018-02-23  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
795
796         * elf32-nds32.h: Define mask for ict_model.
797
798 2018-02-20  Jason Duerstock  <jason.duerstock@gmail.com>
799
800         * elfnn-ia64.c (elf_backend_can_gc_sections): Enable.
801
802 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
803
804         Revert
805         2018-01-12  Vlad Ivanov  <vlad@ivanov.email>
806
807         * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when
808         .reginfo section has wrong size.
809
810 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
811
812         * elfxx-mips.c (_bfd_mips_elf_always_size_sections): Set
813         SEC_FIXED_SIZE and SEC_HAS_CONTENTS flags for `.reginfo' and
814         `.MIPS.abiflags' sections.
815         (_bfd_mips_elf_final_link): Avoid reading beyond `.reginfo'
816         section's end.
817
818 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
819
820         * section.c (SEC_FIXED_SIZE): New macro.
821         * bfd-in2.h: Regenerate.
822
823 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
824
825         * section.c (SEC_HAS_GOT_REF): Remove macro.
826         * bfd-in2.h: Regenerate.
827
828 2018-02-19  Alan Modra  <amodra@gmail.com>
829
830         * elf-attrs.c (_bfd_elf_parse_attributes): Correct _bfd_error_handler
831         arguments.
832         * elfxx-mips.c (_bfd_mips_elf_final_link): Likewise.
833         * elfnn-riscv.c (_bfd_riscv_relax_align): Likewise.
834         (_bfd_riscv_relax_pc): Likewise and fix typos.
835         * libbfd-in.h (_bfd_error_handler): Add attribute printf.
836         * libbfd.h: Regenerate.
837
838 2018-02-19  Alan Modra  <amodra@gmail.com>
839
840         * dwarf2.c (read_section): Don't use 'll' format modifier.
841         (find_abstract_instance): Likewise.
842         * elfcore.h (elf_core_file_p): Likewise.
843
844 2018-02-19  Alan Modra  <amodra@gmail.com>
845
846         * bfd-in.h: Include inttypes.h or if not available define
847         PRId64, PRIu64 and PRIx64.
848         * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Remove support for L
849         modifier to print bfd_vma.
850         * coff-arm.c, * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c,
851         * coff-sh.c, * coff-tic80.c, * coffcode.h, * coffgen.c, * cofflink.c,
852         * compress.c, * dwarf2.c, * elf-m10300.c, * elf.c, * elf32-arc.c,
853         * elf32-arm.c, * elf32-bfin.c, * elf32-cris.c, * elf32-hppa.c,
854         * elf32-i386.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32r.c,
855         * elf32-m68k.c, * elf32-metag.c, * elf32-nds32.c, * elf32-nios2.c,
856         * elf32-ppc.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c,
857         * elf32-score7.c, * elf32-sh.c, * elf32-sh64.c, * elf32-spu.c,
858         * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c,
859         * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c,
860         * elf64-mmix.c, * elf64-s390.c, * elf64-sh64.c, * elf64-x86-64.c,
861         * elfcode.h, * elfcore.h, * elflink.c, * elfnn-aarch64.c,
862         * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c, * elfxx-sparc.c,
863         * elfxx-tilegx.c, * ieee.c, * ihex.c, * mach-o.c, * merge.c, * mmo.c,
864         * peXXigen.c, * xcofflink.c: Replace use of Lx modifier with PRIx64,
865         and cast input to uint64_t, and similarly for Ld and Lu.
866         * bfd-in2.h: Regenerate.
867
868 2018-02-19  Alan Modra  <amodra@gmail.com>
869
870         * elf32-arm.c, * elf32-hppa.c, * elf32-lm32.c, * elf32-m32r.c,
871         * elf32-metag.c, * elf32-nds32.c, * elf32-or1k.c, * elf32-ppc.c,
872         * elf32-s390.c, * elf32-sh.c, * elf32-tic6x.c, * elf32-tilepro.c,
873         * elf64-ppc.c, * elf64-s390.c, * elflink.c, * elfnn-aarch64.c,
874         * elfnn-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c,
875         * reloc.c: Replace use of %R and %T in format strings passed to
876         einfo and friends by %pR and %pT.
877
878 2018-02-19  Alan Modra  <amodra@gmail.com>
879
880         * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Handle %pA and %pB in place
881         of %A and %B.
882         * aout-adobe.c: Update all messages using %A and %B.
883         * aout-cris.c: Likewise.
884         * aoutx.h: Likewise.
885         * archive.c: Likewise.
886         * binary.c: Likewise.
887         * cache.c: Likewise.
888         * coff-alpha.c: Likewise.
889         * coff-arm.c: Likewise.
890         * coff-i860.c: Likewise.
891         * coff-mcore.c: Likewise.
892         * coff-ppc.c: Likewise.
893         * coff-rs6000.c: Likewise.
894         * coff-sh.c: Likewise.
895         * coff-tic4x.c: Likewise.
896         * coff-tic54x.c: Likewise.
897         * coff-tic80.c: Likewise.
898         * coff64-rs6000.c: Likewise.
899         * coffcode.h: Likewise.
900         * coffgen.c: Likewise.
901         * cofflink.c: Likewise.
902         * coffswap.h: Likewise.
903         * compress.c: Likewise.
904         * cpu-arm.c: Likewise.
905         * ecoff.c: Likewise.
906         * elf-attrs.c: Likewise.
907         * elf-eh-frame.c: Likewise.
908         * elf-ifunc.c: Likewise.
909         * elf-m10300.c: Likewise.
910         * elf-properties.c: Likewise.
911         * elf-s390-common.c: Likewise.
912         * elf.c: Likewise.
913         * elf32-arc.c: Likewise.
914         * elf32-arm.c: Likewise.
915         * elf32-avr.c: Likewise.
916         * elf32-bfin.c: Likewise.
917         * elf32-cr16.c: Likewise.
918         * elf32-cr16c.c: Likewise.
919         * elf32-cris.c: Likewise.
920         * elf32-crx.c: Likewise.
921         * elf32-d10v.c: Likewise.
922         * elf32-d30v.c: Likewise.
923         * elf32-epiphany.c: Likewise.
924         * elf32-fr30.c: Likewise.
925         * elf32-frv.c: Likewise.
926         * elf32-gen.c: Likewise.
927         * elf32-hppa.c: Likewise.
928         * elf32-i370.c: Likewise.
929         * elf32-i386.c: Likewise.
930         * elf32-i960.c: Likewise.
931         * elf32-ip2k.c: Likewise.
932         * elf32-iq2000.c: Likewise.
933         * elf32-lm32.c: Likewise.
934         * elf32-m32c.c: Likewise.
935         * elf32-m32r.c: Likewise.
936         * elf32-m68hc11.c: Likewise.
937         * elf32-m68hc12.c: Likewise.
938         * elf32-m68hc1x.c: Likewise.
939         * elf32-m68k.c: Likewise.
940         * elf32-mcore.c: Likewise.
941         * elf32-mep.c: Likewise.
942         * elf32-metag.c: Likewise.
943         * elf32-microblaze.c: Likewise.
944         * elf32-moxie.c: Likewise.
945         * elf32-msp430.c: Likewise.
946         * elf32-mt.c: Likewise.
947         * elf32-nds32.c: Likewise.
948         * elf32-nios2.c: Likewise.
949         * elf32-or1k.c: Likewise.
950         * elf32-pj.c: Likewise.
951         * elf32-ppc.c: Likewise.
952         * elf32-rl78.c: Likewise.
953         * elf32-rx.c: Likewise.
954         * elf32-s390.c: Likewise.
955         * elf32-score.c: Likewise.
956         * elf32-score7.c: Likewise.
957         * elf32-sh-symbian.c: Likewise.
958         * elf32-sh.c: Likewise.
959         * elf32-sh64.c: Likewise.
960         * elf32-sparc.c: Likewise.
961         * elf32-spu.c: Likewise.
962         * elf32-tic6x.c: Likewise.
963         * elf32-tilepro.c: Likewise.
964         * elf32-v850.c: Likewise.
965         * elf32-vax.c: Likewise.
966         * elf32-visium.c: Likewise.
967         * elf32-wasm32.c: Likewise.
968         * elf32-xgate.c: Likewise.
969         * elf32-xtensa.c: Likewise.
970         * elf64-alpha.c: Likewise.
971         * elf64-gen.c: Likewise.
972         * elf64-hppa.c: Likewise.
973         * elf64-ia64-vms.c: Likewise.
974         * elf64-mmix.c: Likewise.
975         * elf64-ppc.c: Likewise.
976         * elf64-s390.c: Likewise.
977         * elf64-sh64.c: Likewise.
978         * elf64-sparc.c: Likewise.
979         * elf64-x86-64.c: Likewise.
980         * elfcode.h: Likewise.
981         * elfcore.h: Likewise.
982         * elflink.c: Likewise.
983         * elfnn-aarch64.c: Likewise.
984         * elfnn-ia64.c: Likewise.
985         * elfnn-riscv.c: Likewise.
986         * elfxx-mips.c: Likewise.
987         * elfxx-sparc.c: Likewise.
988         * elfxx-tilegx.c: Likewise.
989         * elfxx-x86.c: Likewise.
990         * hpux-core.c: Likewise.
991         * ieee.c: Likewise.
992         * ihex.c: Likewise.
993         * libbfd.c: Likewise.
994         * linker.c: Likewise.
995         * mach-o.c: Likewise.
996         * merge.c: Likewise.
997         * mmo.c: Likewise.
998         * oasys.c: Likewise.
999         * pdp11.c: Likewise.
1000         * pe-mips.c: Likewise.
1001         * peXXigen.c: Likewise.
1002         * peicode.h: Likewise.
1003         * reloc.c: Likewise.
1004         * rs6000-core.c: Likewise.
1005         * srec.c: Likewise.
1006         * stabs.c: Likewise.
1007         * vms-alpha.c: Likewise.
1008         * xcofflink.c: Likewise.
1009
1010 2018-02-19  Alan Modra  <amodra@gmail.com>
1011
1012         PR 22845
1013         * elf.c (IS_TBSS): Define.
1014         (_bfd_elf_map_sections_to_segments): Use IS_TBSS.
1015         (assign_file_positions_for_non_load_sections): Revert last change.
1016         Properly calculate load segment limits to compare against relro limits.
1017
1018 2018-02-17  Alan Modra  <amodra@gmail.com>
1019
1020         PR 22845
1021         * elf.c (assign_file_positions_for_non_load_sections): Ignore
1022         degenerate zero size PT_LOAD segments when finding one overlapping
1023         the PT_GNU_RELRO segment.
1024
1025 2018-02-16  Alan Modra  <amodra@gmail.com>
1026
1027         * libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false.
1028         (_bfd_bool_bfd_true): Rename from bfd_true.
1029         (_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr.
1030         (_bfd_int_bfd_0): Rename from bfd_0.
1031         (_bfd_uint_bfd_0): Rename from bfd_0u.
1032         (_bfd_long_bfd_0): Rename from bfd_0l.
1033         (_bfd_long_bfd_n1_error): Rename from _bfd_n1.
1034         (_bfd_void_bfd): Rename from bfd_void.
1035         (_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false),
1036         (_bfd_bool_bfd_link_false_error),
1037         (_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true),
1038         (_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true),
1039         (_bfd_bool_bfd_asection_bfd_asection_true),
1040         (_bfd_bool_bfd_asymbol_bfd_asymbol_true),
1041         (_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions.
1042         * archive.c (_bfd_noarchive_get_elt_at_index),
1043         (_bfd_noarchive_openr_next_archived_file),
1044         (_bfd_noarchive_construct_extended_name_table),
1045         (_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname),
1046         (_bfd_noarchive_write_armap): New functions.
1047         * archures.c (_bfd_nowrite_set_arch_mach): New function.
1048         * coff-alpha.c (alpha_ecoff_swap_coff_aux_in),
1049         (alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in),
1050         (alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out),
1051         (alpha_ecoff_swap_coff_lineno_out),
1052         (alpha_ecoff_swap_coff_reloc_out): New functions.
1053         * coff-mips.c (mips_ecoff_swap_coff_aux_in),
1054         (mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in),
1055         (mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out),
1056         (mips_ecoff_swap_coff_lineno_out),
1057         (mips_ecoff_swap_coff_reloc_out): New functions.
1058         * coffcode.h (coff_set_alignment_hook): Replace define with
1059         new function.
1060         (symname_in_debug_hook): Likewise.
1061         * ecoff.c (_bfd_ecoff_set_alignment_hook): New function.
1062         * elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0.
1063         * elf.c (assign_file_positions_except_relocs): Test
1064         elf_backend_allow_non_load_phdr for NULL.
1065         * elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from
1066         _bfd_elf_link_omit_section_dynsym.  Update uses.
1067         (_bfd_elf_omit_section_dynsym_all): New function.
1068         * elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete.
1069         (_bfd_elf_omit_section_dynsym_default): Declare.
1070         (_bfd_elf_omit_section_dynsym_all): Declare.
1071         * linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section),
1072         (_bfd_nolink_bfd_get_relocated_section_contents),
1073         (_bfd_nolink_bfd_lookup_section_flags),
1074         (_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group),
1075         (_bfd_nolink_bfd_link_hash_table_create),
1076         (_bfd_nolink_bfd_link_just_syms),
1077         (_bfd_nolink_bfd_copy_link_hash_symbol_type),
1078         (_bfd_nolink_bfd_link_split_section),
1079         (_bfd_nolink_section_already_linked),
1080         (_bfd_nolink_bfd_define_common_symbol),
1081         (_bfd_nolink_bfd_define_start_stop): New functions.
1082         * reloc.c (_bfd_norelocs_bfd_reloc_type_lookup),
1083         (_bfd_norelocs_bfd_reloc_name_lookup),
1084         (_bfd_nodynamic_canonicalize_dynamic_reloc): New functions.
1085         * section.c (_bfd_nowrite_set_section_contents): New function.
1086         * syms.c (_bfd_nosymbols_canonicalize_symtab),
1087         (_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info),
1088         (_bfd_nosymbols_get_symbol_version_string),
1089         (_bfd_nosymbols_bfd_is_local_label_name),
1090         (_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line),
1091         (_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info),
1092         (_bfd_nosymbols_bfd_make_debug_symbol),
1093         ( _bfd_nosymbols_read_minisymbols),
1094         ( _bfd_nosymbols_minisymbol_to_symbol),
1095         (_bfd_nodynamic_get_synthetic_symtab): New functions.
1096         * libbfd-in.h: Declare new functions.  Update existing defines,
1097         removing casts.
1098         * aix386-core.c: Update to use new hooks.  Formatting.
1099         * aout-adobe.c: Likewise.
1100         * aout-arm.c: Likewise.
1101         * aout-target.h: Likewise.
1102         * aout-tic30.c: Likewise.
1103         * aoutf1.h: Likewise.
1104         * binary.c: Likewise.
1105         * bout.c: Likewise.
1106         * cisco-core.c: Likewise.
1107         * coff-alpha.c: Likewise.
1108         * coff-i386.c: Likewise.
1109         * coff-i860.c: Likewise.
1110         * coff-i960.c: Likewise.
1111         * coff-ia64.c: Likewise.
1112         * coff-mips.c: Likewise.
1113         * coff-ppc.c: Likewise.
1114         * coff-rs6000.c: Likewise.
1115         * coff-sh.c: Likewise.
1116         * coff-tic30.c: Likewise.
1117         * coff-tic54x.c: Likewise.
1118         * coff-x86_64.c: Likewise.
1119         * coff64-rs6000.c: Likewise.
1120         * coffcode.h: Likewise.
1121         * elf-m10300.c: Likewise.
1122         * elf32-cr16.c: Likewise.
1123         * elf32-lm32.c: Likewise.
1124         * elf32-m32r.c: Likewise.
1125         * elf32-metag.c: Likewise.
1126         * elf32-score.c: Likewise.
1127         * elf32-score7.c: Likewise.
1128         * elf32-tilepro.c: Likewise.
1129         * elf32-xstormy16.c: Likewise.
1130         * elf32-xtensa.c: Likewise.
1131         * elf64-alpha.c: Likewise.
1132         * elf64-hppa.c: Likewise.
1133         * elf64-ia64-vms.c: Likewise.
1134         * elf64-mmix.c: Likewise.
1135         * elf64-sh64.c: Likewise.
1136         * elfnn-ia64.c: Likewise.
1137         * elfxx-sparc.c: Likewise.
1138         * elfxx-target.h: Likewise.
1139         * elfxx-tilegx.c: Likewise.
1140         * elfxx-x86.h: Likewise.
1141         * hp300hpux.c: Likewise.
1142         * hppabsd-core.c: Likewise.
1143         * hpux-core.c: Likewise.
1144         * i386msdos.c: Likewise.
1145         * i386os9k.c: Likewise.
1146         * ieee.c: Likewise.
1147         * ihex.c: Likewise.
1148         * irix-core.c: Likewise.
1149         * libaout.h: Likewise.
1150         * libecoff.h: Likewise.
1151         * mach-o-target.c: Likewise.
1152         * mach-o.c: Likewise.
1153         * mipsbsd.c: Likewise.
1154         * mmo.c: Likewise.
1155         * netbsd-core.c: Likewise.
1156         * nlm-target.h: Likewise.
1157         * oasys.c: Likewise.
1158         * osf-core.c: Likewise.
1159         * pdp11.c: Likewise.
1160         * pe-mips.c: Likewise.
1161         * pe-x86_64.c: Likewise.
1162         * pef.c: Likewise.
1163         * plugin.c: Likewise.
1164         * ppcboot.c: Likewise.
1165         * ptrace-core.c: Likewise.
1166         * sco5-core.c: Likewise.
1167         * som.c: Likewise.
1168         * sparclynx.c: Likewise.
1169         * srec.c: Likewise.
1170         * tekhex.c: Likewise.
1171         * trad-core.c: Likewise.
1172         * verilog.c: Likewise.
1173         * versados.c: Likewise.
1174         * vms-alpha.c: Likewise.
1175         * vms-lib.c: Likewise.
1176         * wasm-module.c: Likewise.
1177         * xsym.c: Likewise.
1178         * libbfd.h: Regenerate.
1179
1180 2018-02-15  Jim Wilson  <jimw@sifive.com>
1181
1182         * elfnn-riscv.c (_bfd_riscv_relax_section): Ifdef out check to ignore
1183         symbols whose section address is zero.
1184
1185         * elfnn-riscv.c (riscv_elf_relocate_section): Use bfd_reloc_dangerous
1186         when pcrel_lo reloc has an addend.  Use reloc_dangerous callback for
1187         bfd_reloc_dangerous.  Use einfo instead of warning callback for errors.
1188         Add %X%P to error messages.
1189
1190 2018-02-15  Eric Botcazou  <ebotcazou@adacore.com>
1191
1192         PR ld/22832
1193         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
1194         Pass FALSE instead of TRUE as 'create' argument to bfd_link_hash_lookup
1195         and assert that the result of the call is not NULL.
1196
1197 2018-02-14  Nick Clifton  <nickc@redhat.com>
1198
1199         PR 22823
1200         Revert previous delta.  Add extra casts to avoid compile time
1201         warnings instead.
1202         * libbfd-in.h (_bfd_generic_bfd_copy_private_bfd_data): Add extra
1203         cast to avoid warning from gcc v8 compiler.
1204         (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
1205         (_bfd_generic_bfd_set_private_flags): Likewise.
1206         (_bfd_generic_bfd_copy_private_section_data): Likewise.
1207         (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
1208         (_bfd_generic_bfd_copy_private_header_data): Likewise.
1209         (_bfd_generic_bfd_print_private_bfd_data): Likewise.
1210         (_bfd_noarchive_construct_extended_name_table): Likewise.
1211         (_bfd_noarchive_truncate_arname): Likewise.
1212         (_bfd_noarchive_write_ar_hdr): Likewise.
1213         (_bfd_noarchive_get_elt_at_index): Likewise.
1214         (_bfd_nosymbols_canonicalize_symtab): Likewise.
1215         (_bfd_nosymbols_print_symbol): Likewise.
1216         (_bfd_nosymbols_get_symbol_info): Likewise.
1217         (_bfd_nosymbols_get_symbol_version_string): Likewise.
1218         (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
1219         (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
1220         (_bfd_nosymbols_get_lineno): Likewise.
1221         (_bfd_nosymbols_find_nearest_line): Likewise.
1222         (_bfd_nosymbols_find_line): Likewise.
1223         (_bfd_nosymbols_find_inliner_info): Likewise.
1224         (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
1225         (_bfd_nosymbols_read_minisymbols): Likewise.
1226         (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
1227         (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
1228         (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
1229         (_bfd_nowrite_set_arch_mach): Likewise.
1230         (_bfd_nowrite_set_section_contents): Likewise.
1231         (_bfd_nolink_sizeof_headers): Likewise.
1232         (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
1233         (_bfd_nolink_bfd_relax_section): Likewise.
1234         (_bfd_nolink_bfd_gc_sections): Likewise.
1235         (_bfd_nolink_bfd_lookup_section_flags): Likewise.
1236         (_bfd_nolink_bfd_merge_sections): Likewise.
1237         (_bfd_nolink_bfd_is_group_section): Likewise.
1238         (_bfd_nolink_bfd_discard_group): Likewise.
1239         (_bfd_nolink_bfd_link_hash_table_create): Likewise.
1240         (_bfd_nolink_bfd_link_add_symbols): Likewise.
1241         (_bfd_nolink_bfd_link_just_syms): Likewise.
1242         (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
1243         (_bfd_nolink_bfd_final_link): Likewise.
1244         (_bfd_nolink_bfd_link_split_section): Likewise.
1245         (_bfd_nolink_section_already_linked): Likewise.
1246         (_bfd_nolink_bfd_define_common_symbol): Likewise.
1247         (_bfd_nolink_bfd_define_start_stop): Likewise.
1248         (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
1249         (_bfd_nodynamic_get_synthetic_symtab): Likewise.
1250         (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
1251         (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
1252         * libbfd.c (bfd_false_any): Delete.
1253         (bfd_true_any, bfd_nullvoidptr_any, bfd_0_any): Delete.
1254         (bfd_0u_any, bfd_0l_any, _bfd_n1_any, bfd_void_any): Delete.
1255         * libbfd.h (extern): Regenerate
1256         * aout-target.h (MY_bfd_is_target_special_symbol): Add extra
1257         cast to avoid warning from gcc v8 compiler.
1258         * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
1259         * binary.c (binary_get_symbol_info): Likewise.
1260         * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
1261         * coff-mips.c (mips_ecoff_backend_data): Likewise.
1262         * coffcode.h (coff_set_alignment_hook): Likewise.
1263         (symname_in_debug_hook): Likewise.
1264         (bfd_coff_backend_data bigobj_swap_table): Likewise.
1265         * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
1266         * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
1267         * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
1268         * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
1269         * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
1270         * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
1271         * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
1272         * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
1273         * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
1274         * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
1275         * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
1276         * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
1277         * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
1278         * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
1279         * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
1280         * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
1281         (bfd_elfNN_bfd_make_debug_symbol): Likewise.
1282         (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
1283         (bfd_elfNN_bfd_set_private_flags): Likewise.
1284         (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
1285         (elf_backend_init_index_section): Likewise.
1286         (elf_backend_allow_non_load_phdr): Likewise.
1287         * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
1288         * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
1289         * ieee.c (ieee_construct_extended_name_table): Likewise.
1290         (ieee_write_armap): Likewise.
1291         (ieee_write_ar_hdr): Likewise.
1292         (ieee_bfd_is_target_special_symbol): Likewise.
1293         * ihex.c (ihex_canonicalize_symtab): Likewise.
1294         (ihex_bfd_is_target_special_symbol): Likewise.
1295         * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
1296         * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
1297         (_bfd_ecoff_set_alignment_hook): Likewise.
1298         * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
1299         * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
1300         * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
1301         * oasys.c (oasys_construct_extended_name_table): Likewise.
1302         (oasys_write_armap): Likewise.
1303         (oasys_write_ar_hdr): Likewise.
1304         (oasys_bfd_is_target_special_symbol): Likewise.
1305         * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
1306         * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
1307         * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
1308         * som.c (som_bfd_is_target_special_symbol): Likewise.
1309         * srec.c (srec_bfd_is_target_special_symbol): Likewise.
1310         * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
1311         * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
1312         * versados.c (versados_bfd_is_target_special_symbol): Likewise.
1313         (versados_bfd_reloc_name_lookup): Likewise.
1314         * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
1315         (vms_bfd_define_start_stop): Likewise.
1316         (alpha_vms_bfd_is_target_special_symbol): Likewise.
1317         * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
1318         * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
1319
1320 2018-02-14  H.J. Lu  <hongjiu.lu@intel.com>
1321
1322         PR ld/22842
1323         * elf32-i386.c (elf_i386_check_relocs): Pass FALSE for non
1324         PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
1325         * elf64-x86-64.c (elf_x86_64_check_relocs): Create PLT for
1326         R_X86_64_PC32 reloc against dynamic function in data section.
1327         Pass TRUE for PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
1328         (elf_x86_64_relocate_section): Use PLT for R_X86_64_PC32 reloc
1329         against dynamic function in data section.
1330         * elfxx-x86.c (elf_x86_allocate_dynrelocs): Use PLT in PIE as
1331         function address only if pcrel_plt is true.
1332         (_bfd_x86_elf_link_hash_table_create): Set pcrel_plt.
1333         * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): Add PCREL_PLT for
1334         PC-relative PLT.  If PLT is PC-relative, don't generate dynamic
1335         PC-relative relocation against a function definition in data
1336         secton in PIE.  Remove the obsolete comments.
1337         (elf_x86_link_hash_table): Add pcrel_plt.
1338
1339 2018-02-13  H.J. Lu  <hongjiu.lu@intel.com>
1340
1341         * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check bfd_link_dll,
1342         instead of bfd_link_pic, for building shared library.
1343
1344 2018-02-13  H.J. Lu  <hongjiu.lu@intel.com>
1345
1346         PR gas/22791
1347         * elf64-x86-64.c (is_32bit_relative_branch): Removed.
1348         (elf_x86_64_relocate_section): Check PIC relocations in PIE.
1349         Remove is_32bit_relative_branch usage.  Disallow PC32 reloc
1350         against protected function in shared object.
1351
1352 2018-02-13  Sergei Trofimovich  <slyfox@inbox.ru>
1353
1354         PR 22828
1355         * po/ru.po: Fix typo in Russian translation.
1356
1357 2018-02-13  Maciej W. Rozycki  <macro@mips.com>
1358
1359         * wasm-module.c (wasm_scan_name_function_section): Rename
1360         `index' local variable to `idx'.
1361
1362 2018-02-13  Nick Clifton  <nickc@redhat.com>
1363
1364         PR 22823
1365         Fix compile time warnings generated by gcc version 8.
1366         * libbfd-in.h: Remove extraneous text from prototypes.
1367         Add prototypes for bfd_false_any, bfd_true_any,
1368         bfd_nullvoidptr_any, bfd_0_any, bfd_0u_any, bfd_0l_any,
1369         bfd_n1_any, bfd_void_any.
1370         (_bfd_generic_bfd_copy_private_bfd_data): Use vararg based dummy
1371         function.
1372         (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
1373         (_bfd_generic_bfd_set_private_flags): Likewise.
1374         (_bfd_generic_bfd_copy_private_section_data): Likewise.
1375         (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
1376         (_bfd_generic_bfd_copy_private_header_data): Likewise.
1377         (_bfd_generic_bfd_print_private_bfd_data): Likewise.
1378         (_bfd_noarchive_construct_extended_name_table): Likewise.
1379         (_bfd_noarchive_truncate_arname): Likewise.
1380         (_bfd_noarchive_write_ar_hdr): Likewise.
1381         (_bfd_noarchive_get_elt_at_index): Likewise.
1382         (_bfd_nosymbols_canonicalize_symtab): Likewise.
1383         (_bfd_nosymbols_print_symbol): Likewise.
1384         (_bfd_nosymbols_get_symbol_info): Likewise.
1385         (_bfd_nosymbols_get_symbol_version_string): Likewise.
1386         (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
1387         (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
1388         (_bfd_nosymbols_get_lineno): Likewise.
1389         (_bfd_nosymbols_find_nearest_line): Likewise.
1390         (_bfd_nosymbols_find_line): Likewise.
1391         (_bfd_nosymbols_find_inliner_info): Likewise.
1392         (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
1393         (_bfd_nosymbols_read_minisymbols): Likewise.
1394         (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
1395         (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
1396         (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
1397         (_bfd_nowrite_set_arch_mach): Likewise.
1398         (_bfd_nowrite_set_section_contents): Likewise.
1399         (_bfd_nolink_sizeof_headers): Likewise.
1400         (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
1401         (_bfd_nolink_bfd_relax_section): Likewise.
1402         (_bfd_nolink_bfd_gc_sections): Likewise.
1403         (_bfd_nolink_bfd_lookup_section_flags): Likewise.
1404         (_bfd_nolink_bfd_merge_sections): Likewise.
1405         (_bfd_nolink_bfd_is_group_section): Likewise.
1406         (_bfd_nolink_bfd_discard_group): Likewise.
1407         (_bfd_nolink_bfd_link_hash_table_create): Likewise.
1408         (_bfd_nolink_bfd_link_add_symbols): Likewise.
1409         (_bfd_nolink_bfd_link_just_syms): Likewise.
1410         (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
1411         (_bfd_nolink_bfd_final_link): Likewise.
1412         (_bfd_nolink_bfd_link_split_section): Likewise.
1413         (_bfd_nolink_section_already_linked): Likewise.
1414         (_bfd_nolink_bfd_define_common_symbol): Likewise.
1415         (_bfd_nolink_bfd_define_start_stop): Likewise.
1416         (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
1417         (_bfd_nodynamic_get_synthetic_symtab): Likewise.
1418         (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
1419         (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
1420         * libbfd.c (bfd_false_any): New function.  Like bfd_false but
1421         accepts one or more arguments.
1422         (bfd_true_any): Likewise.
1423         (bfd_nullvoidptr_any): Likewise.
1424         (bfd_0_any): Likewise.
1425         (bfd_0u_any): Likewise.
1426         (bfd_0l_any): Likewise.
1427         (_bfd_n1_any): Likewise.
1428         (bfd_void_any): Likewise.
1429         * libbfd.h (extern): Regenerate
1430         * aout-target.h (MY_bfd_is_target_special_symbol): Use vararg
1431         based dummy function.
1432         * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
1433         * binary.c (binary_get_symbol_info): Likewise.
1434         * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
1435         * coff-mips.c (mips_ecoff_backend_data): Likewise.
1436         * coffcode.h (coff_set_alignment_hook): Likewise.
1437         (symname_in_debug_hook): Likewise.
1438         (bfd_coff_backend_data bigobj_swap_table): Likewise.
1439         * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
1440         * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
1441         * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
1442         * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
1443         * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
1444         * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
1445         * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
1446         * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
1447         * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
1448         * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
1449         * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
1450         * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
1451         * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
1452         * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
1453         * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
1454         * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
1455         (bfd_elfNN_bfd_make_debug_symbol): Likewise.
1456         (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
1457         (bfd_elfNN_bfd_set_private_flags): Likewise.
1458         (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
1459         (elf_backend_init_index_section): Likewise.
1460         (elf_backend_allow_non_load_phdr): Likewise.
1461         * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
1462         * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
1463         * ieee.c (ieee_construct_extended_name_table): Likewise.
1464         (ieee_write_armap): Likewise.
1465         (ieee_write_ar_hdr): Likewise.
1466         (ieee_bfd_is_target_special_symbol): Likewise.
1467         * ihex.c (ihex_canonicalize_symtab): Likewise.
1468         (ihex_bfd_is_target_special_symbol): Likewise.
1469         * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
1470         * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
1471         (_bfd_ecoff_set_alignment_hook): Likewise.
1472         * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
1473         * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
1474         * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
1475         * oasys.c (oasys_construct_extended_name_table): Likewise.
1476         (oasys_write_armap): Likewise.
1477         (oasys_write_ar_hdr): Likewise.
1478         (oasys_bfd_is_target_special_symbol): Likewise.
1479         * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
1480         * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
1481         * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
1482         * som.c (som_bfd_is_target_special_symbol): Likewise.
1483         * srec.c (srec_bfd_is_target_special_symbol): Likewise.
1484         * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
1485         * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
1486         * versados.c (versados_bfd_is_target_special_symbol): Likewise.
1487         (versados_bfd_reloc_name_lookup): Likewise.
1488         * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
1489         (vms_bfd_define_start_stop): Likewise.
1490         (alpha_vms_bfd_is_target_special_symbol): Likewise.
1491         * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
1492         * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
1493         * elf32-arc.c (get_replace_function): Assign replacement function
1494         to func pointer.
1495         * elf32-i370.c (i370_noop): Update prototype.
1496
1497 2018-02-13  Alan Modra  <amodra@gmail.com>
1498
1499         PR 22836
1500         * elf.c (_bfd_elf_fixup_group_sections): Account for removed
1501         relocation sections.  If size reduces to just the flag word,
1502         remove that too and mark with SEC_EXCLUDE.
1503         * elflink.c (bfd_elf_final_link): Strip empty group sections.
1504
1505 2018-02-13  Alan Modra  <amodra@gmail.com>
1506
1507         PR 22829
1508         * elf.c (assign_file_positions_for_non_load_sections): Rewrite
1509         PT_GNU_RELRO setup.
1510
1511 2018-02-12  Zebediah Figura  <z.figura12@gmail.com>
1512
1513         * i386msdos.c (msdos_mkobject); New function.
1514         (msdos_object_p): New function.
1515         (i386_msdos_vec): Use msdos_object_p as the check_format
1516         function.
1517         * peicode.h: Rename external_PEI_DOS_hdr, DOSMAGIC, and
1518         NT_SIGNATURE to external_DOS_hdr, IMAGE_DOS_SIGNATURE, and
1519         IMAGE_NT_SIGNATURE.
1520         * peXXigen.c: Likewise.
1521         * coff-ia64.c: Likewise.
1522
1523 2018-02-12  Nick Clifton  <nickc@redhat.com>
1524
1525         * elf32-nds32.c (nds32_elf_relax_longjump3): Remove redundant
1526         assignment.
1527         * elf32-arc.c (elf_arc_relocate_section): Likewise.
1528
1529 2018-02-09  Eric Botcazou  <ebotcazou@adacore.com>
1530
1531         * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Reorder conditions.
1532         (sparc_elf_append_rela): Assert that there is enough room in section.
1533         (_bfd_sparc_elf_copy_indirect_symbol): Fix formatting.
1534         (_bfd_sparc_elf_adjust_dynamic_symbol): Minor tweak.
1535         (allocate_dynrelocs): Remove outdated comments and reorder conditions.
1536         For a symbol subject to a GOT relocation, reserve a slot in the
1537         relocation section if the symbol isn't dynamic and we are in PIC mode.
1538         (_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: If relocation
1539         is relaxed and a slot was reserved, generate a R_SPARC_NONE relocation.
1540         <R_SPARC_GOTDATA_OP_HIX22>: Adjust comments.
1541         <R_SPARC_PC10>: Reorder conditions.  Remove always-false assertion.
1542         (_bfd_sparc_elf_finish_dynamic_symbol): Rename local_undefweak into
1543         resolved_to_zero.  Do not generate a dynamic GOT relocation for an
1544         undefined weak symbol with non-default visibility.  Remove superfluous
1545         'else' and fix formatting.
1546
1547 2018-02-09  H.J. Lu  <hongjiu.lu@intel.com>
1548
1549         * elf32-i386.c (elf_i386_get_synthetic_symtab): Also handle
1550         is_solaris.
1551         (i386_elf32_sol2_vec): Don't declare.
1552         (elf_i386_link_setup_gnu_properties): Also handle is_solaris.
1553         Don't set need_global_offset_table.
1554         (elf_i386_solaris_arch_bed): New.
1555         (elf_backend_arch_data): Set to elf_i386_solaris_arch_bed for
1556         Solaris.
1557         * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Check
1558         target_os != is_nacl instead of target_os == is_normal.
1559         (x86_64_elf64_sol2_vec): Don't declare.
1560         (elf_x86_64_link_setup_gnu_properties): Check target_os !=
1561         is_nacl instead of target_os == is_normal.  Don't set
1562         need_global_offset_table.
1563         (elf_x86_64_solaris_arch_bed): New.
1564         (elf_backend_arch_data): Set to elf_x86_64_solaris_arch_bed for
1565         Solaris.
1566         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep
1567         _GLOBAL_OFFSET_TABLE_ for Solaris.
1568         (_bfd_x86_elf_link_setup_gnu_properties): Don't copy
1569         need_global_offset_table.
1570         * elfxx-x86.h (elf_x86_target_os): Add is_solaris.
1571         (elf_x86_link_hash_table): Remove need_global_offset_table.
1572         (elf_x86_init_table): Likewise.
1573
1574 2018-02-08  H.J. Lu  <hongjiu.lu@intel.com>
1575
1576         * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
1577         Remove prototype.
1578         (i386_elf32_sol2_vec): Declared.
1579         (elf_i386_link_setup_gnu_properties): Set
1580         need_global_offset_table with info->output_bfd->xvec.
1581         * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
1582         Remove prototype.
1583         (x86_64_elf64_sol2_vec): Declared.
1584         (elf_x86_64_link_setup_gnu_properties): Set
1585         need_global_offset_table with info->output_bfd->xvec.
1586
1587 2018-02-08  H.J. Lu  <hongjiu.lu@intel.com>
1588
1589         * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
1590         New prototype.
1591         (elf_i386_link_setup_gnu_properties): Set need_global_offset_table
1592         for Solaris.
1593         * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
1594         New prototype.
1595         (elf_x86_64_link_setup_gnu_properties): Set
1596         need_global_offset_table for Solaris.
1597         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep the
1598         unused _GLOBAL_OFFSET_TABLE_ for Solaris.
1599         (_bfd_x86_elf_link_setup_gnu_properties): Copy
1600         need_global_offset_table.
1601         * elfxx-x86.h (elf_x86_link_hash_table): Add
1602         need_global_offset_table.
1603         (elf_x86_init_table): Likewise.
1604
1605 2018-02-08  Jim Wilson  <jimw@sifive.com>
1606
1607         * elfnn-riscv.c (riscv_elf_relocate_section): Add comment for previous
1608         change.
1609
1610 2018-02-08  Nick Clifton  <nickc@redhat.com>
1611
1612         PR 22788
1613         * elf.c (elf_parse_notes): Reject notes with excessuively large
1614         alignments.
1615
1616 2018-02-07  Alan Modra  <amodra@gmail.com>
1617
1618         Revert 2018-01-17  Alan Modra  <amodra@gmail.com>
1619         * elf32-ppc.c: Remove speculation barrier support.
1620         * elf32-ppc.h: Likewise.
1621         * elf64-ppc.c: Likewise.
1622         * elf64-ppc.h: Likewise.
1623
1624 2018-02-06  Jim Wilson  <jimw@sifive.com>
1625
1626         * elfnn-riscv.c (riscv_elf_relocate_section): Return TRUE if used
1627         callback to report an error.
1628
1629 2018-02-06  Eric Botcazou  <ebotcazou@adacore.com>
1630
1631         PR ld/22263
1632         * elfxx-sparc.c (sparc_elf_tls_transition): Turn call to bfd_link_pic
1633         into call to !bfd_link_executable and tidy up.
1634         (_bfd_sparc_elf_check_relocs): Fix formatting and tidy up.
1635         <R_SPARC_TLS_LE_HIX22>: Turn call to bfd_link_pic into call to
1636         !bfd_link_executable.
1637         <R_SPARC_TLS_IE_HI22>: Likewise.
1638         <GOT relocations>: Remove useless code, tidy and merge related blocks.
1639         <R_SPARC_TLS_GD_CALL>: Turn call to bfd_link_pic into call to
1640         !bfd_link_executable.
1641         <R_SPARC_WPLT30>: Tidy up.
1642         (_bfd_sparc_elf_gc_mark_hook): Turn call to bfd_link_pic into call to
1643         !bfd_link_executable.
1644         (allocate_dynrelocs): Likewise.
1645         (_bfd_sparc_elf_relocate_section): Fix formatting and tidy up.
1646         <R_SPARC_TLS_GD_HI22>: Merge into...
1647         <R_SPARC_TLS_GD_LO10>: ...this.  Adjust 4th argument in call to
1648         sparc_elf_tls_transition and remove redundant code.
1649         <R_SPARC_TLS_LDM_HI22>: Turn call to bfd_link_pic into call to
1650         !bfd_link_executable.
1651         <R_SPARC_TLS_LDO_HIX22>: Likewise.
1652         <R_SPARC_TLS_LE_HIX22>: Likewise.  Tidy up.
1653         <R_SPARC_TLS_LDM_CALL>: Likewise.
1654         <R_SPARC_TLS_GD_CALL>: Likewise.  Tidy up.
1655         <R_SPARC_TLS_GD_ADD>: Likewise.
1656         <R_SPARC_TLS_LDM_ADD>: Likewise.
1657         <R_SPARC_TLS_LDO_ADD>: Likewise.
1658         <R_SPARC_TLS_IE_LD>: Likewise.
1659
1660 2018-02-06  MiloÅ¡ Stojanović  <milos.stojanovic@rt-rk.com>
1661
1662         PR 22789
1663         * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): If the dwarf
1664         functions failed to find the function name, try the generic elf
1665         find function instead.
1666
1667 2018-02-06  Sergio Durigan Junior  <sergiodj@redhat.com>
1668
1669         * coff-rs6000.c (xcoff_write_archive_contents_old): Use
1670         'memcpy' instead of 'strncpy' when writing the magic number.
1671
1672 2018-02-06  Nick Clifton  <nickc@redhat.com>
1673
1674         PR 22794
1675         * opncls.c (bfd_get_debug_link_info_1): Check the size of the
1676         section before attempting to read it in.
1677         (bfd_get_alt_debug_link_info): Likewise.
1678
1679 2018-02-06  Paul Carroll  <pcarroll@codesourcery.com>
1680
1681         * bfd/dwarf2.c (find_abstract_name): Modified to return file and
1682         line information in addition to name, if they can be found.
1683
1684 2018-02-05  Renlin Li  <renlin.li@arm.com>
1685
1686         PR ld/22764
1687         * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Relax the
1688         R_AARCH64_ABS32 and R_AARCH64_ABS16 for absolute symbol. Apply the
1689         check for writeable section as well.
1690
1691 2018-02-05  H.J. Lu  <hongjiu.lu@intel.com>
1692
1693         PR ld/22782
1694         * elf32-i386.c (elf_i386_check_relocs): Set got_referenced if
1695         _GLOBAL_OFFSET_TABLE_ is referenced or GOT is needed to resolve
1696         undefined weak symbol to 0.
1697         * elf64-x86-64.c (elf_x86_64_check_relocs): Set got_referenced
1698         if _GLOBAL_OFFSET_TABLE_ is referenced.
1699         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Check
1700         got_referenced instead of ref_regular_nonweak.  Remove the
1701         unused _GLOBAL_OFFSET_TABLE_ from symbol table.
1702         * elfxx-x86.h (elf_x86_link_hash_table): Add got_referenced.
1703
1704 2018-02-05  Maciej W. Rozycki  <macro@mips.com>
1705
1706         * elfnn-riscv.c (_bfd_riscv_relax_pc): Use `memset' to
1707         initialize `hi_reloc'.
1708
1709 2018-02-05  Maciej W. Rozycki  <macro@mips.com>
1710
1711         * elfxx-mips.c (_bfd_mips_elf_section_processing): For
1712         SHT_MIPS_REGINFO sections don't assert the correct size and
1713         report an error instead.
1714
1715 2018-02-05  Maciej W. Rozycki  <macro@mips.com>
1716
1717         * elf.c (_bfd_elf_write_object_contents): Propagate a failure
1718         status from `->elf_backend_section_processing'.
1719
1720 2018-02-02  Jim Wilson  <jimw@sifive.com>
1721
1722         PR ld/22756
1723         * elfnn-riscv.c (riscv_relax_delete_bytes): New parameter link_info.
1724         If link_info->wrap_hash, check for a duplicate symbol and ignore.
1725         (_bfd_riscv_relax_call, bfd_riscv_relax_lui, _bfd_riscv_relax_tls_le):
1726         Pass new argument to riscv_relax_delete_bytes.
1727         (_bfd_riscv_relax_align, _bfd_riscv_relax_delete): Likewise.  Remove
1728         ATTRIBUTE_UNUSED from link_info parameter.
1729
1730 2018-02-02  Alan Modra  <amodra@gmail.com>
1731
1732         * elf64-ppc.c (ppc64_elf_relocate_section): Don't relocate nops
1733         emitted for toc sequence optimization.  Set and use "howto" later.
1734
1735 2018-02-01  Simon Marchi  <simon.marchi@ericsson.com>
1736
1737         * elf64-ppc.c (ppc64_elf_archive_symbol_lookup): Avoid pointer
1738         arithmetic on NULL pointer.
1739         * elflink.c (_bfd_elf_archive_symbol_lookup,
1740         elf_link_add_archive_symbols): Likewise.
1741
1742 2018-01-31  Michael Matz  <matz@suse.de>
1743
1744         * elflink.c (bfd_elf_define_start_stop): Fix check of
1745         def_dynamic.
1746
1747 2018-01-31  H.J. Lu  <hongjiu.lu@intel.com>
1748
1749         PR ld/21964
1750         * elflink.c (bfd_elf_define_start_stop): Check if __start and
1751         __stop symbols are referenced by shared objects.
1752
1753 2018-01-30  Alan Modra  <amodra@gmail.com>
1754
1755         PR 22758
1756         * elf.c (_bfd_elf_map_sections_to_segments): Don't start a new
1757         segment when demand paged with lma on the same page.  Test this
1758         before load/non-load, executable/non-executable,
1759         writable/non-writable tests and simplify.  Delete bogus relro
1760         condition in writable/non-writable test.  Delete outdated
1761         comment.  Formatting.
1762
1763 2018-01-30  Alan Modra  <amodra@gmail.com>
1764
1765         * elflink.c (bfd_elf_define_start_stop): Make __start and __stop
1766         symbols dynamic.
1767
1768 2018-01-29  Alan Modra  <amodra@gmail.com>
1769
1770         PR 22741
1771         * coffgen.c (coff_pointerize_aux): Ensure auxent tagndx is in
1772         range before converting to a symbol table pointer.
1773
1774 2018-01-27  Nick Clifton  <nickc@redhat.com>
1775
1776         * po/ru.po: Updated Russian translation.
1777
1778 2018-01-26  Alan Modra  <amodra@gmail.com>
1779
1780         * elflink.c (bfd_elf_define_start_stop): Override symbols when
1781         they are defined dynamically.
1782
1783 2018-01-26  Alan Modra  <amodra@gmail.com>
1784
1785         * elf64-ppc.c (ppc64_elf_size_stubs): Iterate sizing when
1786         .branch_lt changes size.
1787
1788 2018-01-25  Alan Modra  <amodra@gmail.com>
1789
1790         PR 22746
1791         * elfcode.h (elf_object_p): Avoid integer overflow.
1792
1793 2018-01-25  Eric Botcazou  <ebotcazou@adacore.com>
1794
1795         PR ld/22727
1796         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
1797         Do a mere lookup of the __tls_get_addr symbol instead of adding it.
1798
1799         Revert
1800         2017-10-19  H.J. Lu  <hongjiu.lu@intel.com>
1801
1802         PR ld/22263
1803         * elfxx-sparc.c (sparc_elf_tls_transition): Replace
1804         bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
1805         bfd_link_executable for TLS check.
1806         (_bfd_sparc_elf_check_relocs): Likewise.
1807         (allocate_dynrelocs): Likewise.
1808         (_bfd_sparc_elf_relocate_section): Likewise.
1809
1810 2018-01-24  Renlin Li  <renlin.li@arm.com>
1811
1812         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Add support for
1813         BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
1814         BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
1815         BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
1816         BFD_RELOC_AARCH64_MOVW_PREL_G3.
1817         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1818         (_bfd_aarch64_elf_resolve_relocation): Likewise.
1819
1820 2018-01-24  Renlin Li  <renlin.li@arm.com>
1821
1822         * reloc.c: Add BFD_RELOC_AARCH64_MOVW_PREL_G0,
1823         BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, BFD_RELOC_AARCH64_MOVW_PREL_G1,
1824         BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, BFD_RELOC_AARCH64_MOVW_PREL_G2,
1825         BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, BFD_RELOC_AARCH64_MOVW_PREL_G3.
1826         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add entries for
1827         BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
1828         BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
1829         BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
1830         BFD_RELOC_AARCH64_MOVW_PREL_G3.
1831         * bfd-in2.h: Regenerate.
1832         * libbfd.h: Regenerate.
1833
1834 2018-01-23  Maciej W. Rozycki  <macro@mips.com>
1835
1836         * elfxx-mips.c (_bfd_mips_elf_final_link): Update a stale
1837         `mips_elf32_section_processing' comment reference.
1838
1839 2018-01-20  H.J. Lu  <hongjiu.lu@intel.com>
1840
1841         PR ld/22721
1842         * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Check the
1843         versioned __tls_get_addr symbol.
1844
1845 2018-01-19  Nick Clifton  <nickc@redhat.com>
1846
1847         * po/fr.po: Updated French translation.
1848
1849 2018-01-18  Alan Modra  <amodra@gmail.com>
1850
1851         * elf32-ppc.c (ppc_elf_create_glink): Correct alignment of .glink.
1852         * elf64-ppc.c (ppc64_elf_size_stubs): Handle negative plt_stub_align.
1853         (ppc64_elf_build_stubs): Likewise.
1854
1855 2018-01-17  Nick Clifton  <nickc@redhat.com>
1856
1857         * po/ru.po: Updated Russian translation.
1858         * po/uk/po: Updated Ukranian translation.
1859
1860 2018-01-17  Alan Modra  <amodra@gmail.com>
1861
1862         * elf64-ppc.c (ppc64_elf_build_stubs): Silence gcc warning.
1863
1864 2018-01-17  Alan Modra  <amodra@gmail.com>
1865
1866         * elf32-ppc.c (GLINK_ENTRY_SIZE): Handle speculation barrier.
1867         (CRSETEQ, BEQCTRM): Define.
1868         (is_nonpic_glink_stub): Don't check bctr.
1869         (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
1870         (ppc_elf_relax_section): Size speculation barrier.
1871         (output_bctr): New function.
1872         (write_glink_stub): Use output_bctr.
1873         (ppc_elf_relocate_section): Use output_bctr for long branch stub.
1874         (ppc_elf_finish_dynamic_symbol): Likewise.
1875         (ppc_elf_finish_dynamic_sections): Use output_bctr.
1876         * elf32-ppc.h (struct ppc_elf_params): Add speculate_indirect_jumps.
1877         * elf64-ppc.c (CRSETEQ, BEQCTRM, BEQCTRLM): Define.
1878         (GLINK_PLTRESOLVE_SIZE): Size speculation barrier.
1879         (size_global_entry_stubs): Handle speculation barrier sizing.
1880         (plt_stub_size): Likewise.
1881         (output_bctr): New function.
1882         (build_plt_stub, build_tls_get_addr_stub): Output speculation
1883         barrier.
1884         (ppc_build_one_stub): Likewise for ppc_stub_plt_branch.
1885         (ppc_size_one_stub): Size speculation barrier in ppc_stub_plt_branch.
1886         (build_global_entry_stubs): Output speculation barrier.
1887         (ppc64_elf_build_stubs): Likewise in __glink_PLTresolve stub.
1888         * elf64-ppc.h (struct ppc64_elf_params): Add speculate_indirect_jumps.
1889
1890 2018-01-17  Alan Modra  <amodra@gmail.com>
1891
1892         * elf32-ppc.c (GLINK_ENTRY_SIZE): Add parameters, handle
1893         __tls_get_addr_opt, and alignment sizing.
1894         (TLS_GET_ADDR_GLINK_SIZE): Delete.
1895         (is_nonpic_glink_stub): Don't use GLINK_ENTRY_SIZE.
1896         (ppc_elf_get_synthetic_symtab): Recognize stubs spaced at 4, 6,
1897         or 8 insns.
1898         (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
1899         (allocate_dynrelocs): Use new GLINK_ENTRY_SIZE.
1900         (ppc_elf_size_dynamic_sections): Likewise.  Size branch table
1901         by PLT reloc count.
1902         (write_glink_stub): Handle __tls_get_addr_opt stub.
1903         Pad out to size given by GLINK_ENTRY_SIZE.
1904         (ppc_elf_relocate_section): Adjust write_glink_stub call.
1905         (ppc_elf_finish_dynamic_symbol): Likewise.
1906         (ppc_elf_finish_dynamic_sections): Write PLTresolve without using
1907         insn array since so many need rewriting.
1908         * elf32-ppc.h (struct ppc_elf_params): Add plt_stub_align.
1909         * elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Rename from
1910         GLINK_CALL_STUB_SIZE.  Add htab param and evaluate to size without
1911         nops.  Adjust all uses.
1912         (ppc64_elf_get_synthetic_symtab): Don't use GLINK_CALL_STUB_SIZE
1913         in glink_vma calculation.
1914         (struct ppc_link_hash_table): Add global_entry section pointer.
1915         (create_linkage_sections): Create separate section for global
1916         entry stubs.
1917         (PPC_LO, PPC_HI, PPC_HA): Move earlier.
1918         (size_global_entry_stubs): Handle sizing for aligned stubs.
1919         (ppc64_elf_size_dynamic_sections): Handle global_entry alloc,
1920         and don't stash end of glink branch table in rawsize.
1921         (ppc_build_one_stub): Rewrite stub size calculations.
1922         (build_global_entry_stubs): Use new section.
1923         (ppc64_elf_build_stubs): Don't pad __glink_PLTresolve with nops.
1924         Build lazy link stubs out to end of section.  Build global entry
1925         stubs in new section.
1926
1927 2018-01-15  Nick Clifton  <nickc@redhat.com>
1928
1929         * po/uk.po: Updated Ukranian translation.
1930
1931 2018-01-13  Nick Clifton  <nickc@redhat.com>
1932
1933         * po/bfd.pot: Regenerated.
1934
1935 2018-01-13  Nick Clifton  <nickc@redhat.com>
1936
1937         * version.m4: Bump version to 2.30.51
1938         * configure: Regenerate.
1939
1940 2018-01-13  Nick Clifton  <nickc@redhat.com>
1941
1942         2.30 branch created.
1943
1944 2018-01-12  Jens Widell  <jl@opera.com>
1945
1946         * elf.c (setup_group): Optimize search for group by remembering
1947         last found group and restarting search at that index.
1948         * elf-bfd.h (struct elf_obj_tdata): Add group_search_offset field.
1949
1950 2018-01-12  Gunther Nikl  <gnikl@users.sourceforge.net>
1951
1952         * aoutx.h (aout_link_check_ar_symbols): Remove default and handle
1953         bfd_link_common_skip_none in switch.
1954
1955 2018-01-12  Alan Modra  <amodra@gmail.com>
1956
1957         PR ld/22649
1958         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Ignore dynamic
1959         references on forced local symbols.
1960
1961 2018-01-12  Vlad Ivanov  <vlad@ivanov.email>
1962
1963         * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when
1964         .reginfo section has wrong size.
1965
1966 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
1967
1968         PR ld/22393
1969         * elf.c (_bfd_elf_map_sections_to_segments): When generating
1970         separate code and read-only data LOAD segments, create a new
1971         LOAD segment if the previous section contains text and the
1972         current section doesn't or vice versa.  Don't put a writable
1973         section in a read-only segment if there is a RELRO segment.
1974
1975 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
1976
1977         PR ld/22649
1978         * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Ignore dynamic
1979         references on forced local symbols.
1980
1981 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
1982
1983         PR ld/22677
1984         * elflink.c (bfd_elf_gc_sections): Keep all PREINIT_ARRAY,
1985         INIT_ARRAY as well as FINI_ARRAY sections for ld -r --gc-section.
1986
1987 2018-01-09  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
1988
1989         PR 22662
1990         * elf32-nds32.c (nds32_elf_relax_loadstore): Fix a typographical error.
1991
1992 2018-01-03  John Baldwin  <jhb@FreeBSD.org>
1993
1994         * elf.c (elfcore_grok_freebsd_note): Handle
1995         NT_FREEBSD_PROCSTAT_PROC, NT_FREEBSD_PROCSTAT_FILES, and
1996         NT_FREEBSD_PROCSTAT_VMMAP.
1997
1998 2018-01-03  Alan Modra  <amodra@gmail.com>
1999
2000         Update year range in copyright notice of all files.
2001
2002 For older changes see ChangeLog-2017
2003 \f
2004 Copyright (C) 2018 Free Software Foundation, Inc.
2005
2006 Copying and distribution of this file, with or without modification,
2007 are permitted in any medium without royalty provided the copyright
2008 notice and this notice are preserved.
2009
2010 Local Variables:
2011 mode: change-log
2012 left-margin: 8
2013 fill-column: 74
2014 version-control: never
2015 End: