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