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