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