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