7435d5abdcf6a4414e64c54a4d4817009f105e1e
[external/binutils.git] / bfd / ChangeLog
1 2017-02-23  Maciej W. Rozycki  <macro@imgtec.com>
2
3         * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4         * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
5         * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
6         * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
7
8 2017-02-23  Maciej W. Rozycki  <macro@imgtec.com>
9
10         * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
11         <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
12         or misaligned.
13
14 2017-02-23  Alan Modra  <amodra@gmail.com>
15
16         PR 20744
17         * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
18         16D relocations.
19         (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
20         (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
21         relocs.
22
23 2017-02-22  Maciej W. Rozycki  <macro@imgtec.com>
24
25         PR ld/20828
26         * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
27         processing ahead of the call to `elf_gc_sweep_symbol'.
28
29 2017-02-22  Nick Clifton  <nickc@redhat.com>
30
31         PR binutils/21193
32         * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
33         created section 4-byte alignment.
34
35 2017-02-22  Alan Modra  <amodra@gmail.com>
36
37         * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
38         on .got or .plt output section being discarded by script.
39         * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise.  Move
40         vxworks splt temp.
41
42 2017-02-21  Alan Modra  <amodra@gmail.com>
43
44         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
45         DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
46
47 2017-02-20  Alan Modra  <amodra@gmail.com>
48
49         PR 21181
50         * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
51         if DT_RELSZ/DT_RELASZ is zero.
52
53 2017-02-17  Nick Clifton  <nickc@redhat.com>
54
55         * compress.c (bfd_get_full_section_contents): Remember to reduce
56         compressed size by the sizeof the compression header when
57         decompressing the contents.
58
59 2017-02-17  Pedro Alves  <palves@redhat.com>
60
61         * srec.c (Chunk): Rename to ...
62         (_bfd_srec_len): ... this.
63         (S3Forced): Rename to ...
64         (_bfd_srec_forceS3): ... this.
65         * objcopy.c: Adjust all references.
66
67 2017-02-17  Pedro Alves  <palves@redhat.com>
68
69         * archive.c (bsd_write_armap): Rename to ...
70         (_bfd_bsd_write_armap): ... this.
71         (coff_write_armap): Rename to ...
72         (_bfd_coff_write_armap): ... this.
73         * libbfd-in.h (bsd_write_armap): Rename to ...
74         (_bfd_bsd_write_armap): ... this.
75         (coff_write_armap): Rename to ...
76         (_bfd_coff_write_armap): ... this.
77         * aout-target.h, aout-tic30.c: Adjust all users.
78         * libbfd.h: Regenerate.
79
80 2017-02-17  Pedro Alves  <palves@redhat.com>
81
82         * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
83         (warn_deprecated): Rename to ...
84         (_bfd_warn_deprecated): ... this.
85         * libbfd.c (warn_deprecated): Rename to ...
86         (_bfd_warn_deprecated): ... this.
87         * bfd-in2.h: Regenerate.
88
89 2017-02-17  Pedro Alves  <palves@redhat.com>
90
91         * bfdio.c (real_ftell): Rename to ...
92         (_bfd_real_ftell): ... this.
93         (real_fseek): Rename to ...
94         (_bfd_real_fseek): ... this.
95         (real_fopen): Rename to ...
96         (_bfd_real_fopen): ... this.
97         * libbfd-in.h (real_ftell): Rename to ...
98         (_bfd_real_ftell): ... this.
99         (real_fseek): Rename to ...
100         (_bfd_real_fseek): ... this.
101         (real_fopen): Rename to ...
102         (_bfd_real_fopen): ... this.
103         * cache.c, dwarf2.c, opncls.c: Adjust all callers.
104         * libbfd.h: Regenerate.
105
106 2017-02-17  Pedro Alves  <palves@redhat.com>
107
108         * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
109         * libbfd.c (read_unsigned_leb128): Rename to ...
110         (_bfd_read_unsigned_leb128): ... this.
111         (read_signed_leb128): Rename to ...
112         (_bfd_read_signed_leb128): ... this.
113         (safe_read_leb128): Rename to ...
114         (_bfd_safe_read_leb128): ... this.
115         * libbfd-in.h (read_unsigned_leb128): Rename to ...
116         (_bfd_read_unsigned_leb128): ... this.
117         (read_signed_leb128): Rename to ...
118         (_bfd_read_signed_leb128): ... this.
119         (safe_read_leb128): Rename to ...
120         (_bfd_safe_read_leb128): ... this.
121         * libbfd.h: Renegerate.
122
123 2017-02-16  Andrew Burgess  <andrew.burgess@embecosm.com>
124
125         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
126         before trying to fine matching file and line information.
127
128 2017-02-16  Andrew Burgess  <andrew.burgess@embecosm.com>
129
130         * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
131         (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
132         not match current bfd, then reload debug information.  Record bfd
133         we're loading debug info for in the stash.  If we have debug
134         informatin in the cache then perform section placement before
135         returning.
136
137 2017-02-16  Alan Modra  <amodra@gmail.com>
138
139         PR 21000
140         * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
141         * elfxx-target.h (elf_backend_no_page_alias): Define.
142         (elfNN_bed): Init new field.
143         * elf.c (assign_file_positions_for_load_sections): If no_page_alias
144         ensure PT_LOAD segment starts on a new page.
145         * elf32-hppa.c (elf_backend_no_page_alias): Define.
146
147 2017-02-16  Alan Modra  <amodra@gmail.com>
148
149         PR 21132
150         * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
151         if pic.
152
153 2017-02-16  Jiong Wang <jiong.wang@arm.com>
154
155         * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
156         * bfd-in2.h: Regenerated.
157
158 2017-02-15  H.J. Lu  <hongjiu.lu@intel.com>
159
160         PR ld/21168
161         * elf32-i386.c (elf_i386_relocate_section): Allow
162         "lea foo@GOT, %reg" in PIC.
163
164 2017-02-15  H.J. Lu  <hongjiu.lu@intel.com>
165
166         PR ld/20244
167         * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
168         symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
169         error against local IFUNC symbol without a base register for
170         PIC.
171
172 2017-02-15  Maciej W. Rozycki  <macro@imgtec.com>
173
174         * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
175         `%P: %H:' with `info->callbacks->einfo'.
176         (ppc_elf_relocate_section): Likewise.
177         * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
178         (ppc64_elf_edit_toc): Likewise.
179         (ppc64_elf_relocate_section): Likewise.
180
181 2017-02-14  Alan Modra  <amodra@gmail.com>
182
183         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
184         --gc-keep-exported, and test versioned field of sym rather than
185         looking for @ in name.
186
187 2017-02-13  Palmer Dabbelt  <palmer@dabbelt.com>
188
189         * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
190         __global_pointer$.
191
192 2017-02-13  Nick Clifton  <nickc@redhat.com>
193
194         PR binutils/21151
195         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
196         unit length field.
197
198 2017-02-07  Andrew Waterman  <andrew@sifive.com>
199
200         * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
201         entry size if PLT header is written.
202
203 2017-02-06  Sheldon Lobo  <sheldon.lobo@oracle.com>
204
205         Fix sparc64 dynamic relocation processing to use the dynamic
206         symbol count.
207         * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
208         to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
209         should be used.
210
211 2017-02-03  Nick Clifton  <nickc@redhat.com>
212
213         PR 21096
214         * coffcode.h (coff_write_object_contents): Enlarge size of
215         s_name_buf in order to avoid compile time warning about possible
216         integer truncation.
217         * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
218         32-bits of insn value before printing into buffer.
219
220 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
221
222         * elfxx-mips.c (mips_elf_hash_sort_data): Add
223         `max_local_dynindx'.
224         (mips_elf_sort_hash_table): Handle it.
225         (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
226         symbols bump up `max_local_dynindx' rather than
227         `max_non_got_dynindx'.
228
229 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
230
231         * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
232         `min_got_dynindx', `max_unref_got_dynindx' and
233         `max_non_got_dynindx' members to the `bfd_size_type' data type.
234         (mips_elf_sort_hash_table): Adjust accordingly.
235
236 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
237
238         * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
239         to access the hash table.
240
241 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
242
243         * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
244         non-NULL `htab' to the beginning.
245
246 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
247
248         * elflink.c (elf_gc_sweep): Wrap overlong line.
249
250 2017-01-30  Maciej W. Rozycki  <macro@imgtec.com>
251
252         * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
253         (_bfd_mips_elf_linker_flags): ... this.  Add another parameter.
254         * elfxx-mips.c (mips_elf_link_hash_table): Add
255         `ignore_branch_isa' member.
256         (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
257         in branch relocation calculation as an error if
258         `ignore_branch_isa' has been set.
259         (_bfd_mips_elf_insn32): Rename to...
260         (_bfd_mips_elf_linker_flags): ... this.  Rename the `on'
261         parameter to `insn32' and add an `ignore_branch_isa' parameter.
262         Handle the new parameter.
263
264 2017-01-27  Hans-Peter Nilsson  <hp@axis.com>
265
266         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
267         local variable dynobj.
268
269         PR ld/20995
270         * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
271         (elf_cris_adjust_dynamic_symbol): Place variables copied into the
272         executable from read-only sections into sdynrelro.
273         (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
274         dynamic relocs in sdynrelro.
275         (elf_backend_want_dynrelro): Define.
276
277 2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>
278
279         * config.bfd (*-*-rtemsaout*): Mark as removed.
280
281 2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>
282
283         * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
284         (arm-*-rtems*): Move to (arm*-*-eabi*).
285         (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
286         (m68-*-rtems*): Move to (m68*-*-elf*).
287
288 2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>
289
290         * config.bfd (*-*-rtemscoff*): Mark as removed.
291
292 2017-01-24  Maciej W. Rozycki  <macro@imgtec.com>
293
294         PR ld/20828
295         * elflink.c (bfd_elf_record_link_assignment): Revert last
296         change and don't ever clear `forced_local'.  Set `mark'
297         unconditionally.
298         (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
299         file.
300         (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
301         (bfd_elf_size_dynamic_sections): ... here.
302         * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
303         and set `mark' instead in `__tls_get_addr_opt' processing.
304         * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
305
306 2017-01-24  Alan Modra  <amodra@gmail.com>
307
308         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
309         where dynamic relocs are preferable.  Allow ifunc too.
310         (ensure_undefweak_dynamic): New function.
311         (allocate_dynrelocs): Use it here.  Move plt handling last and
312         don't make symbols dynamic, simplifying loop.  Only make undef
313         weak symbols with GOT entries dynamic.  Correct condition
314         for GOT relocs.  Handle dynamic relocs on ifuncs.  Correct
315         comments.  Remove goto.
316         (ppc_elf_relocate_section): Correct test for using dynamic
317         symbol on GOT relocs.  Rearrange test for emitting GOT relocs
318         to suit.  Set up explicit tls_index entries and implicit GOT
319         tls_index entries resolvable at link time for
320         __tls_get_addr_opt.  Simplify test to clear mem for prelink.
321         * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
322         (ensure_undefweak_dynamic): New function.
323         (allocate_dynrelocs): Use it here.  Only make undef weak symbols
324         with GOT entries dynamic.  Remove unnecessary test of
325         WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
326         (ppc64_elf_relocate_section): Correct test for using dynamic
327         symbol on GOT relocs.  Rearrange test for emitting GOT relocs
328         to suit.  Set up explicit tls_index entries and implicit GOT
329         tls_index entries resolvable at link time for __tls_get_addr_opt.
330         Simplify expression to clear mem for prelink.
331
332 2017-01-23  Yury Norov  <ynorov@caviumnetworks.com>
333
334         * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
335
336 2017-01-20  Jiong Wang <jiong.wang@arm.com>
337
338         * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
339         (elf_backend_hash_symbol): Define.
340
341 2017-01-18  Maciej W. Rozycki  <macro@imgtec.com>
342
343         PR ld/20828
344         * elflink.c (bfd_elf_record_link_assignment): Clear any
345         `forced_local' marking for DSO symbols that are not being
346         provided.
347
348 2017-01-17  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
349
350         * elfnn-riscv.c (riscv_elf_object_p): New function.
351
352 2017-01-12  H.J. Lu  <hongjiu.lu@intel.com>
353
354         PR ld/21038
355         * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
356         plt_bnd_eh_frame.
357         (elf_x86_64_check_relocs): Create .eh_frame section for the
358         .plt.bnd section.
359         (elf_x86_64_size_dynamic_sections): Allocate and initialize
360         .eh_frame section for the .plt.bnd section.
361         (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
362         for the .plt.bnd section.
363
364 2017-01-12  Nick Clifton  <nickc@redhat.com>
365
366         PR binutils/20876
367         * opncls.c (find_separate_debug_file): Add include_dirs
368         parameter.  Only include the directory part of the bfd's filename
369         in search paths if include_dirs is true.  Add a couple of extra
370         locations for looking for debug files.
371         ( bfd_follow_gnu_debuglink): Update invocation of
372         find_separate_debug_file.
373         (bfd_follow_gnu_debugaltlink): Likewise.
374         (get_build_id): New function: Finds the build-id of the given bfd.
375         (get_build_id_name): New function: Computes the name of the
376         separate debug info file for a bfd, based upon its build-id.
377         (check_build_id_file): New function: Checks to see if a separate
378         debug info file exists at the given location, and that its
379         build-id matches that of the original bfd.
380         (bfd_follow_build_id_debuglink): New function: Finds a separate
381         debug info file for a given bfd by using the build-id method.
382         * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
383         method of locating a separate debug info file before using the
384         debuglink method.
385         * bfd-in2.h: Regenerate.
386
387 2017-01-11  H.J. Lu  <hongjiu.lu@intel.com>
388
389         PR ld/21038
390         * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
391         (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
392         elf_x86_64_eh_frame_plt_got.
393         (elf_x86_64_size_dynamic_sections): Get unwind info from
394         elf_x86_64_bnd_arch_bed for the BND PLT.
395
396 2017-01-11  Jeremy Soller  <jackpot51@gmail.com>
397
398         * config.bfd: Add entries for i686-redox and x86_64-redox.
399
400 2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>
401
402         * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
403         to 4 bytes.
404         * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
405         .eh_frame section to 4 bytes for x32.
406         (elf_x86_64_check_relocs): Likewise.
407
408 2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>
409
410         PR ld/20830
411         * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
412         (PLT_GOT_FDE_LENGTH): Likewise.
413         (elf_i386_plt_layout): Add eh_frame_plt_got and
414         eh_frame_plt_got_size.
415         (elf_i386_plt): Updated.
416         (elf_i386_link_hash_table): Add plt_got_eh_frame.
417         (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
418         (elf_i386_size_dynamic_sections): Allocate and initialize
419         .eh_frame section for .plt.got.
420         (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
421         .plt.got.
422         (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
423         eh_frame_plt_got_size.
424         * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
425         (PLT_GOT_FDE_LENGTH): Likewise.
426         (elf_x86_64_backend_data): Add eh_frame_plt_got and
427         eh_frame_plt_got_size.
428         (elf_x86_64_arch_bed): Updated.
429         (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
430         eh_frame_plt_got_size.
431         (elf_x86_64_nacl_arch_bed): Likewise.
432         (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
433         (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
434         (elf_x86_64_size_dynamic_sections): Allocate and initialize
435         .eh_frame section for .plt.got.
436         (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
437         for .plt.got.
438
439 2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>
440
441         * elf32-i386.c (elf_i386_size_dynamic_sections): Set
442         plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
443
444 2017-01-09  Nick Clifton  <nickc@redhat.com>
445
446         * dwarf2.c (lookup_address_in_function_table): Return early if
447         there are no functions in the given comp unit, or if the high
448         address of the last function in the comp unit is less than the
449         desired address.
450
451 2017-01-09  Nick Clifton  <nickc@redhat.com>
452
453         PR binutils/21013
454         * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
455         message if there are too many symbols to load.
456
457 2017-01-04  James Clarke  <jrtc27@jrtc27.com>
458
459         * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
460         if relocs are cached.
461
462 2017-01-03  Rich Felker  <bugdal@aerifal.cx>
463
464         PR ld/21017
465         * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
466         for R_MICROBLAZE_GOTOFF_64.
467
468 2017-01-03  Nick Clifton  <nickc@redhat.com>
469
470         * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
471         warning about using a possibly uninitialised variable.
472
473 2017-01-02  Alan Modra  <amodra@gmail.com>
474
475         * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
476         (allocate_plt_static, allocate_dynrelocs): Use it.
477
478 2017-01-02  Alan Modra  <amodra@gmail.com>
479
480         * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
481         .PARISC.unwind section.
482
483 2017-01-02  Alan Modra  <amodra@gmail.com>
484
485         PR ld/20989
486         * elfxx-sparc.c (gdop_relative_offset_ok): New function.
487         (_bfd_sparc_elf_relocate_section): Use it to validate GOT
488         indirect to GOT pointer relative code edit.
489
490 2017-01-02  Alan Modra  <amodra@gmail.com>
491
492         Update year range in copyright notice of all files.
493
494 For older changes see ChangeLog-2016
495 \f
496 Copyright (C) 2017 Free Software Foundation, Inc.
497
498 Copying and distribution of this file, with or without modification,
499 are permitted in any medium without royalty provided the copyright
500 notice and this notice are preserved.
501
502 Local Variables:
503 mode: change-log
504 left-margin: 8
505 fill-column: 74
506 version-control: never
507 End: