Ignore processor-specific GNU program properties
[external/binutils.git] / bfd / ChangeLog
1 2017-04-11  H.J. Lu  <hongjiu.lu@intel.com>
2
3         * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
4         processor-specific properties with generic ELF target vector.
5
6 2017-04-10  Qing Zhao  <qing.zhao@oracle.com>
7
8         * elf32-sparc.c (elf_backend_fixup_symbol): New.
9         * elf64-sparc.c (elf_backend_fixup_symbol): New.
10         * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
11         (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
12         has_non_got_reloc.
13         (link_hash_newfunc): Initialize has_got_reloc and
14         has_non_got_reloc.
15         (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
16         section.
17         (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
18         has_non_got_reloc.
19         (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
20         has_non_got_reloc.
21         (_bfd_sparc_elf_fixup_symbol): New function.
22         (allocate_dynrelocs): Don't allocate space for dynamic
23         relocations and discard relocations against resolved undefined
24         weak symbols in executable.  Don't make resolved undefined weak
25         symbols in executable dynamic.  Keep dynamic non-GOT/non-PLT
26         relocation against undefined weak symbols in PIE.
27         (_bfd_sparc_elf_relocate_section): Don't generate dynamic
28         relocations against resolved undefined weak symbols in PIE
29         (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
30         without ynamic PLT/GOT relocations for resolved undefined weak
31         symbols.
32         Don't generate dynamic relocation against resolved undefined
33         weak symbol in executable.
34         (pie_finish_undefweak_symbol): New function.
35         (_bfd_sparc_elf_finish_dynamic_sections): Call
36         pie_finish_undefweak_symbol on all symbols in PIE.
37         * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
38         (_bfd_sparc_elf_fixup_symbol): New function.
39
40 2017-04-10  Nick Clifton  <nickc@redhat.com>
41
42         * config.bfd: Remove ns32k from obsolete list.
43
44 2017-04-10  Alan Modra  <amodra@gmail.com>
45
46         PR 21287
47         * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
48         (special_sections_i): Likewise for .init_array.
49         (special_sections_p): Likewise for .preinit_array.
50
51 2017-04-07  H.J. Lu  <hongjiu.lu@intel.com>
52
53         PR ld/19579
54         PR ld/21306
55         * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
56         ELF_COMMON_DEF_P for common symbols.
57         * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
58         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
59         * elflink.c (_bfd_elf_merge_symbol): Revert commits
60         202ac193bbbecc96a4978d1ac3d17148253f9b01 and
61         07492f668d2173da7a2bda3707ff0985e0f460b6.
62
63 2017-04-07  Pedro Alves  <palves@redhat.com>
64
65         * opncls.c (bfd_get_debug_link_info): Rename to...
66         (bfd_get_debug_link_info_1): ... this.  Change type of second
67         parameter to void pointer.  Adjust.
68         (bfd_get_debug_link_info): Reimplement on top of
69         bfd_get_debug_link_info_1.
70         (separate_debug_file_exists, separate_alt_debug_file_exists):
71         Change type of second parameter to void pointer.  Adjust.
72         (get_func_type, check_func_type): Change type of second parameter
73         to void pointer.
74         (find_separate_debug_file): Add 'func_data' parameter.  Pass it to
75         the callback functions instead of passing the address of a local.
76         (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
77         find_separate_debug_file.
78         (get_alt_debug_link_info_shim): Change type of second parameter to
79         void pointer.  Adjust.
80         (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
81         find_separate_debug_file.
82         (get_build_id_name, bfd_boolean check_build_id_file): Change type
83         of second parameter to void pointer.  Adjust.
84         (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
85         pointer local to find_separate_debug_file.
86
87 2017-04-07  Tristan Gingold  <gingold@gingold-Precision-7510>
88
89         * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
90         external symbols with a definition.
91         (_bfd_coff_gc_mark_extra_sections): Fix typo.
92
93 2017-04-07  Alan Modra  <amodra@gmail.com>
94
95         * po/SRC-POTFILES.in: Regenerate.
96
97 2017-04-05  Alan Modra  <amodra@gmail.com>
98
99         * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
100         reference counting.
101
102 2017-04-02  Jon Turney  <jon.turney@dronecode.org.uk>
103
104         (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
105         numbers for DataDirectory entry indicies passed to
106         add_data_entry().
107
108 2017-04-04  H.J. Lu  <hongjiu.lu@intel.com>
109
110         * elf.c (get_program_header_size): Add a GNU_MBIND segment for
111         each GNU_MBIND section and align GNU_MBIND section to page size.
112         (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
113         segment for each GNU_MBIND section.
114         (_bfd_elf_init_private_section_data): Copy sh_info from input
115         for GNU_MBIND section.
116
117 2017-04-03  Palmer Dabbelt  <palmer@dabbelt.com>
118
119         * elfnn-riscv.c (GP_NAME): Delete.
120         (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
121         (_bfd_riscv_relax_lui): Likewise.
122
123 2017-04-04  Nick Clifton  <nickc@redhat.com>
124
125         PR binutils/21342
126         * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
127         dereference.
128         (bfd_elf_final_link): Only initialize the extended symbol index
129         section if there are extended symbol tables to list.
130
131 2017-04-03  H.J. Lu  <hongjiu.lu@intel.com>
132
133         * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
134         (BFD32_BACKENDS_CFILES): Add elf-properties.c.
135         * configure.ac (elf): Add elf-properties.lo.
136         * Makefile.in: Regenerated.
137         * configure: Likewise.
138         * elf-bfd.h (elf_property_kind): New.
139         (elf_property): Likewise.
140         (elf_property_list): Likewise.
141         (elf_properties): Likewise.
142         (_bfd_elf_parse_gnu_properties): Likewise.
143         (_bfd_elf_get_property): Likewise.
144         (_bfd_elf_link_setup_gnu_properties): Likewise.
145         (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
146         and setup_gnu_properties.
147         (elf_obj_tdata): Add properties.
148         * elf-properties.c: New file.
149         * elf32-i386.c (elf_i386_parse_gnu_properties): New.
150         (elf_i386_merge_gnu_properties): Likewise.
151         (elf_backend_parse_gnu_properties): Likewise.
152         (elf_backend_merge_gnu_properties): Likewise.
153         * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
154         (elf_x86_64_merge_gnu_properties): Likewise.
155         (elf_backend_parse_gnu_properties): Likewise.
156         (elf_backend_merge_gnu_properties): Likewise.
157         * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
158         (elf_backend_parse_gnu_properties): Likewise.
159         (elf_backend_setup_gnu_properties): Likewise.
160         (elfNN_bed): Add elf_backend_parse_gnu_properties,
161         elf_backend_merge_gnu_properties and
162         elf_backend_setup_gnu_properties.
163
164 2017-03-30  Pip Cet  <pipcet@gmail.com>
165
166         * elf32-wasm32.c: Add relocation code, two relocs.
167         * reloc.c: Add wasm32 relocations.
168         * libbfd.h: Regenerate.
169         * bfd-in2.h: Regenerate.
170         * bfd/po/bfd.pot: Regenerate.
171
172 2017-03-29  Nick Clifton  <nickc@redhat.com>
173
174         PR binutils/18025
175         * coff-bfd.h (struct coff_section_data): Add new fields:
176         saved_bias and bias.
177         * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
178         computed for PE binaries.
179         * dwarf2.c (scan_unit_for_symbols): Only warn once about each
180         missing abbrev.
181
182 2017-03-28  Hans-Peter Nilsson  <hp@axis.com>
183
184         PR ld/16044
185         * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
186         to handle a local symbol with a hash-symbol-entry; without PLT.
187         Add BFD_ASSERT for an incidental case with GOT entry present.
188         (cris_elf_check_relocs): Increment PLT refcount only if the symbol
189         isn't forced-or-set local.
190
191 2017-03-27  Pip Cet  <pipcet@gmail.com>
192
193         * wasm-module.c: New file to support WebAssembly modules.
194         * wasm-module.h: New file to support WebAssembly modules.
195         * doc/webassembly.texi: Start documenting wasm-module.c.
196         * config.bfd: Add wasm_vec.
197         * targets.c: Likewise.
198         * configure.ac: Likewise.
199         * Makefile.am: Add entries for wasm-module.c.
200         * Makefile.in: Regenerate.
201         * configure: Regenerate.
202         * po/SRC-POTFILES.in: Regenerate.
203
204 2017-03-27  Pip Cet  <pipcet@gmail.com>
205
206         * cpu-wasm32.c: New file to support wasm32 architecture.
207         * elf32-wasm32.c: New file to support wasm32 architecture.
208         * Makefile.am: Add wasm32 architecture.
209         * archures.c: Likewise.
210         * config.bfd: Likewise.
211         * configure.ac: Likewise.
212         * targets.c: Likewise.
213         * Makefile.in: Regenerate.
214         * bfd-in2.h: Regenerate.
215         * configure: Regenerate.
216         * po/SRC-POTFILES.in: Regenerate.
217
218 2017-03-20  Alan Modra  <amodra@gmail.com>
219
220         PR 21266
221         * elf64-ppc.c (compare_symbols): Stabilize sort.
222
223 2017-03-18  Alan Modra  <amodra@gmail.com>
224
225         * elf64-ppc.c (struct ppc_link_hash_table): Add
226         local_ifunc_resolver and maybe_local_ifunc_resolver.
227         (ppc_build_one_stub): Set flags on emitting dynamic
228         relocation to ifunc.
229         (ppc64_elf_relocate_section): Likewise.
230         (ppc64_elf_finish_dynamic_symbol): Likewise.
231         (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
232         local dynamic relocs to ifuncs.
233         * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
234         local_ifunc_resolver and maybe_local_ifunc_resolver.
235         (ppc_elf_relocate_section): Set flag on emitting dynamic
236         relocation to ifuncs.
237         (ppc_elf_finish_dynamic_symbol): Likewise.
238         (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
239         dynamic relocs to ifuncs.
240
241 2017-03-13  Nick Clifton  <nickc@redhat.com>
242
243         PR binutils/21202
244         * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
245         BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
246         (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
247         BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
248         * bfd-in2.h: Regenerate.
249         * libbfd.h: Regenerate.
250         * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
251         names.
252         (IS_AARCH64_TLSDESC_RELOC): Likewise.
253         (elfNN_aarch64_howto_table): Likewise.
254         (aarch64_tls_transition_without_check): Likewise.
255         (aarch64_reloc_got_type): Likewise.
256         (elfNN_aarch64_final_link_relocate): Likewise.
257         (elfNN_aarch64_tls_relax): Likewise.
258         (elfNN_aarch64_relocate_section): Likewise.
259         (elfNN_aarch64_gc_sweep_hook): Likewise.
260         (elfNN_aarch64_check_relocs): Likewise.
261         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
262         (_bfd_aarch64_elf_resolve_relocation): Likewise.
263
264 2017-03-11  Alan Modra  <amodra@gmail.com>
265
266         * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
267         parameter is in fact used.  Whitespace fixes.
268         * elf64-ppc.c: Likewise.
269
270 2017-03-09  Sam Thursfield  <sam.thursfield@codethink.co.uk>
271
272         * rs6000-core.c (CORE_NEW): Simplify macro when
273         AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
274
275 2017-03-07  Alan Modra  <amodra@gmail.com>
276
277         PR 21224
278         PR 20519
279         * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
280         dyn_relocs check.
281
282 2017-03-05  Alan Modra  <amodra@gmail.com>
283
284         * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
285         * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
286         (next_cie_fde_offset): New function.
287         (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
288         (_bfd_elf_discard_section_eh_frame): Align zero terminator to
289         four bytes.  Align CIEs to four or eight bytes depending on
290         per_encoding_aligned8.  Align FDEs according to their encoding.
291         Pad last FDE to output section alignment.
292         (_bfd_elf_write_section_eh_frame): Adjust to suit.  Remove
293         assertion.
294         * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
295         (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
296         (ppc64_elf_finish_dynamic_sections): Adjust to suit.
297
298 2017-03-02  Martin Bickel  <binutils@ineranves.de>
299
300         PR ld/21212
301         * elf.c (rewrite_elf_program_header): Do not issue a warning for
302         empty segments which have a zero filesz, but a non-zero memsz.
303
304 2017-03-02  Alan Modra  <amodra@gmail.com>
305
306         * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
307
308 2017-02-28  Alan Modra  <amodra@gmail.com>
309
310         * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
311         (ppc64_elf_relocate_section): Likewise.
312
313 2017-02-28  Alan Modra  <amodra@gmail.com>
314
315         PR 20995
316         * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
317         rather than elf32_nios2_hash_table or elf_hash_table.
318         (create_got_section): Likewise.
319         (nios2_elf32_finish_dynamic_symbol): Likewise.
320         (nios2_elf32_adjust_dynamic_symbol): Likewise.
321         (nios2_elf32_size_dynamic_sections): Likewise.
322         (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
323         vars.  Use htab equivalents directly instead.  Don't create
324         all dynamic sections on needing just the GOT.  Use a goto
325         rather than a fall-through with reloc test.  Ensure
326         htab->dynobj is set when making dynamic sreloc section.
327         (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
328         equivalent directly instead.  Don't segfault on looking for
329         .dynamic when dynamic sections have not been created.  Don't
330         segfault on .got.plt being discarded.
331         (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
332         Don't set "relocs" on .rela.plt.  Do handle .sbss.  Delete
333         fixme and another not so relevant comment.
334         (nios2_elf_add_symbol_hook): Delete dynobj var.  If not
335         already set, set hash table dynobj on creating .sbss.
336
337 2017-02-28  Alan Modra  <amodra@gmail.com>
338
339         * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
340         * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
341         (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
342         (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
343         (ppc64_elf_relocate_section): Likewise.
344         * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
345         (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
346         (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
347         * libbfd.h: Regenerate.
348         * bfd-in2.h: Regenerate.
349
350 2017-02-28  Alan Modra  <amodra@gmail.com>
351
352         * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
353         dynamic .data.rel.ro read-only.
354         * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
355         rather than section flags when deciding where copy reloc goes.
356         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
357         * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
358         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
359         * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
360         * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
361         * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
362         * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
363         * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
364         * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
365         * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
366         * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
367         * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
368         * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
369         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
370         * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
371         * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
372         * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
373         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
374         * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
375
376 2017-02-28  Maciej W. Rozycki  <macro@imgtec.com>
377
378         * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
379         `jalr $0, $25' instruction encoding.
380
381 2017-02-27  Nick Clifton  <nickc@redhat.com>
382
383         PR ld/21180
384         * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
385         generating a seg-fault when encountering a symbol that has been
386         deleted by garbage collection.
387
388 2017-02-25  Alan Modra  <amodra@gmail.com>
389
390         * elf32-arc.c (struct dynamic_sections): Delete.
391         (enum dyn_section_types): Delete.
392         (dyn_section_names): Delete.
393         (arc_create_dynamic_sections): Delete.
394         (elf_arc_finish_dynamic_sections): Don't call the above.  Don't
395         segfault on discarded .rela.plt section.
396         (elf_arc_size_dynamic_sections): Formatting.  Don't call
397         arc_create_dynamic_sections.  Don't allocate memory for sections
398         handled by the generic linker.  Correct code finding relocs in
399         read-only sections.  Set SEC_EXCLUDE on zero size .got,
400         .got.plt, and .dynbss sections.  Do set .interp for pies.
401
402 2017-02-24  Andrew Waterman  <andrew@sifive.com>
403
404         * elfnn-riscv.c (GP_NAME): New macro.
405         (riscv_global_pointer_value): Use it.
406         (_bfd_riscv_relax_lui): If symbol and global pointer are in same
407         output section, consider only that section's alignment.
408
409 2017-02-23  Maciej W. Rozycki  <macro@imgtec.com>
410
411         * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
412         * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
413         * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
414         * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
415
416 2017-02-23  Maciej W. Rozycki  <macro@imgtec.com>
417
418         * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
419         <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
420         or misaligned.
421
422 2017-02-23  Alan Modra  <amodra@gmail.com>
423
424         PR 20744
425         * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
426         16D relocations.
427         (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
428         (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
429         relocs.
430
431 2017-02-22  Maciej W. Rozycki  <macro@imgtec.com>
432
433         PR ld/20828
434         * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
435         processing ahead of the call to `elf_gc_sweep_symbol'.
436
437 2017-02-22  Nick Clifton  <nickc@redhat.com>
438
439         PR binutils/21193
440         * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
441         created section 4-byte alignment.
442
443 2017-02-22  Alan Modra  <amodra@gmail.com>
444
445         * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
446         on .got or .plt output section being discarded by script.
447         * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise.  Move
448         vxworks splt temp.
449
450 2017-02-21  Alan Modra  <amodra@gmail.com>
451
452         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
453         DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
454
455 2017-02-20  Alan Modra  <amodra@gmail.com>
456
457         PR 21181
458         * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
459         if DT_RELSZ/DT_RELASZ is zero.
460
461 2017-02-17  Nick Clifton  <nickc@redhat.com>
462
463         * compress.c (bfd_get_full_section_contents): Remember to reduce
464         compressed size by the sizeof the compression header when
465         decompressing the contents.
466
467 2017-02-17  Pedro Alves  <palves@redhat.com>
468
469         * srec.c (Chunk): Rename to ...
470         (_bfd_srec_len): ... this.
471         (S3Forced): Rename to ...
472         (_bfd_srec_forceS3): ... this.
473         * objcopy.c: Adjust all references.
474
475 2017-02-17  Pedro Alves  <palves@redhat.com>
476
477         * archive.c (bsd_write_armap): Rename to ...
478         (_bfd_bsd_write_armap): ... this.
479         (coff_write_armap): Rename to ...
480         (_bfd_coff_write_armap): ... this.
481         * libbfd-in.h (bsd_write_armap): Rename to ...
482         (_bfd_bsd_write_armap): ... this.
483         (coff_write_armap): Rename to ...
484         (_bfd_coff_write_armap): ... this.
485         * aout-target.h, aout-tic30.c: Adjust all users.
486         * libbfd.h: Regenerate.
487
488 2017-02-17  Pedro Alves  <palves@redhat.com>
489
490         * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
491         (warn_deprecated): Rename to ...
492         (_bfd_warn_deprecated): ... this.
493         * libbfd.c (warn_deprecated): Rename to ...
494         (_bfd_warn_deprecated): ... this.
495         * bfd-in2.h: Regenerate.
496
497 2017-02-17  Pedro Alves  <palves@redhat.com>
498
499         * bfdio.c (real_ftell): Rename to ...
500         (_bfd_real_ftell): ... this.
501         (real_fseek): Rename to ...
502         (_bfd_real_fseek): ... this.
503         (real_fopen): Rename to ...
504         (_bfd_real_fopen): ... this.
505         * libbfd-in.h (real_ftell): Rename to ...
506         (_bfd_real_ftell): ... this.
507         (real_fseek): Rename to ...
508         (_bfd_real_fseek): ... this.
509         (real_fopen): Rename to ...
510         (_bfd_real_fopen): ... this.
511         * cache.c, dwarf2.c, opncls.c: Adjust all callers.
512         * libbfd.h: Regenerate.
513
514 2017-02-17  Pedro Alves  <palves@redhat.com>
515
516         * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
517         * libbfd.c (read_unsigned_leb128): Rename to ...
518         (_bfd_read_unsigned_leb128): ... this.
519         (read_signed_leb128): Rename to ...
520         (_bfd_read_signed_leb128): ... this.
521         (safe_read_leb128): Rename to ...
522         (_bfd_safe_read_leb128): ... this.
523         * libbfd-in.h (read_unsigned_leb128): Rename to ...
524         (_bfd_read_unsigned_leb128): ... this.
525         (read_signed_leb128): Rename to ...
526         (_bfd_read_signed_leb128): ... this.
527         (safe_read_leb128): Rename to ...
528         (_bfd_safe_read_leb128): ... this.
529         * libbfd.h: Renegerate.
530
531 2017-02-16  Andrew Burgess  <andrew.burgess@embecosm.com>
532
533         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
534         before trying to fine matching file and line information.
535
536 2017-02-16  Andrew Burgess  <andrew.burgess@embecosm.com>
537
538         * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
539         (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
540         not match current bfd, then reload debug information.  Record bfd
541         we're loading debug info for in the stash.  If we have debug
542         informatin in the cache then perform section placement before
543         returning.
544
545 2017-02-16  Alan Modra  <amodra@gmail.com>
546
547         PR 21000
548         * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
549         * elfxx-target.h (elf_backend_no_page_alias): Define.
550         (elfNN_bed): Init new field.
551         * elf.c (assign_file_positions_for_load_sections): If no_page_alias
552         ensure PT_LOAD segment starts on a new page.
553         * elf32-hppa.c (elf_backend_no_page_alias): Define.
554
555 2017-02-16  Alan Modra  <amodra@gmail.com>
556
557         PR 21132
558         * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
559         if pic.
560
561 2017-02-16  Jiong Wang <jiong.wang@arm.com>
562
563         * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
564         * bfd-in2.h: Regenerated.
565
566 2017-02-15  H.J. Lu  <hongjiu.lu@intel.com>
567
568         PR ld/21168
569         * elf32-i386.c (elf_i386_relocate_section): Allow
570         "lea foo@GOT, %reg" in PIC.
571
572 2017-02-15  H.J. Lu  <hongjiu.lu@intel.com>
573
574         PR ld/20244
575         * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
576         symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
577         error against local IFUNC symbol without a base register for
578         PIC.
579
580 2017-02-15  Maciej W. Rozycki  <macro@imgtec.com>
581
582         * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
583         `%P: %H:' with `info->callbacks->einfo'.
584         (ppc_elf_relocate_section): Likewise.
585         * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
586         (ppc64_elf_edit_toc): Likewise.
587         (ppc64_elf_relocate_section): Likewise.
588
589 2017-02-14  Alan Modra  <amodra@gmail.com>
590
591         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
592         --gc-keep-exported, and test versioned field of sym rather than
593         looking for @ in name.
594
595 2017-02-13  Palmer Dabbelt  <palmer@dabbelt.com>
596
597         * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
598         __global_pointer$.
599
600 2017-02-13  Nick Clifton  <nickc@redhat.com>
601
602         PR binutils/21151
603         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
604         unit length field.
605
606 2017-02-07  Andrew Waterman  <andrew@sifive.com>
607
608         * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
609         entry size if PLT header is written.
610
611 2017-02-06  Sheldon Lobo  <sheldon.lobo@oracle.com>
612
613         Fix sparc64 dynamic relocation processing to use the dynamic
614         symbol count.
615         * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
616         to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
617         should be used.
618
619 2017-02-03  Nick Clifton  <nickc@redhat.com>
620
621         PR 21096
622         * coffcode.h (coff_write_object_contents): Enlarge size of
623         s_name_buf in order to avoid compile time warning about possible
624         integer truncation.
625         * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
626         32-bits of insn value before printing into buffer.
627
628 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
629
630         * elfxx-mips.c (mips_elf_hash_sort_data): Add
631         `max_local_dynindx'.
632         (mips_elf_sort_hash_table): Handle it.
633         (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
634         symbols bump up `max_local_dynindx' rather than
635         `max_non_got_dynindx'.
636
637 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
638
639         * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
640         `min_got_dynindx', `max_unref_got_dynindx' and
641         `max_non_got_dynindx' members to the `bfd_size_type' data type.
642         (mips_elf_sort_hash_table): Adjust accordingly.
643
644 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
645
646         * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
647         to access the hash table.
648
649 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
650
651         * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
652         non-NULL `htab' to the beginning.
653
654 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
655
656         * elflink.c (elf_gc_sweep): Wrap overlong line.
657
658 2017-01-30  Maciej W. Rozycki  <macro@imgtec.com>
659
660         * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
661         (_bfd_mips_elf_linker_flags): ... this.  Add another parameter.
662         * elfxx-mips.c (mips_elf_link_hash_table): Add
663         `ignore_branch_isa' member.
664         (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
665         in branch relocation calculation as an error if
666         `ignore_branch_isa' has been set.
667         (_bfd_mips_elf_insn32): Rename to...
668         (_bfd_mips_elf_linker_flags): ... this.  Rename the `on'
669         parameter to `insn32' and add an `ignore_branch_isa' parameter.
670         Handle the new parameter.
671
672 2017-01-27  Hans-Peter Nilsson  <hp@axis.com>
673
674         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
675         local variable dynobj.
676
677         PR ld/20995
678         * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
679         (elf_cris_adjust_dynamic_symbol): Place variables copied into the
680         executable from read-only sections into sdynrelro.
681         (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
682         dynamic relocs in sdynrelro.
683         (elf_backend_want_dynrelro): Define.
684
685 2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>
686
687         * config.bfd (*-*-rtemsaout*): Mark as removed.
688
689 2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>
690
691         * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
692         (arm-*-rtems*): Move to (arm*-*-eabi*).
693         (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
694         (m68-*-rtems*): Move to (m68*-*-elf*).
695
696 2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>
697
698         * config.bfd (*-*-rtemscoff*): Mark as removed.
699
700 2017-01-24  Maciej W. Rozycki  <macro@imgtec.com>
701
702         PR ld/20828
703         * elflink.c (bfd_elf_record_link_assignment): Revert last
704         change and don't ever clear `forced_local'.  Set `mark'
705         unconditionally.
706         (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
707         file.
708         (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
709         (bfd_elf_size_dynamic_sections): ... here.
710         * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
711         and set `mark' instead in `__tls_get_addr_opt' processing.
712         * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
713
714 2017-01-24  Alan Modra  <amodra@gmail.com>
715
716         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
717         where dynamic relocs are preferable.  Allow ifunc too.
718         (ensure_undefweak_dynamic): New function.
719         (allocate_dynrelocs): Use it here.  Move plt handling last and
720         don't make symbols dynamic, simplifying loop.  Only make undef
721         weak symbols with GOT entries dynamic.  Correct condition
722         for GOT relocs.  Handle dynamic relocs on ifuncs.  Correct
723         comments.  Remove goto.
724         (ppc_elf_relocate_section): Correct test for using dynamic
725         symbol on GOT relocs.  Rearrange test for emitting GOT relocs
726         to suit.  Set up explicit tls_index entries and implicit GOT
727         tls_index entries resolvable at link time for
728         __tls_get_addr_opt.  Simplify test to clear mem for prelink.
729         * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
730         (ensure_undefweak_dynamic): New function.
731         (allocate_dynrelocs): Use it here.  Only make undef weak symbols
732         with GOT entries dynamic.  Remove unnecessary test of
733         WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
734         (ppc64_elf_relocate_section): Correct test for using dynamic
735         symbol on GOT relocs.  Rearrange test for emitting GOT relocs
736         to suit.  Set up explicit tls_index entries and implicit GOT
737         tls_index entries resolvable at link time for __tls_get_addr_opt.
738         Simplify expression to clear mem for prelink.
739
740 2017-01-23  Yury Norov  <ynorov@caviumnetworks.com>
741
742         * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
743
744 2017-01-20  Jiong Wang <jiong.wang@arm.com>
745
746         * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
747         (elf_backend_hash_symbol): Define.
748
749 2017-01-18  Maciej W. Rozycki  <macro@imgtec.com>
750
751         PR ld/20828
752         * elflink.c (bfd_elf_record_link_assignment): Clear any
753         `forced_local' marking for DSO symbols that are not being
754         provided.
755
756 2017-01-17  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
757
758         * elfnn-riscv.c (riscv_elf_object_p): New function.
759
760 2017-01-12  H.J. Lu  <hongjiu.lu@intel.com>
761
762         PR ld/21038
763         * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
764         plt_bnd_eh_frame.
765         (elf_x86_64_check_relocs): Create .eh_frame section for the
766         .plt.bnd section.
767         (elf_x86_64_size_dynamic_sections): Allocate and initialize
768         .eh_frame section for the .plt.bnd section.
769         (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
770         for the .plt.bnd section.
771
772 2017-01-12  Nick Clifton  <nickc@redhat.com>
773
774         PR binutils/20876
775         * opncls.c (find_separate_debug_file): Add include_dirs
776         parameter.  Only include the directory part of the bfd's filename
777         in search paths if include_dirs is true.  Add a couple of extra
778         locations for looking for debug files.
779         ( bfd_follow_gnu_debuglink): Update invocation of
780         find_separate_debug_file.
781         (bfd_follow_gnu_debugaltlink): Likewise.
782         (get_build_id): New function: Finds the build-id of the given bfd.
783         (get_build_id_name): New function: Computes the name of the
784         separate debug info file for a bfd, based upon its build-id.
785         (check_build_id_file): New function: Checks to see if a separate
786         debug info file exists at the given location, and that its
787         build-id matches that of the original bfd.
788         (bfd_follow_build_id_debuglink): New function: Finds a separate
789         debug info file for a given bfd by using the build-id method.
790         * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
791         method of locating a separate debug info file before using the
792         debuglink method.
793         * bfd-in2.h: Regenerate.
794
795 2017-01-11  H.J. Lu  <hongjiu.lu@intel.com>
796
797         PR ld/21038
798         * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
799         (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
800         elf_x86_64_eh_frame_plt_got.
801         (elf_x86_64_size_dynamic_sections): Get unwind info from
802         elf_x86_64_bnd_arch_bed for the BND PLT.
803
804 2017-01-11  Jeremy Soller  <jackpot51@gmail.com>
805
806         * config.bfd: Add entries for i686-redox and x86_64-redox.
807
808 2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>
809
810         * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
811         to 4 bytes.
812         * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
813         .eh_frame section to 4 bytes for x32.
814         (elf_x86_64_check_relocs): Likewise.
815
816 2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>
817
818         PR ld/20830
819         * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
820         (PLT_GOT_FDE_LENGTH): Likewise.
821         (elf_i386_plt_layout): Add eh_frame_plt_got and
822         eh_frame_plt_got_size.
823         (elf_i386_plt): Updated.
824         (elf_i386_link_hash_table): Add plt_got_eh_frame.
825         (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
826         (elf_i386_size_dynamic_sections): Allocate and initialize
827         .eh_frame section for .plt.got.
828         (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
829         .plt.got.
830         (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
831         eh_frame_plt_got_size.
832         * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
833         (PLT_GOT_FDE_LENGTH): Likewise.
834         (elf_x86_64_backend_data): Add eh_frame_plt_got and
835         eh_frame_plt_got_size.
836         (elf_x86_64_arch_bed): Updated.
837         (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
838         eh_frame_plt_got_size.
839         (elf_x86_64_nacl_arch_bed): Likewise.
840         (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
841         (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
842         (elf_x86_64_size_dynamic_sections): Allocate and initialize
843         .eh_frame section for .plt.got.
844         (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
845         for .plt.got.
846
847 2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>
848
849         * elf32-i386.c (elf_i386_size_dynamic_sections): Set
850         plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
851
852 2017-01-09  Nick Clifton  <nickc@redhat.com>
853
854         * dwarf2.c (lookup_address_in_function_table): Return early if
855         there are no functions in the given comp unit, or if the high
856         address of the last function in the comp unit is less than the
857         desired address.
858
859 2017-01-09  Nick Clifton  <nickc@redhat.com>
860
861         PR binutils/21013
862         * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
863         message if there are too many symbols to load.
864
865 2017-01-04  James Clarke  <jrtc27@jrtc27.com>
866
867         * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
868         if relocs are cached.
869
870 2017-01-03  Rich Felker  <bugdal@aerifal.cx>
871
872         PR ld/21017
873         * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
874         for R_MICROBLAZE_GOTOFF_64.
875
876 2017-01-03  Nick Clifton  <nickc@redhat.com>
877
878         * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
879         warning about using a possibly uninitialised variable.
880
881 2017-01-02  Alan Modra  <amodra@gmail.com>
882
883         * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
884         (allocate_plt_static, allocate_dynrelocs): Use it.
885
886 2017-01-02  Alan Modra  <amodra@gmail.com>
887
888         * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
889         .PARISC.unwind section.
890
891 2017-01-02  Alan Modra  <amodra@gmail.com>
892
893         PR ld/20989
894         * elfxx-sparc.c (gdop_relative_offset_ok): New function.
895         (_bfd_sparc_elf_relocate_section): Use it to validate GOT
896         indirect to GOT pointer relative code edit.
897
898 2017-01-02  Alan Modra  <amodra@gmail.com>
899
900         Update year range in copyright notice of all files.
901
902 For older changes see ChangeLog-2016
903 \f
904 Copyright (C) 2017 Free Software Foundation, Inc.
905
906 Copying and distribution of this file, with or without modification,
907 are permitted in any medium without royalty provided the copyright
908 notice and this notice are preserved.
909
910 Local Variables:
911 mode: change-log
912 left-margin: 8
913 fill-column: 74
914 version-control: never
915 End: