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