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