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