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