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