1 2016-02-06 Marcin KoĆcielnicki <koriakin@0x04.net>
3 * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
5 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
6 and view_size to is_call_to_non_split.
7 * target.cc (Target::is_call_to_non_split): Add view and view_size
9 * target.h (class Target): Likewise.
11 2016-02-05 Sriraman Tallam <tmsriram@google.com>
13 * icf.cc (get_rel_addend): New function.
14 (get_section_contents): Move merge section addend computation to a
15 new function. Ignore negative values for SHT_REL and SHT_RELA addends.
16 Fix bug to not read past the length of the section.
18 2016-02-05 Cary Coutant <ccoutant@gmail.com>
19 Andrew Senkevich <andrew.senkevich@intel.com>
22 * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
23 checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
25 * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
26 * testsuite/x86_64_overflow_pc32.sh: New test script.
27 * testsuite/x86_64_overflow_pc32.s: New source file.
29 2016-02-05 Cary Coutant <ccoutant@gmail.com>
32 * reloc.h (Relocate_functions::Address): New typedef.
33 (Relocate_functions::Addendtype): New typedef.
34 (Relocate_functions::Overflow_check): New enum type.
35 (Relocate_functions::Reloc_status): New enum type.
36 (Relocate_functions::check_overflow): New function template.
37 (Relocate_functions::rel): Add check parameter; check for overflow.
38 (Relocate_functions::rel_unaligned): Likewise.
39 (Relocate_functions::rela): Likewise.
40 (Relocate_functions::pcrel): Likewise.
41 (Relocate_functions::pcrel_unaligned): Likewise.
42 (Relocate_functions::pcrela): Likewise.
43 (Relocate_functions::rel8): Adjust parameter types.
44 (Relocate_functions::rela8): Likewise.
45 (Relocate_functions::pcrel8): Likewise.
46 (Relocate_functions::pcrela8): Likewise.
47 (Relocate_functions::rel16): Likewise.
48 (Relocate_functions::rela168): Likewise.
49 (Relocate_functions::pcrel16): Likewise.
50 (Relocate_functions::pcrela16): Likewise.
51 (Relocate_functions::rel32): Likewise.
52 (Relocate_functions::rel32_unaligned): Likewise.
53 (Relocate_functions::rela32): Likewise.
54 (Relocate_functions::pcrel32): Likewise.
55 (Relocate_functions::pcrel32_unaligned): Likewise.
56 (Relocate_functions::pcrela32): Likewise.
57 (Relocate_functions::rel8_check): New function.
58 (Relocate_functions::rela8_check): New function.
59 (Relocate_functions::pcrel8_check): New function.
60 (Relocate_functions::pcrela8_check): New function.
61 (Relocate_functions::rel16_check): New function.
62 (Relocate_functions::rela168_check): New function.
63 (Relocate_functions::pcrel16_check): New function.
64 (Relocate_functions::pcrela16_check): New function.
65 (Relocate_functions::rel32_check): New function.
66 (Relocate_functions::rel32_unaligned_check): New function.
67 (Relocate_functions::rela32_check): New function.
68 (Relocate_functions::pcrel32_check): New function.
69 (Relocate_functions::pcrel32_unaligned_check): New function.
70 (Relocate_functions::pcrela32_check): New function.
71 (Bits::has_unsigned_overflow32): New function.
72 (Bits::has_unsigned_overflow): New function.
73 * testsuite/Makefile.am (overflow_unittest): New test.
74 * testsuite/Makefile.in: Regenerate.
75 * testsuite/overflow_unittest.cc: New source file.
77 2016-02-04 Alan Modra <amodra@gmail.com>
79 * powerpc.cc (relocate): Adjust last patch for big-endian.
81 2016-02-02 Alan Modra <amodra@gmail.com>
83 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
85 2016-01-15 Han Shen <shenhan@google.com>
87 PR gold/19472 - need pc-relative stubs.
89 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
90 stub type for DSOs and pie executables.
92 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
94 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
97 2016-01-12 Cary Coutant <ccoutant@gmail.com>
99 * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
100 * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
101 * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
102 specializations) New method.
104 2016-01-11 Cary Coutant <ccoutant@gmail.com>
107 * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
108 we have a TLS segment for GD-to-IE optimization.
109 * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
111 (Target_i386::tls_desc_gd_to_ie): Likewise.
112 (Target_i386::relocate_tls): Don't insist that we have a TLS segment
113 for TLSDESC GD-to-IE optimizations.
114 * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
116 (Target_x86_64::tls_desc_gd_to_ie): Likewise.
117 (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
118 for TLSDESC GD-to-IE optimizations.
120 2016-01-11 Cary Coutant <ccoutant@gmail.com>
122 Refactor gold to enable support for MIPS-64 relocation format.
124 * gc.h (get_embedded_addend_size): Remove sh_type parameter.
125 (gc_process_relocs): Remove sh_type template parameter.
126 Use Classify_reloc to access r_sym, r_type, and r_addend fields.
127 * object.h (Sized_relobj_file::split_stack_adjust): Add target
129 (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
130 * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
131 specializations) Remove.
132 * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
133 (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
134 (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
135 (Sized_relobj_file::split_stack_adjust): Add target parameter.
137 (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
138 Target::get_r_sym() to get r_sym field from relocations.
139 (Track_relocs::next_symndx): Call Target::get_r_sym().
140 * target-reloc.h (scan_relocs): Remove sh_type template parameter;
141 add Classify_reloc template parameter. Use for accessing r_sym and
143 (relocate_section): Likewise.
144 (Default_classify_reloc): New class (renamed and moved from reloc.cc).
145 (Default_scan_relocatable_relocs): Remove sh_type template parameter.
146 (Default_scan_relocatable_relocs::Reltype): New typedef.
147 (Default_scan_relocatable_relocs::reloc_size): New const.
148 (Default_scan_relocatable_relocs::sh_type): New const.
149 (Default_scan_relocatable_relocs::get_r_sym): New method.
150 (Default_scan_relocatable_relocs::get_r_type): New method.
151 (Default_emit_relocs_strategy): New class.
152 (scan_relocatable_relocs): Replace sh_type template parameter with
153 Scan_relocatable_relocs class. Use it to access r_sym and r_type
155 (relocate_relocs): Replace sh_type template parameter with
156 Classify_reloc class. Use it to access r_sym and r_type fields.
157 * target.h (Target::is_call_to_non_split): Replace r_type parameter
158 with pointer to relocation. Adjust all callers.
159 (Target::do_is_call_to_non_split): Likewise.
160 (Target::emit_relocs_scan): New virtual method.
161 (Sized_target::get_r_sym): New virtual method.
162 * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
163 with pointer to relocation.
165 * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
166 (Target_aarch64::Relocatable_size_for_reloc): Remove.
167 (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
168 (Target_aarch64::scan_relocs): Likewise.
169 (Target_aarch64::relocate_section): Likewise.
170 (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
172 (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
173 (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
174 * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
176 (Target_arm::emit_relocs_scan): New method.
177 (Target_arm::Relocatable_size_for_reloc): Replace with...
178 (Target_arm::Classify_reloc): ...this.
179 (Target_arm::gc_process_relocs): Use Classify_reloc.
180 (Target_arm::scan_relocs): Likewise.
181 (Target_arm::relocate_section): Likewise.
182 (Target_arm::scan_relocatable_relocs): Likewise.
183 (Target_arm::relocate_relocs): Likewise.
184 * i386.cc (Target_i386::emit_relocs_scan): New method.
185 (Target_i386::Relocatable_size_for_reloc): Replace with...
186 (Target_i386::Classify_reloc): ...this.
187 (Target_i386::gc_process_relocs): Use Classify_reloc.
188 (Target_i386::scan_relocs): Likewise.
189 (Target_i386::relocate_section): Likewise.
190 (Target_i386::scan_relocatable_relocs): Likewise.
191 (Target_i386::relocate_relocs): Likewise.
192 * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
194 (Mips_reloc_types): New class template.
195 (Mips_classify_reloc): New class template.
196 (Target_mips::Reltype): New typedef.
197 (Target_mips::Relatype): New typedef.
198 (Target_mips::emit_relocs_scan): New method.
199 (Target_mips::get_r_sym): New method.
200 (Target_mips::Relocatable_size_for_reloc): Replace with
202 (Target_mips::copy_reloc): Use Mips_classify_reloc.
203 (Target_mips::gc_process_relocs): Likewise.
204 (Target_mips::scan_relocs): Likewise.
205 (Target_mips::relocate_section): Likewise.
206 (Target_mips::scan_relocatable_relocs): Likewise.
207 (Target_mips::relocate_relocs): Likewise.
208 (mips_get_size_for_reloc): New function, factored out from
209 Relocatable_size_for_reloc::get_size_for_reloc.
210 (Target_mips::Scan::local): Use Mips_classify_reloc.
211 (Target_mips::Scan::global): Likewise.
212 (Target_mips::Relocate::relocate): Likewise.
213 * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
214 (Target_powerpc::Relocatable_size_for_reloc): Remove.
215 (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
216 (Target_powerpc::scan_relocs): Likewise.
217 (Target_powerpc::relocate_section): Likewise.
218 (Powerpc_scan_relocatable_reloc): Convert to class template.
219 (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
220 (Powerpc_scan_relocatable_reloc::reloc_size): New const.
221 (Powerpc_scan_relocatable_reloc::sh_type): New const.
222 (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
223 (Powerpc_scan_relocatable_reloc::get_r_type): New method.
224 (Target_powerpc::scan_relocatable_relocs): Use
225 Powerpc_scan_relocatable_reloc.
226 (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
227 * s390.cc (Target_s390::emit_relocs_scan): New method.
228 (Target_s390::Relocatable_size_for_reloc): Remove.
229 (Target_s390::gc_process_relocs): Use Default_classify_reloc.
230 (Target_s390::scan_relocs): Likewise.
231 (Target_s390::relocate_section): Likewise.
232 (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
234 (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
235 (Target_s390::relocate_relocs): Use Default_classify_reloc.
236 * sparc.cc (Target_sparc::emit_relocs_scan): New method.
237 (Target_sparc::Relocatable_size_for_reloc): Remove.
238 (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
239 (Target_sparc::scan_relocs): Likewise.
240 (Target_sparc::relocate_section): Likewise.
241 (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
243 (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
244 (Target_sparc::relocate_relocs): Use Default_classify_reloc.
245 * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
246 (Target_tilegx::Relocatable_size_for_reloc): Remove.
247 (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
248 (Target_tilegx::scan_relocs): Likewise.
249 (Target_tilegx::relocate_section): Likewise.
250 (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
252 (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
253 (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
254 * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
255 (Target_x86_64::Relocatable_size_for_reloc): Remove.
256 (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
257 (Target_x86_64::scan_relocs): Likewise.
258 (Target_x86_64::relocate_section): Likewise.
259 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
261 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
262 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
264 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
266 2016-01-01 Alan Modra <amodra@gmail.com>
268 Update year range in copyright notice of all files.
270 For older changes see ChangeLog-0815
272 Copyright (C) 2016 Free Software Foundation, Inc.
274 Copying and distribution of this file, with or without modification,
275 are permitted in any medium without royalty provided the copyright
276 notice and this notice are preserved.
282 version-control: never