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