1 2016-02-06 Cary Coutant <ccoutant@gmail.com>
3 * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
4 overflow checking when symbol value + addend < 0.
6 2016-02-06 Cary Coutant <ccoutant@gmail.com>
9 * reloc.h (Limits): New class.
10 (Bits::has_overflow32): Use min/max values from Limits.
11 (Bits::has_unsigned_overflow32): Likewise.
12 (Bits::has_signed_unsigned_overflow32): Likewise.
13 (Bits::has_overflow): Likewise.
14 (Bits::has_unsigned_overflow): Likewise.
15 (Bits::has_signed_unsigned_overflow64): Likewise.
17 2016-02-06 Cary Coutant <ccoutant@gmail.com>
20 * reloc.h (Relocate_functions::Overflow_check): Add comments.
21 * x86_64.cc (X86_64_relocate_functions): New class.
22 (Target_x86_64::Relocate::relocate): Use the new class.
23 * testsuite/Makefile.am (x86_64_overflow_pc32): Add -Tdata option.
24 (x32_overflow_pc32): New test case.
25 * testsuite/Makefile.in: Regenerate.
26 * testsuite/x32_overflow_pc32.sh: New script.
27 * testsuite/x86_64_overflow_pc32.s: Remove .space directive.
29 2016-02-06 Cary Coutant <ccoutant@gmail.com>
32 * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast.
33 (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
35 2016-02-06 Cary Coutant <ccoutant@gmail.com>
38 * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
40 (Bits::has_unsigned_overflow): Likewise.
42 2016-02-06 Marcin KoĆcielnicki <koriakin@0x04.net>
44 * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
46 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
47 and view_size to is_call_to_non_split.
48 * target.cc (Target::is_call_to_non_split): Add view and view_size
50 * target.h (class Target): Likewise.
52 2016-02-05 Sriraman Tallam <tmsriram@google.com>
54 * icf.cc (get_rel_addend): New function.
55 (get_section_contents): Move merge section addend computation to a
56 new function. Ignore negative values for SHT_REL and SHT_RELA addends.
57 Fix bug to not read past the length of the section.
59 2016-02-05 Cary Coutant <ccoutant@gmail.com>
60 Andrew Senkevich <andrew.senkevich@intel.com>
63 * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
64 checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
66 * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
67 * testsuite/x86_64_overflow_pc32.sh: New test script.
68 * testsuite/x86_64_overflow_pc32.s: New source file.
70 2016-02-05 Cary Coutant <ccoutant@gmail.com>
73 * reloc.h (Relocate_functions::Address): New typedef.
74 (Relocate_functions::Addendtype): New typedef.
75 (Relocate_functions::Overflow_check): New enum type.
76 (Relocate_functions::Reloc_status): New enum type.
77 (Relocate_functions::check_overflow): New function template.
78 (Relocate_functions::rel): Add check parameter; check for overflow.
79 (Relocate_functions::rel_unaligned): Likewise.
80 (Relocate_functions::rela): Likewise.
81 (Relocate_functions::pcrel): Likewise.
82 (Relocate_functions::pcrel_unaligned): Likewise.
83 (Relocate_functions::pcrela): Likewise.
84 (Relocate_functions::rel8): Adjust parameter types.
85 (Relocate_functions::rela8): Likewise.
86 (Relocate_functions::pcrel8): Likewise.
87 (Relocate_functions::pcrela8): Likewise.
88 (Relocate_functions::rel16): Likewise.
89 (Relocate_functions::rela168): Likewise.
90 (Relocate_functions::pcrel16): Likewise.
91 (Relocate_functions::pcrela16): Likewise.
92 (Relocate_functions::rel32): Likewise.
93 (Relocate_functions::rel32_unaligned): Likewise.
94 (Relocate_functions::rela32): Likewise.
95 (Relocate_functions::pcrel32): Likewise.
96 (Relocate_functions::pcrel32_unaligned): Likewise.
97 (Relocate_functions::pcrela32): Likewise.
98 (Relocate_functions::rel8_check): New function.
99 (Relocate_functions::rela8_check): New function.
100 (Relocate_functions::pcrel8_check): New function.
101 (Relocate_functions::pcrela8_check): New function.
102 (Relocate_functions::rel16_check): New function.
103 (Relocate_functions::rela168_check): New function.
104 (Relocate_functions::pcrel16_check): New function.
105 (Relocate_functions::pcrela16_check): New function.
106 (Relocate_functions::rel32_check): New function.
107 (Relocate_functions::rel32_unaligned_check): New function.
108 (Relocate_functions::rela32_check): New function.
109 (Relocate_functions::pcrel32_check): New function.
110 (Relocate_functions::pcrel32_unaligned_check): New function.
111 (Relocate_functions::pcrela32_check): New function.
112 (Bits::has_unsigned_overflow32): New function.
113 (Bits::has_unsigned_overflow): New function.
114 * testsuite/Makefile.am (overflow_unittest): New test.
115 * testsuite/Makefile.in: Regenerate.
116 * testsuite/overflow_unittest.cc: New source file.
118 2016-02-04 Alan Modra <amodra@gmail.com>
120 * powerpc.cc (relocate): Adjust last patch for big-endian.
122 2016-02-02 Alan Modra <amodra@gmail.com>
124 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
126 2016-01-15 Han Shen <shenhan@google.com>
128 PR gold/19472 - need pc-relative stubs.
130 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
131 stub type for DSOs and pie executables.
133 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
135 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
138 2016-01-12 Cary Coutant <ccoutant@gmail.com>
140 * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
141 * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
142 * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
143 specializations) New method.
145 2016-01-11 Cary Coutant <ccoutant@gmail.com>
148 * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
149 we have a TLS segment for GD-to-IE optimization.
150 * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
152 (Target_i386::tls_desc_gd_to_ie): Likewise.
153 (Target_i386::relocate_tls): Don't insist that we have a TLS segment
154 for TLSDESC GD-to-IE optimizations.
155 * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
157 (Target_x86_64::tls_desc_gd_to_ie): Likewise.
158 (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
159 for TLSDESC GD-to-IE optimizations.
161 2016-01-11 Cary Coutant <ccoutant@gmail.com>
163 Refactor gold to enable support for MIPS-64 relocation format.
165 * gc.h (get_embedded_addend_size): Remove sh_type parameter.
166 (gc_process_relocs): Remove sh_type template parameter.
167 Use Classify_reloc to access r_sym, r_type, and r_addend fields.
168 * object.h (Sized_relobj_file::split_stack_adjust): Add target
170 (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
171 * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
172 specializations) Remove.
173 * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
174 (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
175 (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
176 (Sized_relobj_file::split_stack_adjust): Add target parameter.
178 (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
179 Target::get_r_sym() to get r_sym field from relocations.
180 (Track_relocs::next_symndx): Call Target::get_r_sym().
181 * target-reloc.h (scan_relocs): Remove sh_type template parameter;
182 add Classify_reloc template parameter. Use for accessing r_sym and
184 (relocate_section): Likewise.
185 (Default_classify_reloc): New class (renamed and moved from reloc.cc).
186 (Default_scan_relocatable_relocs): Remove sh_type template parameter.
187 (Default_scan_relocatable_relocs::Reltype): New typedef.
188 (Default_scan_relocatable_relocs::reloc_size): New const.
189 (Default_scan_relocatable_relocs::sh_type): New const.
190 (Default_scan_relocatable_relocs::get_r_sym): New method.
191 (Default_scan_relocatable_relocs::get_r_type): New method.
192 (Default_emit_relocs_strategy): New class.
193 (scan_relocatable_relocs): Replace sh_type template parameter with
194 Scan_relocatable_relocs class. Use it to access r_sym and r_type
196 (relocate_relocs): Replace sh_type template parameter with
197 Classify_reloc class. Use it to access r_sym and r_type fields.
198 * target.h (Target::is_call_to_non_split): Replace r_type parameter
199 with pointer to relocation. Adjust all callers.
200 (Target::do_is_call_to_non_split): Likewise.
201 (Target::emit_relocs_scan): New virtual method.
202 (Sized_target::get_r_sym): New virtual method.
203 * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
204 with pointer to relocation.
206 * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
207 (Target_aarch64::Relocatable_size_for_reloc): Remove.
208 (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
209 (Target_aarch64::scan_relocs): Likewise.
210 (Target_aarch64::relocate_section): Likewise.
211 (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
213 (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
214 (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
215 * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
217 (Target_arm::emit_relocs_scan): New method.
218 (Target_arm::Relocatable_size_for_reloc): Replace with...
219 (Target_arm::Classify_reloc): ...this.
220 (Target_arm::gc_process_relocs): Use Classify_reloc.
221 (Target_arm::scan_relocs): Likewise.
222 (Target_arm::relocate_section): Likewise.
223 (Target_arm::scan_relocatable_relocs): Likewise.
224 (Target_arm::relocate_relocs): Likewise.
225 * i386.cc (Target_i386::emit_relocs_scan): New method.
226 (Target_i386::Relocatable_size_for_reloc): Replace with...
227 (Target_i386::Classify_reloc): ...this.
228 (Target_i386::gc_process_relocs): Use Classify_reloc.
229 (Target_i386::scan_relocs): Likewise.
230 (Target_i386::relocate_section): Likewise.
231 (Target_i386::scan_relocatable_relocs): Likewise.
232 (Target_i386::relocate_relocs): Likewise.
233 * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
235 (Mips_reloc_types): New class template.
236 (Mips_classify_reloc): New class template.
237 (Target_mips::Reltype): New typedef.
238 (Target_mips::Relatype): New typedef.
239 (Target_mips::emit_relocs_scan): New method.
240 (Target_mips::get_r_sym): New method.
241 (Target_mips::Relocatable_size_for_reloc): Replace with
243 (Target_mips::copy_reloc): Use Mips_classify_reloc.
244 (Target_mips::gc_process_relocs): Likewise.
245 (Target_mips::scan_relocs): Likewise.
246 (Target_mips::relocate_section): Likewise.
247 (Target_mips::scan_relocatable_relocs): Likewise.
248 (Target_mips::relocate_relocs): Likewise.
249 (mips_get_size_for_reloc): New function, factored out from
250 Relocatable_size_for_reloc::get_size_for_reloc.
251 (Target_mips::Scan::local): Use Mips_classify_reloc.
252 (Target_mips::Scan::global): Likewise.
253 (Target_mips::Relocate::relocate): Likewise.
254 * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
255 (Target_powerpc::Relocatable_size_for_reloc): Remove.
256 (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
257 (Target_powerpc::scan_relocs): Likewise.
258 (Target_powerpc::relocate_section): Likewise.
259 (Powerpc_scan_relocatable_reloc): Convert to class template.
260 (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
261 (Powerpc_scan_relocatable_reloc::reloc_size): New const.
262 (Powerpc_scan_relocatable_reloc::sh_type): New const.
263 (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
264 (Powerpc_scan_relocatable_reloc::get_r_type): New method.
265 (Target_powerpc::scan_relocatable_relocs): Use
266 Powerpc_scan_relocatable_reloc.
267 (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
268 * s390.cc (Target_s390::emit_relocs_scan): New method.
269 (Target_s390::Relocatable_size_for_reloc): Remove.
270 (Target_s390::gc_process_relocs): Use Default_classify_reloc.
271 (Target_s390::scan_relocs): Likewise.
272 (Target_s390::relocate_section): Likewise.
273 (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
275 (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
276 (Target_s390::relocate_relocs): Use Default_classify_reloc.
277 * sparc.cc (Target_sparc::emit_relocs_scan): New method.
278 (Target_sparc::Relocatable_size_for_reloc): Remove.
279 (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
280 (Target_sparc::scan_relocs): Likewise.
281 (Target_sparc::relocate_section): Likewise.
282 (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
284 (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
285 (Target_sparc::relocate_relocs): Use Default_classify_reloc.
286 * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
287 (Target_tilegx::Relocatable_size_for_reloc): Remove.
288 (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
289 (Target_tilegx::scan_relocs): Likewise.
290 (Target_tilegx::relocate_section): Likewise.
291 (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
293 (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
294 (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
295 * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
296 (Target_x86_64::Relocatable_size_for_reloc): Remove.
297 (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
298 (Target_x86_64::scan_relocs): Likewise.
299 (Target_x86_64::relocate_section): Likewise.
300 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
302 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
303 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
305 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
307 2016-01-01 Alan Modra <amodra@gmail.com>
309 Update year range in copyright notice of all files.
311 For older changes see ChangeLog-0815
313 Copyright (C) 2016 Free Software Foundation, Inc.
315 Copying and distribution of this file, with or without modification,
316 are permitted in any medium without royalty provided the copyright
317 notice and this notice are preserved.
323 version-control: never