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