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