1 2016-02-05 Cary Coutant <ccoutant@gmail.com>
2 Andrew Senkevich <andrew.senkevich@intel.com>
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
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.
12 2016-02-05 Cary Coutant <ccoutant@gmail.com>
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.
60 2016-02-04 Alan Modra <amodra@gmail.com>
62 * powerpc.cc (relocate): Adjust last patch for big-endian.
64 2016-02-02 Alan Modra <amodra@gmail.com>
66 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
68 2016-01-15 Han Shen <shenhan@google.com>
70 PR gold/19472 - need pc-relative stubs.
72 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
73 stub type for DSOs and pie executables.
75 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
77 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
80 2016-01-12 Cary Coutant <ccoutant@gmail.com>
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.
87 2016-01-11 Cary Coutant <ccoutant@gmail.com>
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.
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.
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.
103 2016-01-11 Cary Coutant <ccoutant@gmail.com>
105 Refactor gold to enable support for MIPS-64 relocation format.
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
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.
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
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
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.
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):
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
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
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
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):
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):
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):
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):
244 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
245 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
247 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
249 2016-01-01 Alan Modra <amodra@gmail.com>
251 Update year range in copyright notice of all files.
253 For older changes see ChangeLog-0815
255 Copyright (C) 2016 Free Software Foundation, Inc.
257 Copying and distribution of this file, with or without modification,
258 are permitted in any medium without royalty provided the copyright
259 notice and this notice are preserved.
265 version-control: never