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