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