]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gold/ChangeLog
Add some relocation overflow checks for x86_64.
[thirdparty/binutils-gdb.git] / gold / ChangeLog
CommitLineData
c34c98ed
CC
12016-02-05 Cary Coutant <ccoutant@gmail.com>
2 Andrew Senkevich <andrew.senkevich@intel.com>
3
4 PR gold/18695
5 * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
6 checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
7 R_X86_64_PLT32.
8 * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
9 * testsuite/x86_64_overflow_pc32.sh: New test script.
10 * testsuite/x86_64_overflow_pc32.s: New source file.
11
122016-02-05 Cary Coutant <ccoutant@gmail.com>
44803b5d
CC
13
14 PR gold/18695
15 * reloc.h (Relocate_functions::Address): New typedef.
16 (Relocate_functions::Addendtype): New typedef.
17 (Relocate_functions::Overflow_check): New enum type.
18 (Relocate_functions::Reloc_status): New enum type.
19 (Relocate_functions::check_overflow): New function template.
20 (Relocate_functions::rel): Add check parameter; check for overflow.
21 (Relocate_functions::rel_unaligned): Likewise.
22 (Relocate_functions::rela): Likewise.
23 (Relocate_functions::pcrel): Likewise.
24 (Relocate_functions::pcrel_unaligned): Likewise.
25 (Relocate_functions::pcrela): Likewise.
26 (Relocate_functions::rel8): Adjust parameter types.
27 (Relocate_functions::rela8): Likewise.
28 (Relocate_functions::pcrel8): Likewise.
29 (Relocate_functions::pcrela8): Likewise.
30 (Relocate_functions::rel16): Likewise.
31 (Relocate_functions::rela168): Likewise.
32 (Relocate_functions::pcrel16): Likewise.
33 (Relocate_functions::pcrela16): Likewise.
34 (Relocate_functions::rel32): Likewise.
35 (Relocate_functions::rel32_unaligned): Likewise.
36 (Relocate_functions::rela32): Likewise.
37 (Relocate_functions::pcrel32): Likewise.
38 (Relocate_functions::pcrel32_unaligned): Likewise.
39 (Relocate_functions::pcrela32): Likewise.
40 (Relocate_functions::rel8_check): New function.
41 (Relocate_functions::rela8_check): New function.
42 (Relocate_functions::pcrel8_check): New function.
43 (Relocate_functions::pcrela8_check): New function.
44 (Relocate_functions::rel16_check): New function.
45 (Relocate_functions::rela168_check): New function.
46 (Relocate_functions::pcrel16_check): New function.
47 (Relocate_functions::pcrela16_check): New function.
48 (Relocate_functions::rel32_check): New function.
49 (Relocate_functions::rel32_unaligned_check): New function.
50 (Relocate_functions::rela32_check): New function.
51 (Relocate_functions::pcrel32_check): New function.
52 (Relocate_functions::pcrel32_unaligned_check): New function.
53 (Relocate_functions::pcrela32_check): New function.
54 (Bits::has_unsigned_overflow32): New function.
55 (Bits::has_unsigned_overflow): New function.
56 * testsuite/Makefile.am (overflow_unittest): New test.
57 * testsuite/Makefile.in: Regenerate.
58 * testsuite/overflow_unittest.cc: New source file.
59
4f038ee5
AM
602016-02-04 Alan Modra <amodra@gmail.com>
61
62 * powerpc.cc (relocate): Adjust last patch for big-endian.
63
85fabe71
AM
642016-02-02 Alan Modra <amodra@gmail.com>
65
66 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
67
9a472eda
HS
682016-01-15 Han Shen <shenhan@google.com>
69
70 PR gold/19472 - need pc-relative stubs.
71
72 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
73 stub type for DSOs and pie executables.
74
41549dfb
L
752016-01-12 H.J. Lu <hongjiu.lu@intel.com>
76
77 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
78 'typename'.
79
8a8880cb
CC
802016-01-12 Cary Coutant <ccoutant@gmail.com>
81
82 * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
83 * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
84 * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
85 specializations) New method.
86
d21f123b
CC
872016-01-11 Cary Coutant <ccoutant@gmail.com>
88
89 PR gold/19353
90 * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
91 we have a TLS segment for GD-to-IE optimization.
92 * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
93 Adjust all calls.
94 (Target_i386::tls_desc_gd_to_ie): Likewise.
95 (Target_i386::relocate_tls): Don't insist that we have a TLS segment
96 for TLSDESC GD-to-IE optimizations.
97 * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
98 Adjust all calls.
99 (Target_x86_64::tls_desc_gd_to_ie): Likewise.
100 (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
101 for TLSDESC GD-to-IE optimizations.
102
4d625b70
CC
1032016-01-11 Cary Coutant <ccoutant@gmail.com>
104
105 Refactor gold to enable support for MIPS-64 relocation format.
106
107 * gc.h (get_embedded_addend_size): Remove sh_type parameter.
108 (gc_process_relocs): Remove sh_type template parameter.
109 Use Classify_reloc to access r_sym, r_type, and r_addend fields.
110 * object.h (Sized_relobj_file::split_stack_adjust): Add target
111 parameter.
112 (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
113 * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
114 specializations) Remove.
115 * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
116 (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
117 (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
118 (Sized_relobj_file::split_stack_adjust): Add target parameter.
119 Adjust all callers.
120 (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
121 Target::get_r_sym() to get r_sym field from relocations.
122 (Track_relocs::next_symndx): Call Target::get_r_sym().
123 * target-reloc.h (scan_relocs): Remove sh_type template parameter;
124 add Classify_reloc template parameter. Use for accessing r_sym and
125 r_type.
126 (relocate_section): Likewise.
127 (Default_classify_reloc): New class (renamed and moved from reloc.cc).
128 (Default_scan_relocatable_relocs): Remove sh_type template parameter.
129 (Default_scan_relocatable_relocs::Reltype): New typedef.
130 (Default_scan_relocatable_relocs::reloc_size): New const.
131 (Default_scan_relocatable_relocs::sh_type): New const.
132 (Default_scan_relocatable_relocs::get_r_sym): New method.
133 (Default_scan_relocatable_relocs::get_r_type): New method.
134 (Default_emit_relocs_strategy): New class.
135 (scan_relocatable_relocs): Replace sh_type template parameter with
136 Scan_relocatable_relocs class. Use it to access r_sym and r_type
137 fields.
138 (relocate_relocs): Replace sh_type template parameter with
139 Classify_reloc class. Use it to access r_sym and r_type fields.
140 * target.h (Target::is_call_to_non_split): Replace r_type parameter
141 with pointer to relocation. Adjust all callers.
142 (Target::do_is_call_to_non_split): Likewise.
143 (Target::emit_relocs_scan): New virtual method.
144 (Sized_target::get_r_sym): New virtual method.
145 * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
146 with pointer to relocation.
147
148 * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
149 (Target_aarch64::Relocatable_size_for_reloc): Remove.
150 (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
151 (Target_aarch64::scan_relocs): Likewise.
152 (Target_aarch64::relocate_section): Likewise.
153 (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
154 Remove.
155 (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
156 (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
157 * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
158 template parameter.
159 (Target_arm::emit_relocs_scan): New method.
160 (Target_arm::Relocatable_size_for_reloc): Replace with...
161 (Target_arm::Classify_reloc): ...this.
162 (Target_arm::gc_process_relocs): Use Classify_reloc.
163 (Target_arm::scan_relocs): Likewise.
164 (Target_arm::relocate_section): Likewise.
165 (Target_arm::scan_relocatable_relocs): Likewise.
166 (Target_arm::relocate_relocs): Likewise.
167 * i386.cc (Target_i386::emit_relocs_scan): New method.
168 (Target_i386::Relocatable_size_for_reloc): Replace with...
169 (Target_i386::Classify_reloc): ...this.
170 (Target_i386::gc_process_relocs): Use Classify_reloc.
171 (Target_i386::scan_relocs): Likewise.
172 (Target_i386::relocate_section): Likewise.
173 (Target_i386::scan_relocatable_relocs): Likewise.
174 (Target_i386::relocate_relocs): Likewise.
175 * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
176 parameter.
177 (Mips_reloc_types): New class template.
178 (Mips_classify_reloc): New class template.
179 (Target_mips::Reltype): New typedef.
180 (Target_mips::Relatype): New typedef.
181 (Target_mips::emit_relocs_scan): New method.
182 (Target_mips::get_r_sym): New method.
183 (Target_mips::Relocatable_size_for_reloc): Replace with
184 Mips_classify_reloc.
185 (Target_mips::copy_reloc): Use Mips_classify_reloc.
186 (Target_mips::gc_process_relocs): Likewise.
187 (Target_mips::scan_relocs): Likewise.
188 (Target_mips::relocate_section): Likewise.
189 (Target_mips::scan_relocatable_relocs): Likewise.
190 (Target_mips::relocate_relocs): Likewise.
191 (mips_get_size_for_reloc): New function, factored out from
192 Relocatable_size_for_reloc::get_size_for_reloc.
193 (Target_mips::Scan::local): Use Mips_classify_reloc.
194 (Target_mips::Scan::global): Likewise.
195 (Target_mips::Relocate::relocate): Likewise.
196 * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
197 (Target_powerpc::Relocatable_size_for_reloc): Remove.
198 (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
199 (Target_powerpc::scan_relocs): Likewise.
200 (Target_powerpc::relocate_section): Likewise.
201 (Powerpc_scan_relocatable_reloc): Convert to class template.
202 (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
203 (Powerpc_scan_relocatable_reloc::reloc_size): New const.
204 (Powerpc_scan_relocatable_reloc::sh_type): New const.
205 (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
206 (Powerpc_scan_relocatable_reloc::get_r_type): New method.
207 (Target_powerpc::scan_relocatable_relocs): Use
208 Powerpc_scan_relocatable_reloc.
209 (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
210 * s390.cc (Target_s390::emit_relocs_scan): New method.
211 (Target_s390::Relocatable_size_for_reloc): Remove.
212 (Target_s390::gc_process_relocs): Use Default_classify_reloc.
213 (Target_s390::scan_relocs): Likewise.
214 (Target_s390::relocate_section): Likewise.
215 (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
216 Remove.
217 (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
218 (Target_s390::relocate_relocs): Use Default_classify_reloc.
219 * sparc.cc (Target_sparc::emit_relocs_scan): New method.
220 (Target_sparc::Relocatable_size_for_reloc): Remove.
221 (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
222 (Target_sparc::scan_relocs): Likewise.
223 (Target_sparc::relocate_section): Likewise.
224 (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
225 Remove.
226 (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
227 (Target_sparc::relocate_relocs): Use Default_classify_reloc.
228 * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
229 (Target_tilegx::Relocatable_size_for_reloc): Remove.
230 (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
231 (Target_tilegx::scan_relocs): Likewise.
232 (Target_tilegx::relocate_section): Likewise.
233 (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
234 Remove.
235 (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
236 (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
237 * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
238 (Target_x86_64::Relocatable_size_for_reloc): Remove.
239 (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
240 (Target_x86_64::scan_relocs): Likewise.
241 (Target_x86_64::relocate_section): Likewise.
242 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
243 Remove.
244 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
245 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
246
247 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
248
6f2750fe
AM
2492016-01-01 Alan Modra <amodra@gmail.com>
250
251 Update year range in copyright notice of all files.
252
3499769a
AM
253For older changes see ChangeLog-0815
254\f
255Copyright (C) 2016 Free Software Foundation, Inc.
256
257Copying and distribution of this file, with or without modification,
258are permitted in any medium without royalty provided the copyright
259notice and this notice are preserved.
260
261Local Variables:
262mode: change-log
263left-margin: 8
264fill-column: 74
265version-control: never
266End: