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