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