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