Discard FDEs for zero-length address ranges.
[external/binutils.git] / gold / ChangeLog
1 2016-02-26  Egor Kochetov  <egor.kochetov@intel.com>
2             Cary Coutant  <ccoutant@gmail.com>
3
4         PR gold/19735
5         * ehframe.h (Cie::fde_encoding): New method.
6         * ehframe.cc (Eh_frame::read_fde): Discard FDEs for zero-length
7         address ranges.
8
9 2016-02-15  H.J. Lu  <hongjiu.lu@intel.com>
10
11         * testsuite/Makefile.am (x86_64_mov_to_lea5.o): Pass
12         -mrelax-relocations=yes to $(TEST_AS).
13         (x86_64_mov_to_lea6.o): Likewise.
14         (x86_64_overflow_pc32.o): Remove duplicated target.
15         * testsuite/Makefile.in: Regenerated.
16
17 2016-02-15  Marcin Koƛcielnicki  <koriakin@0x04.net>
18
19         * s390.cc (Target_s390::match_view_u): New helper method.
20         (Target_s390::do_is_call_to_non_split): New method.
21         (Target_s390::ss_code_st_r14): New const.
22         (Target_s390::ss_code_l_r14): New const.
23         (Target_s390::ss_code_bras_8): New const.
24         (Target_s390::ss_code_l_basr): New const.
25         (Target_s390::ss_code_a_basr): New const.
26         (Target_s390::ss_code_ear): New const.
27         (Target_s390::ss_code_c): New const.
28         (Target_s390::ss_code_larl): New const.
29         (Target_s390::ss_code_brasl): New const.
30         (Target_s390::ss_code_jg): New const.
31         (Target_s390::ss_code_jgl): New const.
32         (Target_s390::ss_match_mcount): New helper method.
33         (Target_s390::ss_match_l): New helper method.
34         (Target_s390::ss_match_ahi): New helper method.
35         (Target_s390::ss_match_alfi): New helper method.
36         (Target_s390::ss_match_cr): New helper method.
37         (Target_s390::do_calls_non_split): New method.
38         * testsuite/Makefile.am: Added new tests.
39         * testsuite/Makefile.in: Regenerate.
40         * testsuite/split_s390.sh: New test.
41         * testsuite/split_s390_1_a1.s: New test.
42         * testsuite/split_s390_1_a2.s: New test.
43         * testsuite/split_s390_1_n1.s: New test.
44         * testsuite/split_s390_1_n2.s: New test.
45         * testsuite/split_s390_1_z1.s: New test.
46         * testsuite/split_s390_1_z2.s: New test.
47         * testsuite/split_s390_1_z3.s: New test.
48         * testsuite/split_s390_1_z4.s: New test.
49         * testsuite/split_s390_2_ns.s: New test.
50         * testsuite/split_s390_2_s.s: New test.
51         * testsuite/split_s390x_1_a1.s: New test.
52         * testsuite/split_s390x_1_a2.s: New test.
53         * testsuite/split_s390x_1_n1.s: New test.
54         * testsuite/split_s390x_1_n2.s: New test.
55         * testsuite/split_s390x_1_z1.s: New test.
56         * testsuite/split_s390x_1_z2.s: New test.
57         * testsuite/split_s390x_1_z3.s: New test.
58         * testsuite/split_s390x_1_z4.s: New test.
59         * testsuite/split_s390x_2_ns.s: New test.
60         * testsuite/split_s390x_2_s.s: New test.
61
62 2016-02-11 Rahul Chaudhry  <rahulchaudhry@google.com>
63
64         * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Remove
65         info message for every erratum 843419 found and fixed.
66
67 2016-02-07  Cary Coutant  <ccoutant@gmail.com>
68
69         PR gold/18695
70         * x86_64.cc (Target_x86_64::Relocate::relocate): Add additional
71         information to relocation overflow errors.
72
73 2016-02-06  Cary Coutant  <ccoutant@gmail.com>
74
75         PR gold/18695
76         * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
77         overflow checking when symbol value + addend < 0.
78
79 2016-02-06  Cary Coutant  <ccoutant@gmail.com>
80
81         PR gold/19577
82         * reloc.h (Limits): New class.
83         (Bits::has_overflow32): Use min/max values from Limits.
84         (Bits::has_unsigned_overflow32): Likewise.
85         (Bits::has_signed_unsigned_overflow32): Likewise.
86         (Bits::has_overflow): Likewise.
87         (Bits::has_unsigned_overflow): Likewise.
88         (Bits::has_signed_unsigned_overflow64): Likewise.
89
90 2016-02-06  Cary Coutant  <ccoutant@gmail.com>
91
92         PR gold/19567
93         * reloc.h (Relocate_functions::Overflow_check): Add comments.
94         * x86_64.cc (X86_64_relocate_functions): New class.
95         (Target_x86_64::Relocate::relocate): Use the new class.
96         * testsuite/Makefile.am (x86_64_overflow_pc32): Add -Tdata option.
97         (x32_overflow_pc32): New test case.
98         * testsuite/Makefile.in: Regenerate.
99         * testsuite/x32_overflow_pc32.sh: New script.
100         * testsuite/x86_64_overflow_pc32.s: Remove .space directive.
101
102 2016-02-06  Cary Coutant  <ccoutant@gmail.com>
103
104         PR gold/19577
105         * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast.
106         (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
107
108 2016-02-06  Cary Coutant  <ccoutant@gmail.com>
109
110         PR gold/19577
111         * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
112         comparison.
113         (Bits::has_unsigned_overflow): Likewise.
114
115 2016-02-06  Marcin Koƛcielnicki  <koriakin@0x04.net>
116
117         * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
118         parameters.
119         * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
120         and view_size to is_call_to_non_split.
121         * target.cc (Target::is_call_to_non_split): Add view and view_size
122         parameters.
123         * target.h (class Target): Likewise.
124
125 2016-02-05  Sriraman Tallam  <tmsriram@google.com>
126
127         * icf.cc (get_rel_addend): New function.
128         (get_section_contents):  Move merge section addend computation to a
129         new function.  Ignore negative values for SHT_REL and SHT_RELA addends.
130         Fix bug to not read past the length of the section.
131
132 2016-02-05  Cary Coutant  <ccoutant@gmail.com>
133             Andrew Senkevich  <andrew.senkevich@intel.com>
134
135         PR gold/18695
136         * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
137         checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
138         R_X86_64_PLT32.
139         * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
140         * testsuite/x86_64_overflow_pc32.sh: New test script.
141         * testsuite/x86_64_overflow_pc32.s: New source file.
142
143 2016-02-05  Cary Coutant  <ccoutant@gmail.com>
144
145         PR gold/18695
146         * reloc.h (Relocate_functions::Address): New typedef.
147         (Relocate_functions::Addendtype): New typedef.
148         (Relocate_functions::Overflow_check): New enum type.
149         (Relocate_functions::Reloc_status): New enum type.
150         (Relocate_functions::check_overflow): New function template.
151         (Relocate_functions::rel): Add check parameter; check for overflow.
152         (Relocate_functions::rel_unaligned): Likewise.
153         (Relocate_functions::rela): Likewise.
154         (Relocate_functions::pcrel): Likewise.
155         (Relocate_functions::pcrel_unaligned): Likewise.
156         (Relocate_functions::pcrela): Likewise.
157         (Relocate_functions::rel8): Adjust parameter types.
158         (Relocate_functions::rela8): Likewise.
159         (Relocate_functions::pcrel8): Likewise.
160         (Relocate_functions::pcrela8): Likewise.
161         (Relocate_functions::rel16): Likewise.
162         (Relocate_functions::rela168): Likewise.
163         (Relocate_functions::pcrel16): Likewise.
164         (Relocate_functions::pcrela16): Likewise.
165         (Relocate_functions::rel32): Likewise.
166         (Relocate_functions::rel32_unaligned): Likewise.
167         (Relocate_functions::rela32): Likewise.
168         (Relocate_functions::pcrel32): Likewise.
169         (Relocate_functions::pcrel32_unaligned): Likewise.
170         (Relocate_functions::pcrela32): Likewise.
171         (Relocate_functions::rel8_check): New function.
172         (Relocate_functions::rela8_check): New function.
173         (Relocate_functions::pcrel8_check): New function.
174         (Relocate_functions::pcrela8_check): New function.
175         (Relocate_functions::rel16_check): New function.
176         (Relocate_functions::rela168_check): New function.
177         (Relocate_functions::pcrel16_check): New function.
178         (Relocate_functions::pcrela16_check): New function.
179         (Relocate_functions::rel32_check): New function.
180         (Relocate_functions::rel32_unaligned_check): New function.
181         (Relocate_functions::rela32_check): New function.
182         (Relocate_functions::pcrel32_check): New function.
183         (Relocate_functions::pcrel32_unaligned_check): New function.
184         (Relocate_functions::pcrela32_check): New function.
185         (Bits::has_unsigned_overflow32): New function.
186         (Bits::has_unsigned_overflow): New function.
187         * testsuite/Makefile.am (overflow_unittest): New test.
188         * testsuite/Makefile.in: Regenerate.
189         * testsuite/overflow_unittest.cc: New source file.
190
191 2016-02-04  Alan Modra  <amodra@gmail.com>
192
193         * powerpc.cc (relocate): Adjust last patch for big-endian.
194
195 2016-02-02  Alan Modra  <amodra@gmail.com>
196
197         * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
198
199 2016-01-15 Han Shen  <shenhan@google.com>
200
201         PR gold/19472 - need pc-relative stubs.
202
203         * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
204         stub type for DSOs and pie executables.
205
206 2016-01-12  H.J. Lu  <hongjiu.lu@intel.com>
207
208         * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
209         'typename'.
210
211 2016-01-12  Cary Coutant  <ccoutant@gmail.com>
212
213         * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
214         * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
215         * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
216         specializations) New method.
217
218 2016-01-11  Cary Coutant  <ccoutant@gmail.com>
219
220         PR gold/19353
221         * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
222         we have a TLS segment for GD-to-IE optimization.
223         * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
224         Adjust all calls.
225         (Target_i386::tls_desc_gd_to_ie): Likewise.
226         (Target_i386::relocate_tls): Don't insist that we have a TLS segment
227         for TLSDESC GD-to-IE optimizations.
228         * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
229         Adjust all calls.
230         (Target_x86_64::tls_desc_gd_to_ie): Likewise.
231         (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
232         for TLSDESC GD-to-IE optimizations.
233
234 2016-01-11  Cary Coutant  <ccoutant@gmail.com>
235
236         Refactor gold to enable support for MIPS-64 relocation format.
237
238         * gc.h (get_embedded_addend_size): Remove sh_type parameter.
239         (gc_process_relocs): Remove sh_type template parameter.
240         Use Classify_reloc to access r_sym, r_type, and r_addend fields.
241         * object.h (Sized_relobj_file::split_stack_adjust): Add target
242         parameter.
243         (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
244         * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
245         specializations) Remove.
246         * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
247         (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
248         (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
249         (Sized_relobj_file::split_stack_adjust): Add target parameter.
250         Adjust all callers.
251         (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
252         Target::get_r_sym() to get r_sym field from relocations.
253         (Track_relocs::next_symndx): Call Target::get_r_sym().
254         * target-reloc.h (scan_relocs): Remove sh_type template parameter;
255         add Classify_reloc template parameter.  Use for accessing r_sym and
256         r_type.
257         (relocate_section): Likewise.
258         (Default_classify_reloc): New class (renamed and moved from reloc.cc).
259         (Default_scan_relocatable_relocs): Remove sh_type template parameter.
260         (Default_scan_relocatable_relocs::Reltype): New typedef.
261         (Default_scan_relocatable_relocs::reloc_size): New const.
262         (Default_scan_relocatable_relocs::sh_type): New const.
263         (Default_scan_relocatable_relocs::get_r_sym): New method.
264         (Default_scan_relocatable_relocs::get_r_type): New method.
265         (Default_emit_relocs_strategy): New class.
266         (scan_relocatable_relocs): Replace sh_type template parameter with
267         Scan_relocatable_relocs class.  Use it to access r_sym and r_type
268         fields.
269         (relocate_relocs): Replace sh_type template parameter with
270         Classify_reloc class.  Use it to access r_sym and r_type fields.
271         * target.h (Target::is_call_to_non_split): Replace r_type parameter
272         with pointer to relocation. Adjust all callers.
273         (Target::do_is_call_to_non_split): Likewise.
274         (Target::emit_relocs_scan): New virtual method.
275         (Sized_target::get_r_sym): New virtual method.
276         * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
277         with pointer to relocation.
278
279         * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
280         (Target_aarch64::Relocatable_size_for_reloc): Remove.
281         (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
282         (Target_aarch64::scan_relocs): Likewise.
283         (Target_aarch64::relocate_section): Likewise.
284         (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
285         Remove.
286         (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
287         (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
288         * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
289         template parameter.
290         (Target_arm::emit_relocs_scan): New method.
291         (Target_arm::Relocatable_size_for_reloc): Replace with...
292         (Target_arm::Classify_reloc): ...this.
293         (Target_arm::gc_process_relocs): Use Classify_reloc.
294         (Target_arm::scan_relocs): Likewise.
295         (Target_arm::relocate_section): Likewise.
296         (Target_arm::scan_relocatable_relocs): Likewise.
297         (Target_arm::relocate_relocs): Likewise.
298         * i386.cc (Target_i386::emit_relocs_scan): New method.
299         (Target_i386::Relocatable_size_for_reloc): Replace with...
300         (Target_i386::Classify_reloc): ...this.
301         (Target_i386::gc_process_relocs): Use Classify_reloc.
302         (Target_i386::scan_relocs): Likewise.
303         (Target_i386::relocate_section): Likewise.
304         (Target_i386::scan_relocatable_relocs): Likewise.
305         (Target_i386::relocate_relocs): Likewise.
306         * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
307         parameter.
308         (Mips_reloc_types): New class template.
309         (Mips_classify_reloc): New class template.
310         (Target_mips::Reltype): New typedef.
311         (Target_mips::Relatype): New typedef.
312         (Target_mips::emit_relocs_scan): New method.
313         (Target_mips::get_r_sym): New method.
314         (Target_mips::Relocatable_size_for_reloc): Replace with
315         Mips_classify_reloc.
316         (Target_mips::copy_reloc): Use Mips_classify_reloc.
317         (Target_mips::gc_process_relocs): Likewise.
318         (Target_mips::scan_relocs): Likewise.
319         (Target_mips::relocate_section): Likewise.
320         (Target_mips::scan_relocatable_relocs): Likewise.
321         (Target_mips::relocate_relocs): Likewise.
322         (mips_get_size_for_reloc): New function, factored out from
323         Relocatable_size_for_reloc::get_size_for_reloc.
324         (Target_mips::Scan::local): Use Mips_classify_reloc.
325         (Target_mips::Scan::global): Likewise.
326         (Target_mips::Relocate::relocate): Likewise.
327         * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
328         (Target_powerpc::Relocatable_size_for_reloc): Remove.
329         (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
330         (Target_powerpc::scan_relocs): Likewise.
331         (Target_powerpc::relocate_section): Likewise.
332         (Powerpc_scan_relocatable_reloc): Convert to class template.
333         (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
334         (Powerpc_scan_relocatable_reloc::reloc_size): New const.
335         (Powerpc_scan_relocatable_reloc::sh_type): New const.
336         (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
337         (Powerpc_scan_relocatable_reloc::get_r_type): New method.
338         (Target_powerpc::scan_relocatable_relocs): Use
339         Powerpc_scan_relocatable_reloc.
340         (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
341         * s390.cc (Target_s390::emit_relocs_scan): New method.
342         (Target_s390::Relocatable_size_for_reloc): Remove.
343         (Target_s390::gc_process_relocs): Use Default_classify_reloc.
344         (Target_s390::scan_relocs): Likewise.
345         (Target_s390::relocate_section): Likewise.
346         (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
347         Remove.
348         (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
349         (Target_s390::relocate_relocs): Use Default_classify_reloc.
350         * sparc.cc (Target_sparc::emit_relocs_scan): New method.
351         (Target_sparc::Relocatable_size_for_reloc): Remove.
352         (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
353         (Target_sparc::scan_relocs): Likewise.
354         (Target_sparc::relocate_section): Likewise.
355         (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
356         Remove.
357         (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
358         (Target_sparc::relocate_relocs): Use Default_classify_reloc.
359         * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
360         (Target_tilegx::Relocatable_size_for_reloc): Remove.
361         (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
362         (Target_tilegx::scan_relocs): Likewise.
363         (Target_tilegx::relocate_section): Likewise.
364         (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
365         Remove.
366         (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
367         (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
368         * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
369         (Target_x86_64::Relocatable_size_for_reloc): Remove.
370         (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
371         (Target_x86_64::scan_relocs): Likewise.
372         (Target_x86_64::relocate_section): Likewise.
373         (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
374         Remove.
375         (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
376         (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
377
378         * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
379
380 2016-01-01  Alan Modra  <amodra@gmail.com>
381
382         Update year range in copyright notice of all files.
383
384 For older changes see ChangeLog-0815
385 \f
386 Copyright (C) 2016 Free Software Foundation, Inc.
387
388 Copying and distribution of this file, with or without modification,
389 are permitted in any medium without royalty provided the copyright
390 notice and this notice are preserved.
391
392 Local Variables:
393 mode: change-log
394 left-margin: 8
395 fill-column: 74
396 version-control: never
397 End: