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