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