Fix a seg-fault in the ELF note parser when a note with an excessively large alignmen...
[external/binutils.git] / bfd / ChangeLog
1 2018-02-08  Nick Clifton  <nickc@redhat.com>
2
3         PR 22788
4         * elf.c (elf_parse_notes): Reject notes with excessuively large
5         alignments.
6
7 2018-02-07  Alan Modra  <amodra@gmail.com>
8
9         Revert 2018-01-17  Alan Modra  <amodra@gmail.com>
10         * elf32-ppc.c: Remove speculation barrier support.
11         * elf32-ppc.h: Likewise.
12         * elf64-ppc.c: Likewise.
13         * elf64-ppc.h: Likewise.
14
15 2018-02-06  Jim Wilson  <jimw@sifive.com>
16
17         * elfnn-riscv.c (riscv_elf_relocate_section): Return TRUE if used
18         callback to report an error.
19
20 2018-02-06  Eric Botcazou  <ebotcazou@adacore.com>
21
22         PR ld/22263
23         * elfxx-sparc.c (sparc_elf_tls_transition): Turn call to bfd_link_pic
24         into call to !bfd_link_executable and tidy up.
25         (_bfd_sparc_elf_check_relocs): Fix formatting and tidy up.
26         <R_SPARC_TLS_LE_HIX22>: Turn call to bfd_link_pic into call to
27         !bfd_link_executable.
28         <R_SPARC_TLS_IE_HI22>: Likewise.
29         <GOT relocations>: Remove useless code, tidy and merge related blocks.
30         <R_SPARC_TLS_GD_CALL>: Turn call to bfd_link_pic into call to
31         !bfd_link_executable.
32         <R_SPARC_WPLT30>: Tidy up.
33         (_bfd_sparc_elf_gc_mark_hook): Turn call to bfd_link_pic into call to
34         !bfd_link_executable.
35         (allocate_dynrelocs): Likewise.
36         (_bfd_sparc_elf_relocate_section): Fix formatting and tidy up.
37         <R_SPARC_TLS_GD_HI22>: Merge into...
38         <R_SPARC_TLS_GD_LO10>: ...this.  Adjust 4th argument in call to
39         sparc_elf_tls_transition and remove redundant code.
40         <R_SPARC_TLS_LDM_HI22>: Turn call to bfd_link_pic into call to
41         !bfd_link_executable.
42         <R_SPARC_TLS_LDO_HIX22>: Likewise.
43         <R_SPARC_TLS_LE_HIX22>: Likewise.  Tidy up.
44         <R_SPARC_TLS_LDM_CALL>: Likewise.
45         <R_SPARC_TLS_GD_CALL>: Likewise.  Tidy up.
46         <R_SPARC_TLS_GD_ADD>: Likewise.
47         <R_SPARC_TLS_LDM_ADD>: Likewise.
48         <R_SPARC_TLS_LDO_ADD>: Likewise.
49         <R_SPARC_TLS_IE_LD>: Likewise.
50
51 2018-02-06  MiloÅ¡ Stojanović  <milos.stojanovic@rt-rk.com>
52
53         PR 22789
54         * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): If the dwarf
55         functions failed to find the function name, try the generic elf
56         find function instead.
57
58 2018-02-06  Sergio Durigan Junior  <sergiodj@redhat.com>
59
60         * coff-rs6000.c (xcoff_write_archive_contents_old): Use
61         'memcpy' instead of 'strncpy' when writing the magic number.
62
63 2018-02-06  Nick Clifton  <nickc@redhat.com>
64
65         PR 22794
66         * opncls.c (bfd_get_debug_link_info_1): Check the size of the
67         section before attempting to read it in.
68         (bfd_get_alt_debug_link_info): Likewise.
69
70 2018-02-06  Paul Carroll  <pcarroll@codesourcery.com>
71
72         * bfd/dwarf2.c (find_abstract_name): Modified to return file and
73         line information in addition to name, if they can be found.
74
75 2018-02-05  Renlin Li  <renlin.li@arm.com>
76
77         PR ld/22764
78         * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Relax the
79         R_AARCH64_ABS32 and R_AARCH64_ABS16 for absolute symbol. Apply the
80         check for writeable section as well.
81
82 2018-02-05  H.J. Lu  <hongjiu.lu@intel.com>
83
84         PR ld/22782
85         * elf32-i386.c (elf_i386_check_relocs): Set got_referenced if
86         _GLOBAL_OFFSET_TABLE_ is referenced or GOT is needed to resolve
87         undefined weak symbol to 0.
88         * elf64-x86-64.c (elf_x86_64_check_relocs): Set got_referenced
89         if _GLOBAL_OFFSET_TABLE_ is referenced.
90         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Check
91         got_referenced instead of ref_regular_nonweak.  Remove the
92         unused _GLOBAL_OFFSET_TABLE_ from symbol table.
93         * elfxx-x86.h (elf_x86_link_hash_table): Add got_referenced.
94
95 2018-02-05  Maciej W. Rozycki  <macro@mips.com>
96
97         * elfnn-riscv.c (_bfd_riscv_relax_pc): Use `memset' to
98         initialize `hi_reloc'.
99
100 2018-02-05  Maciej W. Rozycki  <macro@mips.com>
101
102         * elfxx-mips.c (_bfd_mips_elf_section_processing): For
103         SHT_MIPS_REGINFO sections don't assert the correct size and
104         report an error instead.
105
106 2018-02-05  Maciej W. Rozycki  <macro@mips.com>
107
108         * elf.c (_bfd_elf_write_object_contents): Propagate a failure
109         status from `->elf_backend_section_processing'.
110
111 2018-02-02  Jim Wilson  <jimw@sifive.com>
112
113         PR ld/22756
114         * elfnn-riscv.c (riscv_relax_delete_bytes): New parameter link_info.
115         If link_info->wrap_hash, check for a duplicate symbol and ignore.
116         (_bfd_riscv_relax_call, bfd_riscv_relax_lui, _bfd_riscv_relax_tls_le):
117         Pass new argument to riscv_relax_delete_bytes.
118         (_bfd_riscv_relax_align, _bfd_riscv_relax_delete): Likewise.  Remove
119         ATTRIBUTE_UNUSED from link_info parameter.
120
121 2018-02-02  Alan Modra  <amodra@gmail.com>
122
123         * elf64-ppc.c (ppc64_elf_relocate_section): Don't relocate nops
124         emitted for toc sequence optimization.  Set and use "howto" later.
125
126 2018-02-01  Simon Marchi  <simon.marchi@ericsson.com>
127
128         * elf64-ppc.c (ppc64_elf_archive_symbol_lookup): Avoid pointer
129         arithmetic on NULL pointer.
130         * elflink.c (_bfd_elf_archive_symbol_lookup,
131         elf_link_add_archive_symbols): Likewise.
132
133 2018-01-31  Michael Matz  <matz@suse.de>
134
135         * elflink.c (bfd_elf_define_start_stop): Fix check of
136         def_dynamic.
137
138 2018-01-31  H.J. Lu  <hongjiu.lu@intel.com>
139
140         PR ld/21964
141         * elflink.c (bfd_elf_define_start_stop): Check if __start and
142         __stop symbols are referenced by shared objects.
143
144 2018-01-30  Alan Modra  <amodra@gmail.com>
145
146         PR 22758
147         * elf.c (_bfd_elf_map_sections_to_segments): Don't start a new
148         segment when demand paged with lma on the same page.  Test this
149         before load/non-load, executable/non-executable,
150         writable/non-writable tests and simplify.  Delete bogus relro
151         condition in writable/non-writable test.  Delete outdated
152         comment.  Formatting.
153
154 2018-01-30  Alan Modra  <amodra@gmail.com>
155
156         * elflink.c (bfd_elf_define_start_stop): Make __start and __stop
157         symbols dynamic.
158
159 2018-01-29  Alan Modra  <amodra@gmail.com>
160
161         PR 22741
162         * coffgen.c (coff_pointerize_aux): Ensure auxent tagndx is in
163         range before converting to a symbol table pointer.
164
165 2018-01-27  Nick Clifton  <nickc@redhat.com>
166
167         * po/ru.po: Updated Russian translation.
168
169 2018-01-26  Alan Modra  <amodra@gmail.com>
170
171         * elflink.c (bfd_elf_define_start_stop): Override symbols when
172         they are defined dynamically.
173
174 2018-01-26  Alan Modra  <amodra@gmail.com>
175
176         * elf64-ppc.c (ppc64_elf_size_stubs): Iterate sizing when
177         .branch_lt changes size.
178
179 2018-01-25  Alan Modra  <amodra@gmail.com>
180
181         PR 22746
182         * elfcode.h (elf_object_p): Avoid integer overflow.
183
184 2018-01-25  Eric Botcazou  <ebotcazou@adacore.com>
185
186         PR ld/22727
187         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
188         Do a mere lookup of the __tls_get_addr symbol instead of adding it.
189
190         Revert
191         2017-10-19  H.J. Lu  <hongjiu.lu@intel.com>
192
193         PR ld/22263
194         * elfxx-sparc.c (sparc_elf_tls_transition): Replace
195         bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
196         bfd_link_executable for TLS check.
197         (_bfd_sparc_elf_check_relocs): Likewise.
198         (allocate_dynrelocs): Likewise.
199         (_bfd_sparc_elf_relocate_section): Likewise.
200
201 2018-01-24  Renlin Li  <renlin.li@arm.com>
202
203         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Add support for
204         BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
205         BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
206         BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
207         BFD_RELOC_AARCH64_MOVW_PREL_G3.
208         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
209         (_bfd_aarch64_elf_resolve_relocation): Likewise.
210
211 2018-01-24  Renlin Li  <renlin.li@arm.com>
212
213         * reloc.c: Add BFD_RELOC_AARCH64_MOVW_PREL_G0,
214         BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, BFD_RELOC_AARCH64_MOVW_PREL_G1,
215         BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, BFD_RELOC_AARCH64_MOVW_PREL_G2,
216         BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, BFD_RELOC_AARCH64_MOVW_PREL_G3.
217         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add entries for
218         BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
219         BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
220         BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
221         BFD_RELOC_AARCH64_MOVW_PREL_G3.
222         * bfd-in2.h: Regenerate.
223         * libbfd.h: Regenerate.
224
225 2018-01-23  Maciej W. Rozycki  <macro@mips.com>
226
227         * elfxx-mips.c (_bfd_mips_elf_final_link): Update a stale
228         `mips_elf32_section_processing' comment reference.
229
230 2018-01-20  H.J. Lu  <hongjiu.lu@intel.com>
231
232         PR ld/22721
233         * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Check the
234         versioned __tls_get_addr symbol.
235
236 2018-01-19  Nick Clifton  <nickc@redhat.com>
237
238         * po/fr.po: Updated French translation.
239
240 2018-01-18  Alan Modra  <amodra@gmail.com>
241
242         * elf32-ppc.c (ppc_elf_create_glink): Correct alignment of .glink.
243         * elf64-ppc.c (ppc64_elf_size_stubs): Handle negative plt_stub_align.
244         (ppc64_elf_build_stubs): Likewise.
245
246 2018-01-17  Nick Clifton  <nickc@redhat.com>
247
248         * po/ru.po: Updated Russian translation.
249         * po/uk/po: Updated Ukranian translation.
250
251 2018-01-17  Alan Modra  <amodra@gmail.com>
252
253         * elf64-ppc.c (ppc64_elf_build_stubs): Silence gcc warning.
254
255 2018-01-17  Alan Modra  <amodra@gmail.com>
256
257         * elf32-ppc.c (GLINK_ENTRY_SIZE): Handle speculation barrier.
258         (CRSETEQ, BEQCTRM): Define.
259         (is_nonpic_glink_stub): Don't check bctr.
260         (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
261         (ppc_elf_relax_section): Size speculation barrier.
262         (output_bctr): New function.
263         (write_glink_stub): Use output_bctr.
264         (ppc_elf_relocate_section): Use output_bctr for long branch stub.
265         (ppc_elf_finish_dynamic_symbol): Likewise.
266         (ppc_elf_finish_dynamic_sections): Use output_bctr.
267         * elf32-ppc.h (struct ppc_elf_params): Add speculate_indirect_jumps.
268         * elf64-ppc.c (CRSETEQ, BEQCTRM, BEQCTRLM): Define.
269         (GLINK_PLTRESOLVE_SIZE): Size speculation barrier.
270         (size_global_entry_stubs): Handle speculation barrier sizing.
271         (plt_stub_size): Likewise.
272         (output_bctr): New function.
273         (build_plt_stub, build_tls_get_addr_stub): Output speculation
274         barrier.
275         (ppc_build_one_stub): Likewise for ppc_stub_plt_branch.
276         (ppc_size_one_stub): Size speculation barrier in ppc_stub_plt_branch.
277         (build_global_entry_stubs): Output speculation barrier.
278         (ppc64_elf_build_stubs): Likewise in __glink_PLTresolve stub.
279         * elf64-ppc.h (struct ppc64_elf_params): Add speculate_indirect_jumps.
280
281 2018-01-17  Alan Modra  <amodra@gmail.com>
282
283         * elf32-ppc.c (GLINK_ENTRY_SIZE): Add parameters, handle
284         __tls_get_addr_opt, and alignment sizing.
285         (TLS_GET_ADDR_GLINK_SIZE): Delete.
286         (is_nonpic_glink_stub): Don't use GLINK_ENTRY_SIZE.
287         (ppc_elf_get_synthetic_symtab): Recognize stubs spaced at 4, 6,
288         or 8 insns.
289         (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
290         (allocate_dynrelocs): Use new GLINK_ENTRY_SIZE.
291         (ppc_elf_size_dynamic_sections): Likewise.  Size branch table
292         by PLT reloc count.
293         (write_glink_stub): Handle __tls_get_addr_opt stub.
294         Pad out to size given by GLINK_ENTRY_SIZE.
295         (ppc_elf_relocate_section): Adjust write_glink_stub call.
296         (ppc_elf_finish_dynamic_symbol): Likewise.
297         (ppc_elf_finish_dynamic_sections): Write PLTresolve without using
298         insn array since so many need rewriting.
299         * elf32-ppc.h (struct ppc_elf_params): Add plt_stub_align.
300         * elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Rename from
301         GLINK_CALL_STUB_SIZE.  Add htab param and evaluate to size without
302         nops.  Adjust all uses.
303         (ppc64_elf_get_synthetic_symtab): Don't use GLINK_CALL_STUB_SIZE
304         in glink_vma calculation.
305         (struct ppc_link_hash_table): Add global_entry section pointer.
306         (create_linkage_sections): Create separate section for global
307         entry stubs.
308         (PPC_LO, PPC_HI, PPC_HA): Move earlier.
309         (size_global_entry_stubs): Handle sizing for aligned stubs.
310         (ppc64_elf_size_dynamic_sections): Handle global_entry alloc,
311         and don't stash end of glink branch table in rawsize.
312         (ppc_build_one_stub): Rewrite stub size calculations.
313         (build_global_entry_stubs): Use new section.
314         (ppc64_elf_build_stubs): Don't pad __glink_PLTresolve with nops.
315         Build lazy link stubs out to end of section.  Build global entry
316         stubs in new section.
317
318 2018-01-15  Nick Clifton  <nickc@redhat.com>
319
320         * po/uk.po: Updated Ukranian translation.
321
322 2018-01-13  Nick Clifton  <nickc@redhat.com>
323
324         * po/bfd.pot: Regenerated.
325
326 2018-01-13  Nick Clifton  <nickc@redhat.com>
327
328         * version.m4: Bump version to 2.30.51
329         * configure: Regenerate.
330
331 2018-01-13  Nick Clifton  <nickc@redhat.com>
332
333         2.30 branch created.
334
335 2018-01-12  Jens Widell  <jl@opera.com>
336
337         * elf.c (setup_group): Optimize search for group by remembering
338         last found group and restarting search at that index.
339         * elf-bfd.h (struct elf_obj_tdata): Add group_search_offset field.
340
341 2018-01-12  Gunther Nikl  <gnikl@users.sourceforge.net>
342
343         * aoutx.h (aout_link_check_ar_symbols): Remove default and handle
344         bfd_link_common_skip_none in switch.
345
346 2018-01-12  Alan Modra  <amodra@gmail.com>
347
348         PR ld/22649
349         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Ignore dynamic
350         references on forced local symbols.
351
352 2018-01-12  Vlad Ivanov  <vlad@ivanov.email>
353
354         * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when
355         .reginfo section has wrong size.
356
357 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
358
359         PR ld/22393
360         * elf.c (_bfd_elf_map_sections_to_segments): When generating
361         separate code and read-only data LOAD segments, create a new
362         LOAD segment if the previous section contains text and the
363         current section doesn't or vice versa.  Don't put a writable
364         section in a read-only segment if there is a RELRO segment.
365
366 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
367
368         PR ld/22649
369         * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Ignore dynamic
370         references on forced local symbols.
371
372 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
373
374         PR ld/22677
375         * elflink.c (bfd_elf_gc_sections): Keep all PREINIT_ARRAY,
376         INIT_ARRAY as well as FINI_ARRAY sections for ld -r --gc-section.
377
378 2017-09-27  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
379
380         PR 22662
381         * elf32-nds32.c (nds32_elf_relax_loadstore): Fix a typographical error.
382
383 2018-01-03  John Baldwin  <jhb@FreeBSD.org>
384
385         * elf.c (elfcore_grok_freebsd_note): Handle
386         NT_FREEBSD_PROCSTAT_PROC, NT_FREEBSD_PROCSTAT_FILES, and
387         NT_FREEBSD_PROCSTAT_VMMAP.
388
389 2018-01-03  Alan Modra  <amodra@gmail.com>
390
391         Update year range in copyright notice of all files.
392
393 For older changes see ChangeLog-2017
394 \f
395 Copyright (C) 2018 Free Software Foundation, Inc.
396
397 Copying and distribution of this file, with or without modification,
398 are permitted in any medium without royalty provided the copyright
399 notice and this notice are preserved.
400
401 Local Variables:
402 mode: change-log
403 left-margin: 8
404 fill-column: 74
405 version-control: never
406 End: